Documentation
¶
Index ¶
- Constants
- func ProcessBytes(f []byte, env map[string]any) (map[string]any, error)
- func ProcessFile(f string, env map[string]any) (map[string]any, error)
- func ProcessForm(f Form, env map[string]any) (map[string]any, error)
- func ProcessReader(r io.Reader, env map[string]any) (map[string]any, error)
- type Form
- type Property
Constants ¶
View Source
const ( ArrayIfEmpty = "array" ObjectIfEmpty = "object" AbsentIfEmpty = "absent" StringType = "string" BoolType = "bool" IntType = "integer" FloatType = "float" PasswordType = "password" ObjectType = "object" ArrayType = "array" )
Variables ¶
This section is empty.
Functions ¶
func ProcessBytes ¶
ProcessBytes treats f as a YAML document and ProcessForm() it
func ProcessFile ¶
ProcessFile reads f and ProcessForm() it as YAML
func ProcessForm ¶
ProcessForm processes the form and return a data structure with the answers
Types ¶
type Property ¶
type Property struct { Name string `json:"name" yaml:"name"` Description string `json:"description" yaml:"description"` Help string `json:"help" yaml:"help"` IfEmpty string `json:"empty" yaml:"empty"` Type string `json:"type" yaml:"type"` ConditionalExpression string `json:"conditional" yaml:"conditional"` ValidationExpression string `json:"validation" yaml:"validation"` Required bool `json:"required" yaml:"required"` Default string `json:"default" yaml:"default"` Enum []string `json:"enum" yaml:"enum"` Properties []Property `json:"properties" yaml:"properties"` }
Click to show internal directories.
Click to hide internal directories.