Documentation
¶
Index ¶
- type Binder
- func (b *Binder) AddBool(key string, fn func(bool) error)
- func (b *Binder) AddDuration(key string, fn func(time.Duration) error)
- func (b *Binder) AddEnum(key string, choices []string, fn func(string) error)
- func (b *Binder) AddInt(key string, fn func(int64) error)
- func (b *Binder) AddStrings(key string, fn func([]string) error)
- func (b *Binder) Handlers() map[string]HandlerFunc
- func (b *Binder) Run(key string, args []string) error
- type HandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Binder ¶
type Binder struct {
// contains filtered or unexported fields
}
Binder handles mapping and execution of field bindings.
func (*Binder) AddDuration ¶
AddDuration registers a custom handler for a duration field.
func (*Binder) AddEnum ¶
AddEnum registers a handler that validates against a set of allowed values.
func (*Binder) AddStrings ¶
AddStrings registers a custom handler for a string slice field.
func (*Binder) Handlers ¶
func (b *Binder) Handlers() map[string]HandlerFunc
Handlers returns the registered handlers.
type HandlerFunc ¶
HandlerFunc handles binding a set of string arguments to a field.
Click to show internal directories.
Click to hide internal directories.