Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct {
Provides []Provide
Sets []Set
Binds []Bind
Starts []StartHook
Stops []StopHook
Imports []Import
// contains filtered or unexported fields
}
func ExtractModule ¶
ExtractModule scans the given package for a variable named `varName` and attempts to parse its value as an assemble module definition.
func (*Model) SetPkgName ¶ added in v0.1.2
type ModuleRef ¶ added in v0.1.2
type ModuleRef struct {
IsLocalIdent bool
Ident string
IsSelector bool
SelPkgAlias string
SelIdent string
SelPkgPath string // resolved from file imports without types
Imports []Import // imports from the file that declared the function
}
ModuleRef represents a reference to a module variable, either local or from another package.
func ExtractFunctionModuleRefLoose ¶ added in v0.1.2
ExtractFunctionModuleRefLoose scans the syntax (no types) to find:
func <funcName>(...) { return assemble.Assemble(<expr>) }
It returns a ModuleRef with the argument <expr> and the file's imports resolved purely from AST (aliases from source or last path segment).
Click to show internal directories.
Click to hide internal directories.