conf

package
v0.0.0-...-03ea0d3 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: Apache-2.0 Imports: 10 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config map[string]string

Config defines a configuration container for storing parameters.

func Load

func Load(fname string) (Config, error)

Load loads the config container from the file.

func New

func New() Config

New creates a new config container.

func (Config) Exists

func (c Config) Exists(key string) bool

Exists returns true if the 'key' parameter is defined.

func (Config) Get

func (c Config) Get(key string) string

Get returns the string 'value' of the 'key' parameter.

func (Config) GetBool

func (c Config) GetBool(key string) bool

GetBool returns the boolean value of the 'key' parameter.

func (Config) GetDataPath

func (c Config) GetDataPath(key string) string

GetDataPath returns the path of the 'key' parameter.

func (*Config) GetFloat64

func (c *Config) GetFloat64(key string) float64

GetFloat64 returns the float64 value of the 'key' parameter.

func (Config) GetInt

func (c Config) GetInt(key string) int

GetInt returns the int value of the 'key' parameter.

func (Config) GetResourcePath

func (c Config) GetResourcePath(key string) string

GetResourcePath returns the path of the 'key' parameter.

func (Config) GetSlice

func (c Config) GetSlice(key, sep string) []string

GetSlice returns the slice of values separated by sep.

func (Config) Put

func (c Config) Put(key, value string)

Put sets the 'key' parameter to the string 'value'.

func (Config) Size

func (c Config) Size() int

Size returns the number of parameters in the config container.

Jump to

Keyboard shortcuts

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