Documentation ¶
Index ¶
- Variables
- func New() validator.Collection
- func ValidateBool(value *NullableBool, dflt string) (err error)
- func ValidateDirectory(path *string, dflt string) error
- func ValidateDomain(domain *string, dflt string) error
- func ValidateDuration(d *time.Duration, dflt string) error
- func ValidateEmail(email *string, dflt string) error
- func ValidateFile(path *string, dflt string) error
- func ValidateHTTPSURL(url **URL, dflt string) error
- func ValidateNonempty(value *string, dflt string) error
- func ValidatePort(value *uint16, dflt string) (err error)
- func ValidatePositive(value *int, dflt string) (err error)
- func ValidateSlug(s *string, dflt string) error
- type NullableBool
- type URL
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidSlug = errors.New("invalid slug")
Functions ¶
func New ¶
func New() validator.Collection
New creates a new set of standard validators for the configuration
func ValidateBool ¶
func ValidateBool(value *NullableBool, dflt string) (err error)
func ValidateDirectory ¶
func ValidateDomain ¶
func ValidateEmail ¶
ValidateEmail checks that s represents an email, and then returns it as is.
func ValidateFile ¶
func ValidateHTTPSURL ¶
func ValidateNonempty ¶
func ValidatePort ¶
func ValidatePositive ¶
func ValidateSlug ¶
ValidateSlug validates a slug and normalizes it.
Types ¶
type NullableBool ¶
type NullableBool struct {
Set, Value bool
}
NullableBool represents a bool that can be null
func (NullableBool) MarshalYAML ¶
func (nb NullableBool) MarshalYAML() (interface{}, error)
func (*NullableBool) UnmarshalYAML ¶
func (nb *NullableBool) UnmarshalYAML(value *yaml.Node) error
type URL ¶
URL represents a url.URL that is marshaled as a string representing the url.
func (*URL) MarshalText ¶
func (*URL) UnmarshalText ¶
Click to show internal directories.
Click to hide internal directories.