Documentation ¶
Index ¶
- Variables
- func Bool(opts ...any) genericValidator[bool]
- func Email(message ...string) stringValidatorOpt
- func Enum(values ...string) stringValidatorOpt
- func False(message ...string) boolValidatorOpt
- func Float32(opts ...any) genericValidator[float32]
- func Float64(opts ...any) genericValidator[float64]
- func Int(opts ...any) genericValidator[int]
- func Int16(opts ...any) genericValidator[int16]
- func Int32(opts ...any) genericValidator[int32]
- func Int64(opts ...any) genericValidator[int64]
- func Matches(patt string, message ...string) stringValidatorOpt
- func Max(max float64, message ...string) numberValidatorOpt
- func MaxFileCount(count int, message ...string) parseOpt[[]File]
- func MaxFileSize(size int, message ...string) parseOpt[[]File]
- func MaxLength(max int, message ...string) stringValidatorOpt
- func Min(min float64, message ...string) numberValidatorOpt
- func MinLength(min int, message ...string) stringValidatorOpt
- func MustBeInteger(message ...string) numberValidatorOpt
- func NonNullUUID(message ...string) uuidValidatorOpt
- func NonZero(message ...string) numberValidatorOpt
- func NotAfter(datum time.Time, message ...string) timeValidatorOpt
- func NotBefore(datum time.Time, message ...string) timeValidatorOpt
- func Object(opts ...any) *objectValidator
- func Required(message ...string) genericValidatorOpt
- func String(opts ...any) genericValidator[string]
- func Time(opts ...any) genericValidator[time.Time]
- func True(message ...string) boolValidatorOpt
- func UInt(opts ...any) genericValidator[uint]
- func UInt16(opts ...any) genericValidator[uint16]
- func UInt32(opts ...any) genericValidator[uint32]
- func UInt64(opts ...any) genericValidator[uint64]
- func UUID(opts ...any) genericValidator[uuid.UUID]
- func WithDefault(val any) genericValidatorOpt
- func WithMaxBodySize(size int64) objectValidatorOpt
- func WithTimeFormat(layout string) genericValidatorOpt
- type File
- type ObjectParseResult
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrMissingDateParser = &parseError{message: "missing date parser"}
View Source
var InvalidTypeError = &parseError{
message: "invalid type",
}
View Source
var InvalidValidatorStateError = &parseError{
message: "invalid type",
}
View Source
var InvalidValueError = &parseError{
message: "invalid value",
}
View Source
var MissingTransformerError = &parseError{
message: "missing property transformer",
}
Functions ¶
func MaxFileCount ¶ added in v0.1.2
func MaxFileSize ¶ added in v0.1.2
func MustBeInteger ¶
func MustBeInteger(message ...string) numberValidatorOpt
func NonNullUUID ¶
func NonNullUUID(message ...string) uuidValidatorOpt
func WithDefault ¶
func WithDefault(val any) genericValidatorOpt
func WithMaxBodySize ¶
func WithMaxBodySize(size int64) objectValidatorOpt
func WithTimeFormat ¶
func WithTimeFormat(layout string) genericValidatorOpt
Types ¶
type File ¶ added in v0.1.2
type File struct {
Header *multipart.FileHeader
}
type ObjectParseResult ¶
type ObjectParseResult interface { IsFieldValid(field string) bool IsAllValid() bool GetError(field string) string GetField(field string) *parseResult[any] GetString(field string) string GetInt(field string) int GetBool(field string) bool Unmarshal(target any) error // contains filtered or unexported methods }
Click to show internal directories.
Click to hide internal directories.