Versions in this module Expand all Collapse all v1 v1.6.1 Apr 15, 2019 v1.5.1 Dec 29, 2017 Changes in this version + const Array + const ArrayItemKey + const ArrayMaxItemsKey + const ArrayMinItemsKey + const Bool + const Byte + const FieldNameFromStructDefinition + const InterfaceFuncKey + const Map + const MapKeyKey + const MapMaxItemsKey + const MapMinItemsKey + const MapValueKey + const NumberMaxKey + const NumberMinKey + const PointerNotNullKey + const PointerNullableKey + const String + const StringMaxLenKey + const StringMinLenKey + const StructFuncKey + const ValidateTag + var ErrUnusedTag = errors.New("unused tag") + func NewArray(inner TypeDef) *typeArray + func NewBool() *typeBool + func NewByte() *typeByte + func NewChan() *typeChan + func NewCustom(fieldName string, typeExpr ast.Expr) *typeCustom + func NewExternalCustom(typeName string, typeExpr ast.Expr) *typeCustom + func NewFunc() *typeFunc + func NewInterface() *typeInterface + func NewMap(key, value TypeDef) *typeMap + func NewNumber(typeName string) *typeNumber + func NewString() *typeString + func ParseTags(astTag *ast.BasicLit, logCtx string) ([]ValidatableTag, FieldTagsNames) + type FieldTagsNames map[string]string + func (n FieldTagsNames) Get(name string) string + func (n FieldTagsNames) GetFromStructDefinition() string + type GenConfig struct + AddImport func(string) + NeedValidatableCheck bool + SeveralErrors bool + SupportedTags []string + type Name struct + func NewIndexedKeyName(labelName, indexVar, validateVar, tagName string) Name + func NewIndexedValueName(labelName, indexVar, validateVar, tagName string) Name + func NewName(pointerPrefix, structVar, labelName, fieldName, tagName string) Name + func NewSimpleNameWithAliasType(fieldName, aliasType string) Name + func (n Name) FieldName() string + func (n Name) Full() string + func (n Name) LabelName() string + func (n Name) WithAlias() string + func (n Name) WithPointer() Name + func (n Name) WithoutPointer() string + type ScopeTag struct + InnerTags []ValidatableTag + Name string + func (t ScopeTag) Key() string + type SimpleTag struct + Name string + Param string + func (t SimpleTag) Key() string + type TypeDef interface + Expr func() ast.Expr + Generate func(w io.Writer, cfg GenConfig, name Name) + NeedGenerate func() bool + SetValidateTag func(ValidatableTag) error + Type func() string + Validate func() error + type TypePointer struct + func NewPointer(inner TypeDef) *TypePointer + func (t *TypePointer) Expr() ast.Expr + func (t *TypePointer) Generate(w io.Writer, cfg GenConfig, name Name) + func (t *TypePointer) SetInnerType(newType TypeDef) *TypePointer + func (t *TypePointer) SetValidateTag(tag ValidatableTag) error + func (t *TypePointer) Type() string + func (t *TypePointer) Validate() error + func (t TypePointer) NeedGenerate() bool + type ValidatableTag interface + Key func() string + type ValidatableTags []ValidatableTag + func (ts ValidatableTags) ContainsTag(t ValidatableTag) bool + func (ts ValidatableTags) Empty() bool