Documentation ¶
Index ¶
- type Context
- func (c *Context) BuildPackages()
- func (c *Context) GetComments(pkg *packages.Package, node ast.Node, stack []ast.Node) []*ast.CommentGroup
- func (c *Context) GetLocalizeTypeToken(expr ast.Expr) TypeToken
- func (c *Context) GetPosition(pos token.Pos) token.Position
- func (c *Context) GetType(ident *ast.Ident) (*packages.Package, types.Object)
- func (c *Context) SearchIdent(start ast.Node) *ast.Ident
- func (c *Context) SearchIdentAndToken(start ast.Node) (TypeToken, *ast.Ident)
- type Definition
- type DefinitionType
- type Definitions
- type Extractor
- type TypeToken
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct { Config *config.Config Log *log.Entry OriginalPackages []*packages.Package Packages map[string]*packages.Package Inspector *inspector.Inspector CommentMaps map[string]map[string]ast.CommentMap // pkg -> file -> node -> comments Definitions Definitions Templates []*tmpl.Template }
func (*Context) BuildPackages ¶
func (c *Context) BuildPackages()
func (*Context) GetComments ¶
func (*Context) GetLocalizeTypeToken ¶
func (*Context) SearchIdent ¶ added in v0.3.0
type Definition ¶
type Definition struct { Type DefinitionType Token TypeToken Pck *packages.Package Ident *ast.Ident Path string // github.com/name/repo/package/pack ID string // github.com/name/repo/package/pack.StructName Obj types.Object // only for functions and structs FieldIdent *ast.Ident FieldName string // functions only FieldPos int }
func (*Definition) Key ¶
func (d *Definition) Key() string
type DefinitionType ¶
type DefinitionType int
const ( VarSingular DefinitionType = iota Array FunctionReturn FunctionParam StructField )
type Definitions ¶
type Definitions map[string]map[string]*Definition // path.name -> field || "" -> Definition
func (Definitions) Get ¶
func (defs Definitions) Get(key, fieldName string) *Definition
func (Definitions) GetFields ¶
func (defs Definitions) GetFields(key string) map[string]*Definition
Click to show internal directories.
Click to hide internal directories.