Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct { // The location of the YAML file Filename string // The extracted configuration settings Config Config // The form struct that will be populated from the yaml file Form *Form // Instance of the http request Request http.Request }
The builder struct
type Config ¶
type Config struct { Name string `yaml:"Name"` Description string `yaml:"Description"` Action string `yaml:"Action"` Method string `yaml:"Method"` Props map[string]string `yaml:"Props"` Fields []ConfigField `yaml:"Fields"` }
The YAML config struct
type ConfigField ¶
type ConfigField struct { Name string `yaml:"Name"` Label string `yaml:"Label"` Type string `yaml:"Type"` Default string `yaml:"Default"` Props map[string]string `yaml:"Props"` Values []string `yaml:"Values"` Rules []ConfigRule `yaml:"Rules"` }
The YAML config struct for a field
type ConfigRule ¶
type ConfigRule struct { Type string `yaml:"Type"` Err string `yaml:"Err"` Regex string `yaml:"Regex"` Length int `yaml:"Length"` }
The validation struct
type Field ¶
type Field struct { // The field name Name string // The field label Label string // The field type ie text, textarea Type string // The default value Default string // The actual value Value string // Boolean flag for when a field has errors or not Valid bool // A list of values to use for multi-value inputs Values []string // A list of validation items to add to this field Rules []Validation // A list of errors on this field Errors []string // A Map of properties to add to the field output Props map[string]string }
type Form ¶
type Form struct { // The form name Name string // The form description Description string // The form action Action string // The HTTP Method Method string // A list of fields Fields []*Field // The current request Request http.Request // Html Property map Props map[string]string // Boolean flag whether form is valid or not Valid bool }
type LengthValidation ¶
Checks for a specific length
type RegexValidation ¶
Custom Regex validation
type Validation ¶
type Validation interface {
// contains filtered or unexported methods
}
Click to show internal directories.
Click to hide internal directories.