Lines Matching refs:r
49 func (r *Reader) Package(path string) (*Package, error) {
50 goPkg, err := r.goPkg(path)
62 func (r *Reader) ModuleType(name string, factory reflect.Value) (*ModuleType, error) {
72 text, err := r.getModuleTypeDoc(pkgPath, factoryName)
86 func (r *Reader) PropertyStruct(pkgPath, name string, defaults reflect.Value) (*PropertyStruct, err…
87 ps := r.getPropertyStruct(pkgPath, name)
90 pkg, err := r.goPkg(pkgPath)
101 ps = r.putPropertyStruct(pkgPath, name, ps)
116 func (r *Reader) getModuleTypeDoc(pkgPath, factoryFuncName string) (string, error) {
117 goPkg, err := r.goPkg(pkgPath)
140 func (r *Reader) getPropertyStruct(pkgPath, name string) *PropertyStruct {
141 r.mutex.Lock()
142 defer r.mutex.Unlock()
146 return r.ps[name]
149 func (r *Reader) putPropertyStruct(pkgPath, name string, ps *PropertyStruct) *PropertyStruct {
150 r.mutex.Lock()
151 defer r.mutex.Unlock()
155 if r.ps[name] != nil {
156 return r.ps[name]
158 r.ps[name] = ps
164 func (r *Reader) goPkg(pkgPath string) (*doc.Package, error) {
165 pkg := r.getGoPkg(pkgPath)
167 if files, ok := r.pkgFiles[pkgPath]; ok {
174 pkg = r.putGoPkg(pkgPath, pkg)
182 func (r *Reader) getGoPkg(pkgPath string) *doc.Package {
183 r.mutex.Lock()
184 defer r.mutex.Unlock()
186 return r.goPkgs[pkgPath]
189 func (r *Reader) putGoPkg(pkgPath string, pkg *doc.Package) *doc.Package {
190 r.mutex.Lock()
191 defer r.mutex.Unlock()
193 if r.goPkgs[pkgPath] != nil {
194 return r.goPkgs[pkgPath]
196 r.goPkgs[pkgPath] = pkg