Documentation ¶
Index ¶
- Variables
- type Config
- func (c *Config) Debug()
- func (c *Config) Dumps() (dump []byte, err error)
- func (c *Config) Get(key string) (Value, error)
- func (c *Config) GetInt64(key string) (i int64, err error)
- func (c *Config) GetInt64Slice(key string) (i []int64, err error)
- func (c *Config) GetRequired(key string) Value
- func (c *Config) GetRequiredInt64(key string) int64
- func (c *Config) GetRequiredInt64Slice(key string) []int64
- func (c *Config) GetRequiredString(key string) string
- func (c *Config) GetRequiredStringSlice(key string) []string
- func (c *Config) GetRequiredSubConfig(key string) Config
- func (c *Config) GetRequiredUint64(key string) uint64
- func (c *Config) GetRequiredUint64Slice(key string) []uint64
- func (c *Config) GetString(key string) (string, error)
- func (c *Config) GetStringSlice(key string) (s []string, err error)
- func (c *Config) GetSubConfig(key string) (Config, error)
- func (c *Config) GetUint64(key string) (u uint64, err error)
- func (c *Config) GetUint64Slice(key string) (u []uint64, err error)
- func (c *Config) HasKey(key string) bool
- func (c *Config) Set(key string, value interface{})
- type Value
Constants ¶
This section is empty.
Variables ¶
var (
ErrNoSuchKey = errors.New("No such key")
)
Functions ¶
This section is empty.
Types ¶
type Config ¶
Config : configuration structure definition
func Load ¶
Load : loads a configuration structure from a file @path : path where the configuration is stored as a json file return (Config, error) : the Config struct parsed, error code
func Loads ¶
Loads : loads a configuration structure from a data buffer @data : buffer containing the configuration object return (Config, error) : the Config struct filled from data, error code
func (*Config) Debug ¶
func (c *Config) Debug()
Debug : prints out the configuration in debug information
func (*Config) Dumps ¶
Dumps : Dumps Config structure into a byte slice return ([]byte, error) : byte slice and error code
func (*Config) Get ¶
Get : get the Value associated to a key found in Config structure return (Value, error) : Value associated to key and error code
func (*Config) GetInt64 ¶
GetInt64 gets the value associated to a key as int64 return (int64, error)
func (*Config) GetRequired ¶
GetRequired : get the Value associated to a key found in Config structure and exit if not available return (Value) : Value associated to key if it exists
func (*Config) GetRequiredInt64 ¶
func (*Config) GetRequiredInt64Slice ¶
func (*Config) GetRequiredString ¶
func (*Config) GetRequiredStringSlice ¶
func (*Config) GetRequiredSubConfig ¶
GetRequiredSubConfig : get a subconfig referenced by key return (Config)
func (*Config) GetRequiredUint64 ¶
func (*Config) GetRequiredUint64Slice ¶
func (*Config) GetString ¶
GetString gets the value associated to a key as string return (string, error)
func (*Config) GetSubConfig ¶
GetSubConfig : get a subconfig referenced by key return (Config, error)
func (*Config) GetUint64 ¶
GetUint64 gets the value associated to a key as uint64 return (uint64, error)