xconfig

package
v0.0.0-...-796497b Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllSettings

func AllSettings() map[string]interface{}

/////////////////////////////////////////////////// PUBLIC OUTPUT ///////////////////////////////////////////////////

func BindEnvs

func BindEnvs(prefix string)

/////////////////////////////////////////////////// PUBLIC ENVIRONMENT ///////////////////////////////////////////////////

func Get

func Get(path string) (interface{}, error)

/////////////////////////////////////////////////// PUBLIC GET ///////////////////////////////////////////////////

func GetBool

func GetBool(path string) bool

func GetFloat

func GetFloat(path string) float64

func GetInt

func GetInt(path string) int

func GetInterfaceMapSliceElement

func GetInterfaceMapSliceElement(element interface{}) (map[interface{}]interface{}, error)

func GetKeys

func GetKeys() ([]string, error)

/////////////////////////////////////////////////// PUBLIC KEYS ///////////////////////////////////////////////////

func GetSlice

func GetSlice(path string) ([]interface{}, error)

func GetSliceSize

func GetSliceSize(path string) (int, error)

func GetString

func GetString(path string) string

func GetStringMapSliceElement

func GetStringMapSliceElement(element interface{}) (map[string]string, error)

func GetStringSlice

func GetStringSlice(path string) ([]string, error)

func ReadFiles

func ReadFiles(files ...string)

/////////////////////////////////////////////////// PUBLIC READ FILES ///////////////////////////////////////////////////

func Remove

func Remove(path string) (bool, error)

func Set

func Set(path string, value interface{})

/////////////////////////////////////////////////// PUBLIC SET ///////////////////////////////////////////////////

func SetCustom

func SetCustom(path string, value interface{}, expirys time.Duration)

func Size

func Size() (int, error)

/////////////////////////////////////////////////// PUBLIC SIZE ///////////////////////////////////////////////////

Types

type Config

type Config struct {
	Expiry time.Duration
	// contains filtered or unexported fields
}

func New

func New(expiry ...time.Duration) *Config

func Sub

func Sub(path string) *Config

/////////////////////////////////////////////////// PUBLIC SUB ///////////////////////////////////////////////////

func (*Config) AllSettings

func (cfg *Config) AllSettings() map[string]interface{}

func (*Config) Get

func (cfg *Config) Get(path string) (interface{}, error)

func (*Config) GetBool

func (cfg *Config) GetBool(path string) bool

func (*Config) GetFloat

func (cfg *Config) GetFloat(path string) float64

func (*Config) GetInt

func (cfg *Config) GetInt(path string) int

func (*Config) GetInterfaceMapSliceElement

func (cfg *Config) GetInterfaceMapSliceElement(element interface{}) (map[interface{}]interface{}, error)

func (*Config) GetKeys

func (cfg *Config) GetKeys() ([]string, error)

func (*Config) GetSlice

func (cfg *Config) GetSlice(path string) ([]interface{}, error)

func (*Config) GetSliceSize

func (cfg *Config) GetSliceSize(path string) (int, error)

func (*Config) GetString

func (cfg *Config) GetString(path string) string

func (*Config) GetStringMapSliceElement

func (cfg *Config) GetStringMapSliceElement(element interface{}) (map[string]string, error)

func (*Config) GetStringSlice

func (cfg *Config) GetStringSlice(path string) ([]string, error)

func (*Config) Len

func (cfg *Config) Len() int

/////////////////////////////////////////////////// PUBLIC SIZE ///////////////////////////////////////////////////

func (*Config) ReadFiles

func (cfg *Config) ReadFiles(files ...string)

func (*Config) ReadString

func (cfg *Config) ReadString(config string) error

/////////////////////////////////////////////////// PUBLIC READ STRING ///////////////////////////////////////////////////

func (*Config) Remove

func (cfg *Config) Remove(path string) (bool, error)

func (*Config) Set

func (cfg *Config) Set(path string, value interface{})

func (*Config) SetCustom

func (cfg *Config) SetCustom(path string, value interface{}, expirys time.Duration)

func (*Config) Size

func (cfg *Config) Size() (int, error)

func (*Config) Sub

func (cfg *Config) Sub(path string) *Config

func (*Config) WriteJson

func (cfg *Config) WriteJson(filename string) error

func (*Config) WriteYaml

func (cfg *Config) WriteYaml(filename string) error

/////////////////////////////////////////////////// WRITE OUT ///////////////////////////////////////////////////

Jump to

Keyboard shortcuts

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