Documentation ¶
Index ¶
- func ExcludeChars(fieldName, value, chars string) error
- func IntIn(check int, others ...int) error
- func IsIP(value string) error
- func IsSubnet16(value string) error
- func IsSubnetCIDR(value string) error
- func NotEmpty(fieldName string, value string) error
- func StringIn(check string, others ...string) error
- func StringsEqual(expected string, other string, errMsg string) error
- func ValidHostID(hostID string) error
- func ValidPoolId(poolID string) error
- func ValidPort(port int) error
- func ValidUIAddress(addr string) error
- func ValidVirtualIP(bindInterface string) error
- type ValidationError
- type Violation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExcludeChars ¶
ExcludeChars makes sure there characters in a field are valid
func IsSubnet16 ¶
IsSubnet16 checks to see if the value is a valid /16 subnet. Returns an error if not valid
func IsSubnetCIDR ¶
IsSubnetCIDR checks to see if the value is a valid cidr subnet. Returns an error if not valid
func NotEmpty ¶
NotEmpty check to see if the value is not an empty string or a string with just whitespace characters, returns an error if empty. FieldName is used to create a meaningful error
func StringIn ¶
StringsEqual checks to see that strings are equal, optional msg to use instead of default
func StringsEqual ¶
StringsEqual checks to see that strings are equal, optional msg to use instead of default
func ValidHostID ¶
func ValidPoolId ¶
func ValidUIAddress ¶
func ValidVirtualIP ¶
Types ¶
type ValidationError ¶
type ValidationError struct {
Errors []error
}
ValidationError is an error that contains other errors
func NewValidationError ¶
func NewValidationError() *ValidationError
NewValidationError creates a ValidationError with an empty slice of errors
func (*ValidationError) AddViolation ¶
func (v *ValidationError) AddViolation(violationMsg string)
AddViolation adds Violation error
func (*ValidationError) Error ¶
func (v *ValidationError) Error() string
Error returns the error string
func (*ValidationError) HasError ¶
func (v *ValidationError) HasError() bool
HasError test to see if length of Errors slice is greater than 0