Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var MeetingTimeValidator = CustomValidationFunc{ Tag: "valid meeting time", Func: meetingTimeValidateFunc, CallValidationEvenIfNull: false, }
MeetingTimeValidator is a CustomValidationFunc that requires a string to be in RFC3339 format.
var ( // ProviderSet provides a Validator. ProviderSet = wire.NewSet(Provide, Cfg, ProvideCustomValidationFuncs) )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Engine ValidationEngine CustomValidationFuncs []CustomValidationFunc }
Config is used to configure a Validator with the containing Engine and CustomValidationFuncs.
func Cfg ¶
func Cfg(customValidationFuncs []CustomValidationFunc) Config
Cfg returns a new Config containing the given slice of CustomValidationFuncs.
type CustomValidationFunc ¶
CustomValidationFunc represents a custom validation function and other associated properties.
func ProvideCustomValidationFuncs ¶
func ProvideCustomValidationFuncs() []CustomValidationFunc
ProvideCustomValidationFuncs provides a slice of CustomValidationFuncs used in the application.
type ValidationEngine ¶
type ValidationEngine interface{}
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
Validator contains the components needed to perform validation within the application.
func NewValidator ¶
NewValidator returns a new Validator configured using the provided Config and also initializes the Validator for use.