Documentation
¶
Index ¶
- func Alpha(s string) (string, error)
- func Alphanumeric(s string) (string, error)
- func Contains(s string, substr string) (string, error)
- func Email(s string) (string, error)
- func EndsWith(s string, suffix string) (string, error)
- func InRange(n int, min int, max int) (int, error)
- func InRangeFloat(n float64, min float64, max float64) (float64, error)
- func Length(s string, n int) (string, error)
- func LengthBetween(s string, min int, max int) (string, error)
- func ListMaxLength(items []any, n int) ([]any, error)
- func ListMinLength(items []any, n int) ([]any, error)
- func Matches(s string, pattern string) (string, error)
- func Max(n int, max int) (int, error)
- func MaxLength(s string, n int) (string, error)
- func Min(n int, min int) (int, error)
- func MinLength(s string, n int) (string, error)
- func Negative(n int) (int, error)
- func NoHTML(s string) (string, error)
- func NoNullBytes(s string) (string, error)
- func NoWhitespace(s string) (string, error)
- func NonNegative(n int) (int, error)
- func NonZero(n int) (int, error)
- func NotEmpty(s string) (string, error)
- func NotEmptyList(items []any) ([]any, error)
- func Numeric(s string) (string, error)
- func OneOf(s string, allowed ...string) (string, error)
- func ParseBool(s string) (bool, error)
- func ParseFloat(s string) (float64, error)
- func ParseInt(s string) (int, error)
- func ParsePositiveInt(s string) (int, error)
- func Positive(n int) (int, error)
- func PositiveFloat(n float64) (float64, error)
- func Require(s string, fieldName string) (string, error)
- func SafeFilename(s string) (string, error)
- func StartsWith(s string, prefix string) (string, error)
- func URL(s string) (string, error)
- func WithMessage(value string, err error, message string) (string, error)
- type FieldError
- func CheckEmail(path string, s string) (FieldError, bool)
- func CheckLen(path string, length int, want int) (FieldError, bool)
- func CheckMax(path string, n int, max int) (FieldError, bool)
- func CheckMaxLen(path string, length int, max int) (FieldError, bool)
- func CheckMin(path string, n int, min int) (FieldError, bool)
- func CheckMinLen(path string, length int, min int) (FieldError, bool)
- func CheckNonEmpty(path string, s string) (FieldError, bool)
- func CheckNonEmptyLen(path string, length int) (FieldError, bool)
- func CheckNonZero(path string, n int) (FieldError, bool)
- func CheckOneOf(path string, s string, allowed []string) (FieldError, bool)
- func CheckRegex(path string, s string, pattern string) (FieldError, bool)
- func CheckURL(path string, s string) (FieldError, bool)
- func RunIfValidatable(v any) []FieldError
- func RunTags(v any) []FieldError
- type TagValidatable
- type Validatable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Alphanumeric ¶
func NoNullBytes ¶
func NoWhitespace ¶
func NonNegative ¶
func NotEmptyList ¶
func ParseFloat ¶
func ParsePositiveInt ¶
func PositiveFloat ¶
func SafeFilename ¶
Types ¶
type FieldError ¶ added in v0.8.9
func CheckEmail ¶ added in v0.8.9
func CheckEmail(path string, s string) (FieldError, bool)
func CheckMaxLen ¶ added in v0.8.9
func CheckMaxLen(path string, length int, max int) (FieldError, bool)
func CheckMinLen ¶ added in v0.8.9
func CheckMinLen(path string, length int, min int) (FieldError, bool)
func CheckNonEmpty ¶ added in v0.8.9
func CheckNonEmpty(path string, s string) (FieldError, bool)
func CheckNonEmptyLen ¶ added in v0.8.9
func CheckNonEmptyLen(path string, length int) (FieldError, bool)
func CheckNonZero ¶ added in v0.8.9
func CheckNonZero(path string, n int) (FieldError, bool)
func CheckOneOf ¶ added in v0.8.9
func CheckOneOf(path string, s string, allowed []string) (FieldError, bool)
func CheckRegex ¶ added in v0.8.9
func CheckRegex(path string, s string, pattern string) (FieldError, bool)
func RunIfValidatable ¶ added in v0.8.9
func RunIfValidatable(v any) []FieldError
func RunTags ¶ added in v0.8.9
func RunTags(v any) []FieldError
type TagValidatable ¶ added in v0.8.9
type TagValidatable interface {
ValidateTags() []FieldError
}
type Validatable ¶ added in v0.8.9
type Validatable interface {
Validate() []FieldError
}
Click to show internal directories.
Click to hide internal directories.