Documentation
¶
Index ¶
- Variables
- func BoolIsEmpty(v bool) bool
- func DecodeJSONBytesStrict(dst any, body []byte) error
- func Float64IsEmpty(v float64) bool
- func Int64IsEmpty(v int64) bool
- func IntIsEmpty(v int) bool
- func LogRequest(r *http.Request)
- func OptBoolIsEmpty(v *bool) bool
- func OptIntIsEmpty(v *int) bool
- func OptStrIsEmpty(v *string) bool
- func OptTimeIsEmpty(v *time.Time) bool
- func PreparePost[T any](port string, data T) error
- func SendTestPost[T any](port string, data T)
- func SliceStrIsEmpty(v []string) bool
- func StrIsEmpty(v string) bool
- func TimeIsEmpty(v time.Time) bool
- func Uint64IsEmpty(v uint64) bool
- func UintIsEmpty(v uint) bool
- type BoolField
- type Code
- type ErrorItem
- type Errors
- func (e *Errors) Add(field string, code Code)
- func (e Errors) ByField() map[string][]Code
- func (e Errors) ByFieldUnique() map[string][]Code
- func (e Errors) Empty() bool
- func (e Errors) First(field string) (Code, bool)
- func (e Errors) Has(field string) bool
- func (e Errors) HasCode(field string, code Code) bool
- func (e Errors) Items() []ErrorItem
- type Field
- type FieldError
- type Float64Field
- type Int64Field
- type IntField
- type OptBoolField
- type OptFloat64Field
- type OptIntField
- type OptStringField
- type OptTimeField
- type Rule
- type RuleFunc
- type Schema
- type SliceStringField
- type StringField
- type TimeField
- type Uint64Field
- type UintField
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidJSON = errors.New("invalid json") ErrMultipleJSON = errors.New("multiple json objects") )
Functions ¶
func BoolIsEmpty ¶
func DecodeJSONBytesStrict ¶
func Float64IsEmpty ¶
func Int64IsEmpty ¶
func IntIsEmpty ¶
func LogRequest ¶
func OptBoolIsEmpty ¶
func OptIntIsEmpty ¶
func OptStrIsEmpty ¶
func OptTimeIsEmpty ¶
func PreparePost ¶
func SendTestPost ¶
func SliceStrIsEmpty ¶
func StrIsEmpty ¶
func TimeIsEmpty ¶
func Uint64IsEmpty ¶
func UintIsEmpty ¶
Types ¶
type Code ¶
type Code string
const ( CodeRequired Code = "required" CodeInvalid Code = "invalid" CodeMinLen Code = "min_len" CodeMaxLen Code = "max_len" CodeMin Code = "min" CodeMax Code = "max" CodeBetween Code = "between" CodeRegex Code = "regex" CodeEmail Code = "email" CodeURL Code = "url" CodeUUID Code = "uuid" CodeTimezone Code = "timezone" CodeIP Code = "ip" CodeJSON Code = "json" CodeDistinct Code = "distinct" CodeContains Code = "contains" CodeStartsWith Code = "starts_with" CodeEndsWith Code = "ends_with" CodeAlpha Code = "alpha" CodeAlphaNum Code = "alnum" CodeAlphaDash Code = "alphadash" CodeLowercase Code = "lowercase" CodeUppercase Code = "uppercase" CodeCompare Code = "compare" )
type Errors ¶
type Errors []FieldError
func (Errors) ByFieldUnique ¶
type FieldError ¶
type Float64Field ¶
type Int64Field ¶
type OptBoolField ¶
type OptFloat64Field ¶
func OptFloat64 ¶
func OptFloat64[T any](name string, get func(*T) *float64) OptFloat64Field[T]
type OptIntField ¶
type OptStringField ¶
--- nullable (pointer) fields ---
type OptTimeField ¶
type SliceStringField ¶
--- collection fields ---
type StringField ¶
type Uint64Field ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.