Documentation ¶
Index ¶
- func AppendStructs(specs []*ast.TypeSpec, f *ast.File) []*ast.TypeSpec
- func Base(t types.Type) string
- func Basic(t types.Type) (*types.Basic, bool)
- func BasicInfo(t types.Type, info types.BasicInfo) (*types.Basic, bool)
- func BasicKind(t types.Type, k types.BasicKind) (*types.Basic, bool)
- func Embedded(field *types.Var) (*types.Struct, bool)
- func ErrorInterface() *types.Interface
- func FieldName(field *types.Var) string
- func ForEachStruct(f *ast.File, fn func(s *ast.StructType, t *ast.TypeSpec))
- func ForEachTypeSpec(f *ast.File, fn func(t *ast.TypeSpec))
- func ForEachValueSpec(f *ast.File, fn func(spec *ast.ValueSpec))
- func ForEachVar(spec *ast.ValueSpec, fn func(id *ast.Ident, v ast.Expr))
- func HasTag(tag, key string) bool
- func IgnoreTestFiles(f os.FileInfo) bool
- func IsString(t types.Type) (ok bool)
- func IsStruct(t types.Type) (ok bool)
- func MakeInterface(name string, params []types.Type, results []types.Type, v bool) *types.Interface
- func MustImport(path string) *types.Package
- func Nilable(t types.Type) bool
- func Pointer(t types.Type) (*types.Pointer, bool)
- func ShortestPath(a, b FieldPath) int
- func Sized(t types.Type) bool
- func Slice(t types.Type) (*types.Slice, bool)
- func String(t types.Type) (*types.Basic, bool)
- func Struct(t types.Type) (*types.Struct, bool)
- func TypeImports(imports []*types.Package, t ...interface{}) []*types.Package
- func TypeSpec(i *ast.Ident) *ast.TypeSpec
- func Vars(pkg *types.Package, typ ...types.Type) (v []*types.Var)
- type Code
- func (c Code) Append(cc Code) Code
- func (c Code) Err() error
- func (c Code) Error(err error) Code
- func (c Code) Errorf(format string, a ...interface{}) Code
- func (c Code) Format() Code
- func (c Code) Import(args ...interface{}) Code
- func (c Code) Print(args ...interface{}) Code
- func (c Code) Printf(format string, args ...interface{}) Code
- func (c Code) Println(args ...interface{}) Code
- func (c Code) QPrintf(q types.Qualifier, format string, args ...interface{}) Code
- func (c Code) String() string
- func (c *Code) Write(p []byte) (int, error)
- type Field
- type FieldIndex
- type FieldPath
- type Fields
- type Package
- func (p *Package) Code(format string, args ...interface{}) (c Code)
- func (p *Package) DefinedTypes(filter TypeFilter) (typs []types.Type)
- func (p *Package) DefinedTypesN(maxResults int, filter TypeFilter) (typs []types.Type)
- func (p *Package) DefinedVars(filter TypeFilter) (vars []Var)
- func (p *Package) FindImport(path string) *types.Package
- func (p *Package) Fprint(w io.Writer, node interface{}) error
- func (p *Package) LookupType(name string) (T *types.Named)
- func (p *Package) Name() string
- func (p *Package) NamedTypes() map[string]*types.Named
- func (p *Package) Path() string
- func (p *Package) Qualifier() types.Qualifier
- func (p *Package) TypeString(t types.Type) string
- type Params
- func (p Params) Assign(other ...Params) Params
- func (p Params) Defaults(other ...Params) Params
- func (p Params) Duration(key string) (d time.Duration)
- func (p Params) Float(key string) (f float64)
- func (p Params) Get(key string) string
- func (p Params) Has(key string) bool
- func (p Params) Int(key string) (i int)
- func (p Params) Pop(key string) (v string)
- func (p Params) Pull(key string) (v string)
- func (p Params) Time(key, format string) (t time.Time)
- func (p Params) ToBool(key string) (bool, error)
- func (p Params) ToDuration(key string) (time.Duration, error)
- func (p Params) ToFloat(key string) (float64, error)
- func (p Params) ToInt(key string) (i int, err error)
- func (p Params) ToTime(key, format string) (time.Time, error)
- func (p Params) True(key string) (b bool)
- func (p Params) Values() url.Values
- func (p Params) With(param string) Params
- type Parser
- type Tag
- type TypeFilter
- type Var
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorInterface ¶
func ForEachStruct ¶
func IgnoreTestFiles ¶
func MakeInterface ¶
func MustImport ¶
func ShortestPath ¶
ShortestPath compares the paths of two fields.
Types ¶
type FieldIndex ¶
func (FieldIndex) Name ¶
func (f FieldIndex) Name() string
type FieldPath ¶
type FieldPath []FieldIndex
type Fields ¶
type Package ¶
type Package struct {
// contains filtered or unexported fields
}
func (*Package) DefinedTypes ¶
func (p *Package) DefinedTypes(filter TypeFilter) (typs []types.Type)
func (*Package) DefinedTypesN ¶
func (p *Package) DefinedTypesN(maxResults int, filter TypeFilter) (typs []types.Type)
func (*Package) DefinedVars ¶
func (p *Package) DefinedVars(filter TypeFilter) (vars []Var)
func (*Package) LookupType ¶
LookupType looks up a named type in the package's definitions.
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
type TypeFilter ¶
func AssignableTo ¶
func AssignableTo(t types.Type) TypeFilter
func ConvertibleTo ¶
func ConvertibleTo(t types.Type) TypeFilter
Click to show internal directories.
Click to hide internal directories.