Documentation
¶
Index ¶
- Constants
- func Bool(b bool) *ast.Ident
- func CallError(errIdent string) *ast.CallExpr
- func EmptyStructType() *ast.StructType
- func ExecuteTemplateArguments(node ast.Node, info *types.Info, templatesVariableName string) (string, types.Type, bool)
- 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 FormatFile(filePath string, f *ast.File) (string, error)
- func GenerateValidations(imports *File, variable ast.Expr, variableType types.Type, ...) ([]ast.Stmt, error, bool)
- func HTTPStatusCode(imports *File, n int) ast.Expr
- func HTTPStatusName(name string) (int, error)
- func Int(n int) *ast.BasicLit
- func IterateFieldTypes(list []*ast.Field) func(func(int, ast.Expr) 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 Nil() *ast.Ident
- func ParseStringWithType(val string, tp types.Type) (reflect.Value, error)
- func String(s string) *ast.BasicLit
- type File
- func (file *File) AddNetHTTP() string
- func (file *File) BytesNewBuffer(expr ast.Expr) *ast.CallExpr
- func (file *File) Call(pkgName, pkgPath, funcIdent string, args []ast.Expr) *ast.CallExpr
- func (file *File) Format(variable ast.Expr, kind types.BasicKind) (ast.Expr, error)
- func (file *File) FormatBool(in ast.Expr) *ast.CallExpr
- func (file *File) FormatInt(in ast.Expr) *ast.CallExpr
- func (file *File) FormatInt16(in ast.Expr) *ast.CallExpr
- func (file *File) FormatInt32(in ast.Expr) *ast.CallExpr
- func (file *File) FormatInt64(in ast.Expr) *ast.CallExpr
- func (file *File) FormatInt8(in ast.Expr) *ast.CallExpr
- func (file *File) FormatUint(in ast.Expr) *ast.CallExpr
- func (file *File) FormatUint16(in ast.Expr) *ast.CallExpr
- func (file *File) FormatUint32(in ast.Expr) *ast.CallExpr
- func (file *File) FormatUint64(in ast.Expr) *ast.CallExpr
- func (file *File) FormatUint8(in ast.Expr) *ast.CallExpr
- func (file *File) HTTPErrorCall(response, message ast.Expr, code int) *ast.CallExpr
- func (file *File) HTTPHeader() *ast.SelectorExpr
- func (file *File) HTTPRequestPtr() *ast.StarExpr
- func (file *File) HTTPResponseWriter() *ast.SelectorExpr
- func (file *File) Import(pkgIdent, pkgPath string) string
- func (file *File) ImportSpecs() []*ast.ImportSpec
- func (file *File) OutputPackage() *packages.Package
- func (file *File) Package(path string) (*packages.Package, bool)
- func (file *File) SlogString(key string, val ast.Expr) *ast.CallExpr
- func (file *File) StrconvAtoiCall(expr ast.Expr) *ast.CallExpr
- func (file *File) StrconvItoaCall(expr ast.Expr) *ast.CallExpr
- func (file *File) StrconvParseBoolCall(expr ast.Expr) *ast.CallExpr
- func (file *File) StrconvParseFloatCall(expr ast.Expr, size int) *ast.CallExpr
- func (file *File) StrconvParseInt16Call(in ast.Expr) *ast.CallExpr
- func (file *File) StrconvParseInt32Call(in ast.Expr) *ast.CallExpr
- func (file *File) StrconvParseInt64Call(in ast.Expr) *ast.CallExpr
- func (file *File) StrconvParseInt8Call(in ast.Expr) *ast.CallExpr
- func (file *File) StrconvParseIntCall(expr ast.Expr, base, size int) *ast.CallExpr
- func (file *File) StrconvParseUint0Call(in ast.Expr) *ast.CallExpr
- func (file *File) StrconvParseUint16Call(in ast.Expr) *ast.CallExpr
- func (file *File) StrconvParseUint32Call(in ast.Expr) *ast.CallExpr
- func (file *File) StrconvParseUint64Call(in ast.Expr) *ast.CallExpr
- func (file *File) StrconvParseUint8Call(in ast.Expr) *ast.CallExpr
- func (file *File) StrconvParseUintCall(expr ast.Expr, base, size int) *ast.CallExpr
- func (file *File) StructField(pos token.Pos) (*ast.Field, error)
- func (file *File) SyntaxFile(pos token.Pos) (*ast.File, *token.FileSet, error)
- func (file *File) TimeParseCall(layout string, expr ast.Expr) *ast.CallExpr
- func (file *File) TypeASTExpression(tp types.Type) (ast.Expr, error)
- func (file *File) Types(pkgPath string) (*types.Package, bool)
- type Functions
- type MaxLengthValidation
- type MaxValidation
- type MinLengthValidation
- type MinValidation
- type PatternValidation
- type ValidationErrorBlock
- type ValidationGenerator
Constants ¶
View Source
const IntBitLength = 32 << (^uint(0) >> 63)
Variables ¶
This section is empty.
Functions ¶
func EmptyStructType ¶ added in v0.16.0
func EmptyStructType() *ast.StructType
func ExecuteTemplateArguments ¶ added in v0.12.0
func FieldIndex ¶ added in v0.8.0
func FindFieldWithName ¶ added in v0.8.4
func GenerateValidations ¶ added in v0.8.4
func HTTPStatusName ¶ added in v0.8.2
func IterateFieldTypes ¶ added in v0.7.0
func IterateGenDecl ¶
func IterateValueSpecs ¶
func ParseStringWithType ¶ added in v0.8.4
Types ¶
type File ¶ added in v0.16.0
type File struct {
// contains filtered or unexported fields
}
func (*File) AddNetHTTP ¶ added in v0.16.0
func (*File) BytesNewBuffer ¶ added in v0.16.0
func (*File) FormatInt16 ¶ added in v0.16.0
func (*File) FormatInt32 ¶ added in v0.16.0
func (*File) FormatInt64 ¶ added in v0.16.0
func (*File) FormatUint16 ¶ added in v0.16.0
func (*File) FormatUint32 ¶ added in v0.16.0
func (*File) FormatUint64 ¶ added in v0.16.0
func (*File) FormatUint8 ¶ added in v0.16.0
func (*File) HTTPErrorCall ¶ added in v0.16.0
func (*File) HTTPHeader ¶ added in v0.16.0
func (file *File) HTTPHeader() *ast.SelectorExpr
func (*File) HTTPRequestPtr ¶ added in v0.16.0
func (*File) HTTPResponseWriter ¶ added in v0.16.0
func (file *File) HTTPResponseWriter() *ast.SelectorExpr
func (*File) ImportSpecs ¶ added in v0.16.0
func (file *File) ImportSpecs() []*ast.ImportSpec
func (*File) OutputPackage ¶ added in v0.16.0
func (*File) SlogString ¶ added in v0.16.0
func (*File) StrconvAtoiCall ¶ added in v0.16.0
func (*File) StrconvItoaCall ¶ added in v0.16.0
func (*File) StrconvParseBoolCall ¶ added in v0.16.0
func (*File) StrconvParseFloatCall ¶ added in v0.16.0
func (*File) StrconvParseInt16Call ¶ added in v0.16.0
func (*File) StrconvParseInt32Call ¶ added in v0.16.0
func (*File) StrconvParseInt64Call ¶ added in v0.16.0
func (*File) StrconvParseInt8Call ¶ added in v0.16.0
func (*File) StrconvParseIntCall ¶ added in v0.16.0
func (*File) StrconvParseUint0Call ¶ added in v0.16.0
func (*File) StrconvParseUint16Call ¶ added in v0.16.0
func (*File) StrconvParseUint32Call ¶ added in v0.16.0
func (*File) StrconvParseUint64Call ¶ added in v0.16.0
func (*File) StrconvParseUint8Call ¶ added in v0.16.0
func (*File) StrconvParseUintCall ¶ added in v0.16.0
func (*File) StructField ¶ added in v0.16.0
func (*File) SyntaxFile ¶ added in v0.16.0
func (*File) TimeParseCall ¶ added in v0.16.0
func (*File) TypeASTExpression ¶ added in v0.16.0
type MaxLengthValidation ¶ added in v0.13.1
func (MaxLengthValidation) GenerateValidation ¶ added in v0.13.1
func (val MaxLengthValidation) GenerateValidation(_ *File, variable ast.Expr, handleError ValidationErrorBlock) ast.Stmt
type MaxValidation ¶ added in v0.8.4
func (MaxValidation) GenerateValidation ¶ added in v0.8.4
func (val MaxValidation) GenerateValidation(_ *File, variable ast.Expr, handleError ValidationErrorBlock) ast.Stmt
type MinLengthValidation ¶ added in v0.13.1
func (MinLengthValidation) GenerateValidation ¶ added in v0.13.1
func (val MinLengthValidation) GenerateValidation(_ *File, variable ast.Expr, handleError ValidationErrorBlock) ast.Stmt
type MinValidation ¶ added in v0.8.4
func (MinValidation) GenerateValidation ¶ added in v0.8.4
func (val MinValidation) GenerateValidation(_ *File, variable ast.Expr, handleError ValidationErrorBlock) ast.Stmt
type PatternValidation ¶ added in v0.8.4
func (PatternValidation) GenerateValidation ¶ added in v0.8.4
func (val PatternValidation) GenerateValidation(imports *File, variable ast.Expr, handleError ValidationErrorBlock) ast.Stmt
type ValidationErrorBlock ¶ added in v0.16.0
type ValidationGenerator ¶ added in v0.8.4
type ValidationGenerator interface {
GenerateValidation(imports *File, variable ast.Expr, handleError ValidationErrorBlock) ast.Stmt
}
func ParseInputValidations ¶ added in v0.8.4
Click to show internal directories.
Click to hide internal directories.