Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
type File interface { StructByName(name string) Struct PackageName() string Structs(...string) StructList }
File abstract an ast.File.
type Struct ¶
type Struct interface { Name() string Fields() []Field AddField(name, typ string) Field AstTypeSpec() *ast.TypeSpec IsValid() bool }
Struct abstract an ast.TypeSpec
type StructList ¶
type StructList []Struct
StructList is a list of struct.
func Structs ¶
func Structs(node ast.Node, names ...string) (out StructList)
Structs return a list of structs defined in the given node.
func (StructList) FindByName ¶
func (sl StructList) FindByName(name string) Struct
FindByName return the struct matching with the given name.
func (StructList) First ¶
func (sl StructList) First() Struct
First return the first element of the slice.
func (StructList) Names ¶
func (sl StructList) Names() (out []string)
Names return the names of the structs.
Click to show internal directories.
Click to hide internal directories.