Documentation ¶
Index ¶
- func CallError(errIdent string) *ast.CallExpr
- func ErrorCheckReturn(errVarIdent string, body ...ast.Stmt) *ast.IfStmt
- func FieldIndex(fields []*ast.Field, i int) (*ast.Ident, ast.Expr, bool)
- func FindFieldWithName(list *ast.FieldList, name string) (*ast.Field, bool)
- func Format(node ast.Node) string
- func GenerateParseValueFromStringStatements(imports *Imports, tmp string, str, typeExp ast.Expr, ...) ([]ast.Stmt, error)
- func GenerateValidations(imports *Imports, variable ast.Expr, variableType types.Type, ...) ([]ast.Stmt, error, bool)
- func HTTPStatusCode(imports *Imports, n int) ast.Expr
- func HTTPStatusName(name string) (int, error)
- func HasFieldWithName(list *ast.FieldList, name string) bool
- func Ident(n string) *ast.Ident
- func Int(n int) *ast.BasicLit
- func IterateFieldTypes(list []*ast.Field) func(func(int, ast.Expr) bool)
- func IterateFunctions(files []*ast.File) func(func(*ast.File, *ast.FuncDecl) bool)
- func IterateGenDecl(files []*ast.File, tok token.Token) func(func(*ast.File, *ast.GenDecl) bool)
- func IterateValueSpecs(files []*ast.File) func(func(*ast.File, *ast.ValueSpec) bool)
- func Load(dir string, patterns ...string) ([]*packages.Package, error)
- func Nil() *ast.Ident
- func ParseStringWithType(val string, tp types.Type) (reflect.Value, error)
- func String(s string) *ast.BasicLit
- func Templates(workingDirectory, templatesVariable string, pkg *packages.Package) (*template.Template, error)
- type Imports
- func (imports *Imports) Add(pkgIdent, pkgPath string) string
- func (imports *Imports) AddContext() string
- func (imports *Imports) AddHTMLTemplate() string
- func (imports *Imports) AddNetHTTP() string
- func (imports *Imports) AddPackages(p *types.Package)
- func (imports *Imports) Call(pkgName, pkgPath, funcIdent string, args []ast.Expr) *ast.CallExpr
- func (imports *Imports) FieldTag(pos token.Pos) (*ast.Field, error)
- func (imports *Imports) FileSet() *token.FileSet
- func (imports *Imports) HTTPErrorCall(response, message ast.Expr, code int) *ast.CallExpr
- func (imports *Imports) Ident(pkgPath string) string
- func (imports *Imports) ImportSpecs() []*ast.ImportSpec
- func (imports *Imports) OutputPackage() string
- func (imports *Imports) SetOutputPackage(pkgPath string)
- func (imports *Imports) SortImports()
- func (imports *Imports) StrconvAtoiCall(expr ast.Expr) *ast.CallExpr
- func (imports *Imports) StrconvParseBoolCall(expr ast.Expr) *ast.CallExpr
- func (imports *Imports) StrconvParseFloatCall(expr ast.Expr, size int) *ast.CallExpr
- func (imports *Imports) StrconvParseIntCall(expr ast.Expr, base, size int) *ast.CallExpr
- func (imports *Imports) StrconvParseUintCall(expr ast.Expr, base, size int) *ast.CallExpr
- func (imports *Imports) SyntaxFile(pos token.Pos) (*ast.File, *token.FileSet, error)
- func (imports *Imports) TimeParseCall(layout string, expr ast.Expr) *ast.CallExpr
- func (imports *Imports) Types(pkgPath string) (*types.Package, bool)
- type MaxValidation
- type MinValidation
- type PatternValidation
- type ValidationGenerator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorCheckReturn ¶ added in v0.8.0
func FieldIndex ¶ added in v0.8.0
func FindFieldWithName ¶ added in v0.8.4
func GenerateParseValueFromStringStatements ¶ added in v0.8.4
func GenerateValidations ¶ added in v0.8.4
func HTTPStatusName ¶ added in v0.8.2
func HasFieldWithName ¶ added in v0.8.4
func IterateFieldTypes ¶ added in v0.7.0
func IterateFunctions ¶
func IterateGenDecl ¶
func IterateValueSpecs ¶
func ParseStringWithType ¶ added in v0.8.4
Types ¶
type Imports ¶ added in v0.8.4
func NewImports ¶ added in v0.8.4
func (*Imports) AddContext ¶ added in v0.8.4
func (*Imports) AddHTMLTemplate ¶ added in v0.8.4
func (*Imports) AddNetHTTP ¶ added in v0.8.4
func (*Imports) AddPackages ¶ added in v0.8.9
func (*Imports) HTTPErrorCall ¶ added in v0.8.4
func (*Imports) ImportSpecs ¶ added in v0.8.4
func (imports *Imports) ImportSpecs() []*ast.ImportSpec
func (*Imports) OutputPackage ¶ added in v0.8.9
func (*Imports) SetOutputPackage ¶ added in v0.8.9
func (*Imports) SortImports ¶ added in v0.8.4
func (imports *Imports) SortImports()
func (*Imports) StrconvAtoiCall ¶ added in v0.8.4
func (*Imports) StrconvParseBoolCall ¶ added in v0.8.4
func (*Imports) StrconvParseFloatCall ¶ added in v0.8.4
func (*Imports) StrconvParseIntCall ¶ added in v0.8.4
func (*Imports) StrconvParseUintCall ¶ added in v0.8.4
func (*Imports) SyntaxFile ¶ added in v0.8.9
func (*Imports) TimeParseCall ¶ added in v0.8.4
type MaxValidation ¶ added in v0.8.4
type MinValidation ¶ added in v0.8.4
type PatternValidation ¶ added in v0.8.4
Click to show internal directories.
Click to hide internal directories.