Documentation ¶
Overview ¶
Package ainsp is a Go ast library for aah framework, it does inspect and discovers the Go `struct` which embeds particular type `struct`.
For e.g.: `aahframework.org/{aah.Context, ws.Context}`, etc.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Program ¶
type Program struct { Path string Packages []*packageInfo RegisteredActions map[string]map[string]uint8 }
Program holds all details loaded from the Go source code for given Import Path.
func Inspect ¶
func Inspect(dir, importPath string, excludes ess.Excludes, registeredActions map[string]map[string]uint8) (*Program, []error)
Inspect method processes the Go source code for the given directory and its sub-directories.
func (*Program) CreateImportPaths ¶
func (prg *Program) CreateImportPaths(types []*typeInfo, importPaths map[string]string) map[string]string
CreateImportPaths method returns unique package alias with import path.
func (*Program) FindTypeByEmbeddedType ¶
FindTypeByEmbeddedType method returns all the typeInfo that has directly or indirectly embedded by given type name. Type name must be fully qualified type name. E.g.: aahframework.org/aah.Controller
type Target ¶
type Target struct { Name string FqName string NoSuffixName string Namespace string Type reflect.Type Methods map[string]*Method EmbeddedIndexes [][]int }
Target struct holds info about targeted controller, websocket, etc.
type TargetRegistry ¶
TargetRegistry struct holds registered information and provides lookup. Such as aah application controllers, websockets, etc.
func (*TargetRegistry) Add ¶
func (tr *TargetRegistry) Add(t interface{}, methods []*Method)
Add method adds given target struct and its methods after processing.
func (*TargetRegistry) Lookup ¶
func (tr *TargetRegistry) Lookup(fqName string) *Target
Lookup method returns `Target` info from registry for given `fqName` (fully qualified name) otherwise nil.
It does exact match or exact suffix match.