Documentation ¶
Index ¶
- func IsModelNotFoundError(err error) bool
- type Choices
- type Empty
- type ErrType
- type IValidator
- type IValidatorBase
- type ValidateError
- type Validator
- type ValidatorDomainName
- type ValidatorFunc
- type ValidatorIPv4Addr
- type ValidatorModelIdOrName
- type ValidatorRange
- type ValidatorRegexp
- type ValidatorStringChoices
- type ValidatorStruct
- type ValidatorURLPath
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsModelNotFoundError ¶
Types ¶
type Choices ¶
func NewChoices ¶
type IValidator ¶
type IValidator interface { IValidatorBase // contains filtered or unexported methods }
type IValidatorBase ¶
type ValidateError ¶
func (*ValidateError) Error ¶
func (ve *ValidateError) Error() string
type Validator ¶
type Validator struct { Key string // contains filtered or unexported fields }
func (*Validator) Default ¶
func (v *Validator) Default(defaultVal interface{}) IValidator
func (*Validator) Optional ¶
func (v *Validator) Optional(optional bool) IValidator
type ValidatorDomainName ¶
type ValidatorDomainName struct {
ValidatorRegexp
}
func NewDomainNameValidator ¶
func NewDomainNameValidator(key string) *ValidatorDomainName
type ValidatorFunc ¶
type ValidatorIPv4Addr ¶
func NewIPv4AddrValidator ¶
func NewIPv4AddrValidator(key string) *ValidatorIPv4Addr
type ValidatorModelIdOrName ¶
type ValidatorModelIdOrName struct { Validator ModelKeyword string ProjectId string ModelManager db.IModelManager Model db.IModel // contains filtered or unexported fields }
func NewModelIdOrNameValidator ¶
func NewModelIdOrNameValidator(key string, modelKeyword string, projectId string) *ValidatorModelIdOrName
func (*ValidatorModelIdOrName) ModelIdKey ¶
func (v *ValidatorModelIdOrName) ModelIdKey(modelIdKey string) *ValidatorModelIdOrName
func (*ValidatorModelIdOrName) QueryFilter ¶
type ValidatorRange ¶
func NewNonNegativeValidator ¶
func NewNonNegativeValidator(key string) *ValidatorRange
func NewPortValidator ¶
func NewPortValidator(key string) *ValidatorRange
func NewRangeValidator ¶
func NewRangeValidator(key string, lower int64, upper int64) *ValidatorRange
func (*ValidatorRange) Default ¶
func (v *ValidatorRange) Default(i int64) IValidator
type ValidatorRegexp ¶
type ValidatorRegexp struct { Validator Regexp *regexp.Regexp Value string // contains filtered or unexported fields }
func NewRegexpValidator ¶
func NewRegexpValidator(key string, regexp *regexp.Regexp) *ValidatorRegexp
func (*ValidatorRegexp) AllowEmpty ¶
func (v *ValidatorRegexp) AllowEmpty(allowEmpty bool) *ValidatorRegexp
type ValidatorStringChoices ¶
type ValidatorStringChoices struct { Validator Choices Choices Value string // contains filtered or unexported fields }
func NewStringChoicesValidator ¶
func NewStringChoicesValidator(key string, choices Choices) *ValidatorStringChoices
func (*ValidatorStringChoices) Default ¶
func (v *ValidatorStringChoices) Default(s string) IValidator
type ValidatorStruct ¶
type ValidatorStruct struct { Validator Value interface{} }
func NewStructValidator ¶
func NewStructValidator(key string, value interface{}) *ValidatorStruct
type ValidatorURLPath ¶
type ValidatorURLPath struct {
ValidatorRegexp
}
func NewURLPathValidator ¶
func NewURLPathValidator(key string) *ValidatorURLPath
Click to show internal directories.
Click to hide internal directories.