Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrFailedToLoad ¶
type ErrFailedToLoad struct {
Reason error
}
ErrFailedToLoad is returned at any point that load process fails.
func (*ErrFailedToLoad) Error ¶
func (t *ErrFailedToLoad) Error() string
type ErrMissingExtDot ¶
type ErrMissingExtDot struct {
Ext string
}
ErrMissingExtDot is returned when the extension is missing the dot prefix.
func (*ErrMissingExtDot) Error ¶
func (t *ErrMissingExtDot) Error() string
type ErrNilParser ¶
type ErrNilParser struct { }
ErrNilParser is returned when a register is called with parsers.Parser(nil).
func (*ErrNilParser) Error ¶
func (*ErrNilParser) Error() string
type ErrParserConflict ¶
type ErrParserConflict struct {
Ext string
}
ErrParserConflict is returned when a parser is trying to register an extension that is already registered.
func (*ErrParserConflict) Error ¶
func (t *ErrParserConflict) Error() string
type Loader ¶
type Loader interface { // RegisterParser add a new parser to N extensions. // It will fail if: 1. the parser is `nil`; 2. any of its supported // extensions is already registered. RegisterParser(parsers.Parser) error // SupportedExtensions returns a list of registered extensions. SupportedExtensions() []string // Load find and loads files into the given data type. Load(v interface{}) (*Info, error) // SetEnvironmentVariableName changes the default `CONFIG_DIR` variable name. // Passing an empty name will disable it SetEnvironmentVariableName(name string) }
Loader registers parsers and loads files into a given data type.
Click to show internal directories.
Click to hide internal directories.