Documentation ¶
Index ¶
- Variables
- func AddDateTimeFormat(format string)
- func BoolParser(spec *Field, input interface{}) (parsed interface{}, err error)
- func DateParser(spec *Field, input interface{}) (parsed interface{}, err error)
- func DateTimeParser(spec *Field, input interface{}) (parsed interface{}, err error)
- func DecimalParser(spec *Field, input interface{}) (parsed interface{}, err error)
- func DecimalPercentParser(spec *Field, input interface{}) (parsed interface{}, err error)
- func EmailParser(spec *Field, input interface{}) (parsed interface{}, err error)
- func HtmlParser(spec *Field, input interface{}) (parsed interface{}, err error)
- func KebabOptionParser(spec *Field, input interface{}) (parsed interface{}, err error)
- func KebabParser(spec *Field, input interface{}) (parsed interface{}, err error)
- func LanguageParser(spec *Field, input interface{}) (parsed interface{}, err error)
- func LanguageTagParser(spec *Field, input interface{}) (parsed interface{}, err error)
- func NumberParser(spec *Field, input interface{}) (parsed interface{}, err error)
- func NumberPercentParser(spec *Field, input interface{}) (parsed interface{}, err error)
- func ParseTimeStructure(input string) (parsed time.Time, err error)
- func PathParser(spec *Field, input interface{}) (parsed interface{}, err error)
- func StringMapParser(spec *Field, input interface{}) (parsed interface{}, err error)
- func StringOptionParser(spec *Field, input interface{}) (parsed interface{}, err error)
- func StringParser(spec *Field, input interface{}) (parsed interface{}, err error)
- func StringSliceParser(spec *Field, input interface{}) (parsed interface{}, err error)
- func TimeParser(spec *Field, input interface{}) (parsed interface{}, err error)
- func TimeStructParser(spec *Field, input interface{}) (parsed interface{}, err error)
- func ToKebab(input string) (kebab string)
- func UrlParser(spec *Field, input interface{}) (parsed interface{}, err error)
- func UrlPathParser(spec *Field, input interface{}) (parsed interface{}, err error)
- func UrlPathSliceParser(spec *Field, input interface{}) (parsed interface{}, err error)
- func UuidParser(spec *Field, input interface{}) (parsed interface{}, err error)
- type Field
- type Fields
- func (f Fields) CategoryNames() (names []string)
- func (f Fields) Copy() (copied Fields)
- func (f Fields) Init(printer *message.Printer, parsers Parsers)
- func (f Fields) Keys() (keys []string)
- func (f Fields) Len() (count int)
- func (f Fields) Lookup(key string) (field *Field, ok bool)
- func (f Fields) SortedKeys() (keys []string)
- func (f Fields) TabCategoryFields(tab, category string, ignored ...string) (fields Fields)
- func (f Fields) TabCategoryNames(tab string) (keys []string)
- func (f Fields) TabFields(tab string) (fields Fields)
- func (f Fields) TabNames() (names []string)
- type Parser
- type Parsers
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DateLayout = "Jan 02, 2006" TimeLayout = "15:04 -0700" DateTimeLayout = "2006-01-02 15:04 MST" )
View Source
var ( DefaultParsers = Parsers{ "bool": BoolParser, "html": HtmlParser, "string": StringParser, "string-map": StringMapParser, "string-slice": StringSliceParser, "string-option": StringOptionParser, "number": NumberParser, "number-percent": NumberPercentParser, "decimal": DecimalParser, "decimal-percent": DecimalPercentParser, "email": EmailParser, "path": PathParser, "url": UrlParser, "url-path": UrlPathParser, "url-path-slice": UrlPathSliceParser, "relative-url": UrlPathParser, "time": TimeParser, "date": DateParser, "date-time": DateTimeParser, "time-struct": TimeStructParser, "language": LanguageParser, "language-tag": LanguageTagParser, "kebab": KebabParser, "kebab-option": KebabOptionParser, "uuid": UuidParser, } )
Functions ¶
func AddDateTimeFormat ¶
func AddDateTimeFormat(format string)
func BoolParser ¶
func DateParser ¶
func DateTimeParser ¶
func DecimalParser ¶
func DecimalPercentParser ¶
func EmailParser ¶
func HtmlParser ¶
func KebabOptionParser ¶
func KebabParser ¶
func LanguageParser ¶
func LanguageTagParser ¶
func NumberParser ¶
func NumberPercentParser ¶
func PathParser ¶
func StringMapParser ¶
func StringOptionParser ¶
func StringParser ¶
func StringSliceParser ¶
func TimeParser ¶
func TimeStructParser ¶
func UrlPathParser ¶
func UrlPathSliceParser ¶
func UuidParser ¶
Types ¶
type Field ¶
type Field struct { Key string `json:"key"` Tab string `json:"tab"` Label string `json:"label"` Format string `json:"format"` Category string `json:"category"` Input string `json:"input"` Weight int `json:"weight"` Required bool `json:"required,omitempty"` Step float64 `json:"step"` Minimum float64 `json:"minimum"` Maximum float64 `json:"maximum"` Placeholder string `json:"placeholder"` DefaultValue interface{} `json:"default-value"` ValueLabels map[string]string `json:"value-labels"` ValueOptions []string `json:"value-options"` LockNonEmpty bool `json:"lock-non-empty"` NoResetValue bool `json:"no-reset-value"` Printer *message.Printer `json:"-"` Parse Parser `json:"-"` }
func ParseField ¶
type Fields ¶
func (Fields) CategoryNames ¶
func (Fields) SortedKeys ¶
func (Fields) TabCategoryFields ¶
func (Fields) TabCategoryNames ¶
Click to show internal directories.
Click to hide internal directories.