Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectPackageInType ¶
func RebuildOps ¶
func RemoveJsonIgnoredFields ¶
func RemoveJsonIgnoredFields(def *Definition)
Types ¶
type Definition ¶
type Definition struct { Import godetector.Import Decl *ast.GenDecl Type *ast.TypeSpec TypeName string FS *token.FileSet FileDir string File *ast.File Package map[string]*ast.Package // contains filtered or unexported fields }
func FindDefinitionFromAst ¶
func FindDefinitionFromAst(typeName, alias string, file *ast.File, fileDir string) *Definition
func (*Definition) FindEnumValues ¶
func (def *Definition) FindEnumValues() []Constant
func (*Definition) IsStruct ¶
func (def *Definition) IsStruct() bool
func (*Definition) IsTypeAlias ¶
func (def *Definition) IsTypeAlias() bool
func (*Definition) RemoveJSONIgnoredFields ¶
func (def *Definition) RemoveJSONIgnoredFields()
func (*Definition) StructFields ¶
func (def *Definition) StructFields() []*StField
type Typer ¶
type Typer struct { Ordered []*Definition // Inspected and parsed definition in order of inspection Parsed map[string]*Definition // Indexed definition where index is <path>@<type> BeforeInspect func(def *Definition) // Invoke hook before inspection (ex: RemoveJsonIgnoredFields) }
Deeply parsed types. Currently supports only structs
func (*Typer) Add ¶
func (tsg *Typer) Add(def *Definition)
Add recursively pre-parsed structure definition
func (*Typer) AddFromDir ¶
Parse and add recursively type from directory. Do nothing if not found
func (*Typer) AddFromFile ¶
Parse and add recursively type from specific file
func (*Typer) AddFromImport ¶
Parse and add type using full import name using current working directory
Click to show internal directories.
Click to hide internal directories.