Documentation
¶
Index ¶
- Constants
- func Assert(errs ...error) error
- func JsonInteger(v json.Number, name string, validators ...IntegerValidator) error
- func JsonNumber(v json.Number, name string, validators ...FloatValidator) error
- func NonEmptyString(v string, name string) error
- func NonNanNorInf(v float64, name string) error
- func NonNegativeInteger[T NonNegative_Integer](v T, name string) error
- func NonNegativeIntegerSlice[T Slice_NonNegative_Integer](v T, name string) error
- func NonNegativeNumber[T NonNegative_Number](v T, name string) error
- func NonNegativeNumberSlice[T Slice_NonNegative_Number](v T, name string) error
- func ThrowError(name, reason string) error
- type FloatValidator
- type IntegerValidator
- type InvalidArgumentError
- type Negative_Integer
- type NonNegative_Integer
- type NonNegative_Number
- type Slice_Negative_Integer
- type Slice_NonNegative_Integer
- type Slice_NonNegative_Number
Constants ¶
View Source
const ( ERR_OUT_OF_RANGE = "out of range" ERR_NON_NEGATIVE_INTENGER = "should be a non-negative integer" ERR_NON_NEGATIVE_INTENGER_SLICE = "should be a non-negative integer slice" ERR_NEGATIVE_INTENGER = "should be a negative integer" ERR_NON_NEGATIVE_NUMBER = "should be a non-negative number" ERR_NON_NEGATIVE_NUMBER_SLICE = "should be a non-negative number slice" ERR_NAN_OR_INFINITY = "cannot be -inf, +inf or NaN" ERR_EMPTY_STRING = "cannot be an empty string" ERR_INVALID_INTEGER_ASSERTION = "specified integer %d is invalid" )
Reason
Variables ¶
This section is empty.
Functions ¶
func JsonInteger ¶
func JsonInteger(v json.Number, name string, validators ...IntegerValidator) error
func JsonNumber ¶
func JsonNumber(v json.Number, name string, validators ...FloatValidator) error
func NonEmptyString ¶
func NonNanNorInf ¶
func NonNegativeInteger ¶
func NonNegativeInteger[T NonNegative_Integer](v T, name string) error
func NonNegativeIntegerSlice ¶ added in v0.0.19
func NonNegativeIntegerSlice[T Slice_NonNegative_Integer](v T, name string) error
func NonNegativeNumber ¶
func NonNegativeNumber[T NonNegative_Number](v T, name string) error
func NonNegativeNumberSlice ¶ added in v0.0.19
func NonNegativeNumberSlice[T Slice_NonNegative_Number](v T, name string) error
func ThrowError ¶
Types ¶
type FloatValidator ¶
func RangeBetweenFloat ¶
func RangeBetweenFloat(min, max float64) FloatValidator
type IntegerValidator ¶
func IntegerNotIn ¶
func IntegerNotIn(values ...int64) IntegerValidator
func RangeBetween ¶
func RangeBetween(min, max int64) IntegerValidator
type InvalidArgumentError ¶
func (*InvalidArgumentError) Error ¶
func (e *InvalidArgumentError) Error() string
func (*InvalidArgumentError) Unwrap ¶
func (e *InvalidArgumentError) Unwrap() error
Unwrap returns the underlying error.
type Negative_Integer ¶ added in v0.0.19
type NonNegative_Integer ¶ added in v0.0.17
type NonNegative_Number ¶ added in v0.0.17
type NonNegative_Number interface { ~float32 | ~float64 | ~complex64 | ~complex128 }
type Slice_Negative_Integer ¶ added in v0.0.19
type Slice_NonNegative_Integer ¶ added in v0.0.19
type Slice_NonNegative_Number ¶ added in v0.0.19
type Slice_NonNegative_Number interface { ~[]float64 | ~[]float32 | ~[]complex64 | ~[]complex128 }
Click to show internal directories.
Click to hide internal directories.