Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConstantDef ¶
ConstantDef describes defined constants
type FieldDef ¶
type FieldDef struct { CompositionField bool // Could be empty for CompositionField FieldName string FieldType Type JsonName string Nullable bool Comments []string AllTags map[string]string }
FieldDef described parsed go struct field.
type ParsedFile ¶
type ParsedFile struct { Structs []StructDef Constants []ConstantDef Package string }
type TypeArray ¶
type TypeArray struct {
InnerType Type
}
TypeArray indicates that type is golang array or slice. Inner type could be any type golang supports.
type TypeCustom ¶
type TypeCustom struct { // type alias. like `type myCost string` // is true when we cant resolve alias type. Alias bool // contains the alias type AliasType Type Name string Expr ast.Expr }
TypeCustomer indicates that type is a defined struct or type alias.
type TypeInterfaceValue ¶ added in v0.0.6
type TypeInterfaceValue struct{}
TypeInterfaceValue indicates that type is a interface{}
type TypeMap ¶
TypeMap indicates that type is golang map. Both keys and values could be any type golang supports.
type TypePointer ¶
type TypePointer struct {
InnerType Type
}
TypePointer indicates that type is a point with underlying any golang type
type TypeSimple ¶
type TypeSimple struct {
Name string
}
TypeSimple indicates that type is a primitive golang type like int or string.
type Walker ¶
type Walker struct { Structs []StructDef Constants []ConstantDef Package string }
TODO parse type comments Walker implements go/ast.Visitor to walk through golang structs and constants to parse them.