Versions in this module Expand all Collapse all v0 v0.1.1 Mar 19, 2025 Changes in this version + const ListMapKeyTagName + func RegisterTagValidator(tv TagValidator) + func RegisterTypeValidator(tv TypeValidator) + type Conditions struct + OptionDisabled string + OptionEnabled string + func (c Conditions) Empty() bool + type Config struct + GengoContext *generator.Context + Validator Validator + type Context struct + Member *types.Member + Parent *types.Type + Path *field.Path + Scope Scope + Type *types.Type + type FunctionFlags uint32 + const DefaultFlags + const NonError + const ShortCircuit + func (ff FunctionFlags) IsSet(wanted FunctionFlags) bool + type FunctionGen interface + Conditions func() Conditions + Flags func() FunctionFlags + SignatureAndArgs func() (function types.Name, extraArgs []any) + TagName func() string + TypeArgs func() []types.Name + func Function(tagName string, flags FunctionFlags, function types.Name, extraArgs ...any) FunctionGen + func GenericFunction(tagName string, flags FunctionFlags, function types.Name, ...) FunctionGen + func WithCondition(fn FunctionGen, conditions Conditions) FunctionGen + type FunctionLiteral struct + Body string + Parameters []ParamResult + Results []ParamResult + type Identifier types.Name + type LateTagValidator interface + LateTagValidator func() + type Literal string + type ParamResult struct + Name string + Type *types.Type + type PrivateVar types.Name + type Scope string + const ScopeAny + const ScopeField + const ScopeListVal + const ScopeMapKey + const ScopeMapVal + const ScopeType + type TagArgDoc struct + Description string + type TagDoc struct + Args []TagArgDoc + Description string + Docs string + Payloads []TagPayloadDoc + Scopes []Scope + Tag string + Usage string + type TagPayloadDoc struct + Description string + Docs string + Schema []TagPayloadSchema + type TagPayloadSchema struct + Default string + Docs string + Key string + Value string + type TagValidator interface + Docs func() TagDoc + GetValidations func(context Context, args []string, payload string) (Validations, error) + Init func(cfg Config) + TagName func() string + ValidScopes func() sets.Set[Scope] + type TypeValidator interface + GetValidations func(context Context) (Validations, error) + Init func(cfg Config) + Name func() string + type Validations struct + Comments []string + Functions []FunctionGen + OpaqueKeyType bool + OpaqueType bool + OpaqueValType bool + Variables []VariableGen + func ForEachKey(_ *field.Path, t *types.Type, fn FunctionGen) (Validations, error) + func ForEachVal(fldPath *field.Path, t *types.Type, fn FunctionGen) (Validations, error) + func (v *Validations) Add(o Validations) + func (v *Validations) AddComment(comment string) + func (v *Validations) AddFunction(f FunctionGen) + func (v *Validations) AddVariable(variable VariableGen) + func (v *Validations) Empty() bool + func (v *Validations) Len() int + type Validator interface + Docs func() []TagDoc + ExtractValidations func(context Context, comments []string) (Validations, error) + func InitGlobalValidator(c *generator.Context) Validator + type VariableGen interface + Init func() FunctionGen + TagName func() string + Var func() PrivateVar + func Variable(variable PrivateVar, init FunctionGen) VariableGen + type WrapperFunction struct + Function FunctionGen + ObjType *types.Type