cfg

package
v0.0.0-...-c1021f5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2017 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config is a map containing configuration key-value pairs.

func FromMap

func FromMap(m map[string]string) *Config

FromMap converts a string map into a Config object.

func NewConfig

func NewConfig() *Config

NewConfig allocates a configuration map.

func (*Config) FromJSON

func (cf *Config) FromJSON(r io.Reader) error

FromJSON unmarshals JSON data read from r into a Config object.

func (*Config) Get

func (cf *Config) Get(k string) (string, bool)

Get returns the value for a key k or false if not present.

func (*Config) GetVal

func (cf *Config) GetVal(k, defaultVal string) string

GetVal returns the value for a key k or defaultVal if not present.

func (*Config) Map

func (cf *Config) Map() map[string]string

Map returns the underlying map of a Config object.

func (*Config) Put

func (cf *Config) Put(k, v string)

Put adds a key value pair, overriding any previous entry.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL