config

package
v0.0.0-...-9f41b84 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2020 License: MIT, Apache-2.0 Imports: 7 Imported by: 0

README

Kira

Configuration for kira framework

Getting Started


Getting Started

TODO

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(src io.Reader) (map[string]interface{}, error)

Parse the file and return a map of configs.

Types

type Config

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

Config - This will store all the configurations we have.

func New

func New() *Config

New - return kon instance

func NewFromFile

func NewFromFile(files ...string) *Config

NewFromFile - read a file and return the configuration.

func NewFromMap

func NewFromMap(m ...map[string]interface{}) *Config

NewFromMap return configuration from kira.Map type

func (*Config) Get

func (k *Config) Get(key string) interface{}

Get - key value.

func (*Config) GetBool

func (k *Config) GetBool(key string, def ...bool) bool

GetBool - return config as int type.

func (*Config) GetDefault

func (k *Config) GetDefault(key string, def interface{}) interface{}

GetDefault return value by key, if the value empty set a default value.

func (*Config) GetFloat64

func (k *Config) GetFloat64(key string, def ...float64) float64

GetFloat64 - return config as float64 type.

func (*Config) GetInt

func (k *Config) GetInt(key string, def ...int) int

GetInt - return config as int type.

func (*Config) GetInt64

func (k *Config) GetInt64(key string, def ...int) int64

GetInt64 - return config as int type.

func (*Config) GetString

func (k *Config) GetString(key string, def ...string) string

GetString - return config as string type.

func (*Config) Set

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

Set ...

Jump to

Keyboard shortcuts

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