Documentation
¶
Index ¶
- func Between[T cmp.Ordered](t, min, max T, name string) error
- func Contains[T comparable, S ~[]T](t T, s S, name string) error
- func EqualWith[T comparable](t, want T, name string) error
- func GreaterOrEqual[T cmp.Ordered](t, bound T, name string) error
- func GreaterThan[T cmp.Ordered](t, bound T, name string) error
- func Implements[T any](v any, name string) error
- func LessOrEqual[T cmp.Ordered](t, bound T, name string) error
- func LessThan[T cmp.Ordered](t, bound T, name string) error
- func MaxRune[T ~string](s T, n int, name string) error
- func MinRune[T ~string](s T, n int, name string) error
- func NonEmpty[T comparable](t T, name string) error
- func NonEmptyMap[M ~map[K]V, K comparable, V any](m M, name string) error
- func NonEmptySlice[S ~[]E, E any](s S, name string) error
- func NotContains[T comparable, S ~[]T](t T, s S, name string) error
- func NotEqualWith[T comparable](t, banned T, name string) error
- func NotNil[T any](t *T, name string) error
- func StringContains[T ~string](s T, substr, name string) error
- func StringEndsWith[T ~string](s T, suffix, name string) error
- func StringStartsWith[T ~string](s T, prefix, name string) error
- type ValidError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
func Contains[T comparable, S ~[]T](t T, s S, name string) error
func EqualWith ¶
func EqualWith[T comparable](t, want T, name string) error
func Implements ¶
Implements checks that v can be asserted to T. T is typically an interface type — when T is a concrete type the check degenerates to dynamic-type equality.
func NonEmpty ¶
func NonEmpty[T comparable](t T, name string) error
func NonEmptyMap ¶
func NonEmptyMap[M ~map[K]V, K comparable, V any](m M, name string) error
func NonEmptySlice ¶
func NotContains ¶
func NotContains[T comparable, S ~[]T](t T, s S, name string) error
func NotEqualWith ¶
func NotEqualWith[T comparable](t, banned T, name string) error
func StringContains ¶
func StringEndsWith ¶
func StringStartsWith ¶
Types ¶
type ValidError ¶
func NewValidError ¶
func NewValidError(field string, value any, err error) *ValidError
func (*ValidError) Error ¶
func (v *ValidError) Error() string
func (*ValidError) Unwrap ¶
func (v *ValidError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.