config

package
v0.0.0-...-3f1871c Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2017 License: MIT, MIT Imports: 1 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 map[string]interface{}

Config encapsulates a map of polymorfic values and provides useful method to lookup and retrieve fields by key.

Config is designed to be read-only and thread-safe.

func (Config) Exists

func (c Config) Exists(key string) bool

Exists checks is config field is present.

func (Config) Get

func (c Config) Get(key string) interface{}

Get lookups a config value by key and returns it.

func (Config) GetBool

func (c Config) GetBool(key string) bool

GetBool lookups a config value by key and returns it as bool.

func (Config) GetFloat

func (c Config) GetFloat(key string) float64

GetFloat lookups a config value by key and returns it as float64.

func (Config) GetInt

func (c Config) GetInt(key string) int

GetInt lookups a config value by key and returns it as int.

func (Config) GetInt64

func (c Config) GetInt64(key string) int64

GetInt64 lookups a config value by key and returns it as int64.

func (Config) GetString

func (c Config) GetString(key string) string

GetString lookups a config value by key and returns it as string.

func (Config) JSON

func (c Config) JSON() ([]byte, error)

JSON serializes the config fields a JSON.

func (Config) Set

func (c Config) Set(key string, value interface{})

Set sets a new field in the current config object.

Jump to

Keyboard shortcuts

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