Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsWebProxyAlias ¶ added in v0.62.2
IsWebProxyAlias reports whether s is a valid web-proxy alias: a strict lowercase RFC 1123 DNS label (1-63 characters of a-z, 0-9 and '-', starting and ending with a letter or digit) that additionally contains no "--" (the web proxy's host-label separator) and is not all digits (an all-digit first segment, as in "8080--tul-fm", is read as the port form, so such an alias could never be reached). Unlike plainhostname it rejects uppercase. It is exported so services can validate an alias that only exists after CEL evaluation, where the struct tag never ran.
func RegisterCustomValidators ¶
Register custom validators
Types ¶
type ValidationError ¶
type ValidationError struct {
Field string `json:"field"`
Message string `json:"message"`
Value string `json:"value,omitempty"`
}
ValidationError represents a user-friendly validation error
type Validator ¶
type Validator []ValidationError
ValidationErrors is a collection of validation errors
func NewValidator ¶
func NewValidator(s interface{}) Validator
func (Validator) ErrorMessages ¶
func (Validator) Errors ¶
func (ve Validator) Errors() []ValidationError