Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Parse ¶
func Parse(parser, obj interface{})
Parse an object using the provided parser The parser must implement one of more ObjectParser interfaces
func Strings ¶
func Strings(parser StringParser, obj interface{})
Strings reflects over a structure and calls Parse when strings are located
Types ¶
type EnvironmentMapper ¶
type EnvironmentMapper struct {
// contains filtered or unexported fields
}
func NewEnvironmentMapper ¶
func NewEnvironmentMapper(delimiter, prefix string) *EnvironmentMapper
NewEnvironmentMapper creates an environment mapping parser This parses a string looking for a delimiter indicating that the value should be loaded from the environment
func (*EnvironmentMapper) ParseString ¶
func (em *EnvironmentMapper) ParseString(line string) interface{}
type FloatParser ¶
type FloatParser interface {
ParseFloat(in float64) interface{}
}
FloatParser called on floating point elements
type IntParser ¶
type IntParser interface {
ParseInt(in int64) interface{}
}
IntParser called on integer elements
type Parsers ¶
type Parsers struct { StringParser StringParser IntParser IntParser FloatParser FloatParser }
Parsers is a container for all possible parser interfaces
type StringParser ¶
type StringParser interface {
ParseString(in string) interface{}
}
StringParser interface is called on any string elements
Click to show internal directories.
Click to hide internal directories.