Documentation ¶
Index ¶
- func AttributeError(message, attr string) error
- func EmptyAttributeError(attr string) error
- func UnsupportedFormatError(format string) error
- type Config
- func (s *Config) Body() string
- func (s *Config) ConfigFormat() (ConfigFormats, error)
- func (s *Config) Key() string
- func (s *Config) ParseError(err error) error
- func (s *Config) SetBody(body string) *Config
- func (s *Config) SetPath(path string) *Config
- func (s *Config) ToBodyMap() (common.BodyMap, error)
- func (s *Config) Unmarshal() error
- type ConfigFormats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttributeError ¶
AttributeError is for when there is an error in using a required attribute.
func EmptyAttributeError ¶
EmptyAttributeError is for when a required attribute is empty.
func UnsupportedFormatError ¶
UnsupportedFormatError is for when asked to parse a format-type that's not supported.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config contains the given "path", "extn" and "body" of a config, as well as the parsed config --> KV map.
func (*Config) ConfigFormat ¶
func (s *Config) ConfigFormat() (ConfigFormats, error)
ConfigFormat returns an enum representing the format of s.body.
func (*Config) ParseError ¶
ParseError is for when failing to parse a config.
type ConfigFormats ¶
type ConfigFormats int
ConfigFormats defines the type for the *Format enum.
const ( // UnknownFormat is when the config file format isn't recognised. UnknownFormat ConfigFormats = iota // EnvFormat is when the config file format is ".env". EnvFormat // TOMLFormat is when the config file format is TOML. TOMLFormat // YAMLFormat is when the config file format is YAML. YAMLFormat // JSONFormat is when the config file format is JSON. JSONFormat )
Click to show internal directories.
Click to hide internal directories.