Documentation ¶
Index ¶
- func IsModelNotFoundError(err error) bool
- type Choices
- type Empty
- type ErrType
- type IValidator
- type IValidatorBase
- type ValidateError
- type Validator
- type ValidatorBool
- type ValidatorCertificate
- type ValidatorDomainName
- type ValidatorFunc
- type ValidatorIPv4Addr
- type ValidatorModelIdOrName
- func (v *ValidatorModelIdOrName) GetProjectId() string
- func (v *ValidatorModelIdOrName) GetTenantId() string
- func (v *ValidatorModelIdOrName) GetUserId() string
- func (v *ValidatorModelIdOrName) ModelIdKey(modelIdKey string) *ValidatorModelIdOrName
- func (v *ValidatorModelIdOrName) QueryFilter(q *sqlchemy.SQuery, data *jsonutils.JSONDict) (*sqlchemy.SQuery, error)
- func (v *ValidatorModelIdOrName) Validate(data *jsonutils.JSONDict) error
- type ValidatorPEM
- type ValidatorPrivateKey
- type ValidatorRange
- type ValidatorRegexp
- type ValidatorStringChoices
- type ValidatorStringMultiChoices
- func (v *ValidatorStringMultiChoices) Default(s string) IValidator
- func (v *ValidatorStringMultiChoices) KeepDup(b bool) *ValidatorStringMultiChoices
- func (v *ValidatorStringMultiChoices) Sep(s string) *ValidatorStringMultiChoices
- func (v *ValidatorStringMultiChoices) Validate(data *jsonutils.JSONDict) error
- 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 Optional(bool) IValidator // 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 ValidatorBool ¶
func NewBoolValidator ¶
func NewBoolValidator(key string) *ValidatorBool
func (*ValidatorBool) Default ¶
func (v *ValidatorBool) Default(i bool) IValidator
type ValidatorCertificate ¶
type ValidatorCertificate struct { ValidatorPEM Certificates []*x509.Certificate }
func NewCertificateValidator ¶
func NewCertificateValidator(key string) *ValidatorCertificate
func (*ValidatorCertificate) FingerprintSha256 ¶
func (v *ValidatorCertificate) FingerprintSha256() []byte
func (*ValidatorCertificate) FingerprintSha256String ¶
func (v *ValidatorCertificate) FingerprintSha256String() string
func (*ValidatorCertificate) PublicKeyBitLen ¶
func (v *ValidatorCertificate) PublicKeyBitLen() int
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 UserId 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) GetProjectId ¶
func (v *ValidatorModelIdOrName) GetProjectId() string
func (*ValidatorModelIdOrName) GetTenantId ¶
func (v *ValidatorModelIdOrName) GetTenantId() string
func (*ValidatorModelIdOrName) GetUserId ¶
func (v *ValidatorModelIdOrName) GetUserId() string
func (*ValidatorModelIdOrName) ModelIdKey ¶
func (v *ValidatorModelIdOrName) ModelIdKey(modelIdKey string) *ValidatorModelIdOrName
func (*ValidatorModelIdOrName) QueryFilter ¶
type ValidatorPEM ¶
func NewPEMValidator ¶
func NewPEMValidator(key string) *ValidatorPEM
type ValidatorPrivateKey ¶
type ValidatorPrivateKey struct { ValidatorPEM PrivateKey crypto.PrivateKey }
func NewPrivateKeyValidator ¶
func NewPrivateKeyValidator(key string) *ValidatorPrivateKey
func (*ValidatorPrivateKey) MatchCertificate ¶
func (v *ValidatorPrivateKey) MatchCertificate(cert *x509.Certificate) error
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 ValidatorStringMultiChoices ¶
type ValidatorStringMultiChoices struct { Validator Choices Choices Value string // contains filtered or unexported fields }
func NewStringMultiChoicesValidator ¶
func NewStringMultiChoicesValidator(key string, choices Choices) *ValidatorStringMultiChoices
func (*ValidatorStringMultiChoices) Default ¶
func (v *ValidatorStringMultiChoices) Default(s string) IValidator
func (*ValidatorStringMultiChoices) KeepDup ¶
func (v *ValidatorStringMultiChoices) KeepDup(b bool) *ValidatorStringMultiChoices
func (*ValidatorStringMultiChoices) Sep ¶
func (v *ValidatorStringMultiChoices) Sep(s string) *ValidatorStringMultiChoices
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.