Documentation
¶
Index ¶
- type AdviceContext
- type AspectContext
- type NodeChain
- func (n *NodeChain) Child(cursor *dstutil.Cursor) *NodeChain
- func (n *NodeChain) Config(name string) (string, bool)
- func (n *NodeChain) Context(cursor *dstutil.Cursor, importPath string, file *dst.File, ...) *context
- func (n *NodeChain) Index() string
- func (n *NodeChain) Node() dst.Node
- func (n *NodeChain) Parent() *NodeChain
- func (n *NodeChain) PropertyName() string
- func (n *NodeChain) SetConfig(val map[string]string)
- type SourceParser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdviceContext ¶
type AdviceContext interface { AspectContext // Child creates a child of this context using the supplied node, property // name and index. Child(dst.Node, string, int) AdviceContext // ReplaceNode replaces the current AST node with the supplied one. ReplaceNode(dst.Node) // ParseSource parses Go source code from the provided bytes and returns a // *dst.File value. ParseSource([]byte) (*dst.File, error) // AddImport records a new synthetic import on this context. AddImport(path string, alias string) bool // AddLink records a new link-time requirement on this context. AddLink(string) bool }
type AspectContext ¶
type AspectContext interface { // Node returns the node represented by this context. Upon entering a join // point, this is the node being inspected. Upon entering advice, this is the // node being advised. Node() dst.Node // Parent returns an AspectContext representing the current node's parent. // Returns nil if the current node is the root of the AST (usually true of // the *dst.File node). Parent() AspectContext // Config loops up the node chain to find a value for the provided // configuration key. Config(string) (string, bool) // File provides direct access to the AST file containing the current node. File() *dst.File // ImportPath returns the import path for the package containing this node. ImportPath() string // Package returns the name of the package containing this node. Package() string }
type NodeChain ¶
type NodeChain struct {
// contains filtered or unexported fields
}
func (*NodeChain) Context ¶
func (n *NodeChain) Context( cursor *dstutil.Cursor, importPath string, file *dst.File, refMap *typed.ReferenceMap, sourceParser SourceParser, ) *context
func (*NodeChain) PropertyName ¶
Click to show internal directories.
Click to hide internal directories.