Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var UsageForm = forms.Form{ ErrorMsg: "invalid data encountered in the usage parameter form", Fields: []forms.Field{ { Name: "type", Validators: []forms.Validator{ forms.IsRequired{}, forms.IsIn{Choices: []interface{}{"minute", "hour", "day", "week", "month"}}, }, }, { Name: "name", Validators: []forms.Validator{ forms.IsOptional{Default: ""}, forms.MatchesRegex{Regexp: regexp.MustCompile(`^[\w\d\-]{0,50}$`)}, }, }, { Name: "from", Validators: []forms.Validator{ forms.IsOptional{}, forms.IsTime{Format: "rfc3339", ToUTC: true}, }, }, { Name: "to", Validators: []forms.Validator{ forms.IsOptional{}, forms.IsTime{Format: "rfc3339", ToUTC: true}, }, }, { Name: "n", Validators: []forms.Validator{ forms.IsOptional{}, forms.IsInteger{HasMin: true, Min: 1, HasMax: true, Max: 500, Convert: true}, }, }, }, Transforms: []forms.Transform{}, Validator: UsageValidator, }
Functions ¶
func UsageValidator ¶
func UsageValidator(values map[string]interface{}, addError forms.ErrorAdder) error
Types ¶
Click to show internal directories.
Click to hide internal directories.