config

package
v0.0.0-...-a4757fd Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2018 License: Apache-2.0, GPL-2.0, GPL-3.0, + 1 more Imports: 5 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 interface {
	Get(key string) interface{}
	GetBool(key string) bool
	GetFloat64(key string) float64
	GetInt(key string) int
	GetString(key string) string
	GetStringSlice(key string) []string
	GetTime(key string) time.Time
	GetMap(key string) map[string]interface{}
	GetMapString(key string) map[string]string
	GetConfig(key string) Config
	IsSet(key string) bool
	Set(key string, value interface{})
	SetDefault(key string, value interface{})
}

type MapConfig

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

func NewMapConfig

func NewMapConfig(data map[string]interface{}) *MapConfig

func ReadMapConfigFromFile

func ReadMapConfigFromFile(filePath string) (*MapConfig, error)

func (*MapConfig) Get

func (cfg *MapConfig) Get(key string) interface{}

func (*MapConfig) GetBool

func (cfg *MapConfig) GetBool(key string) bool

func (*MapConfig) GetConfig

func (cfg *MapConfig) GetConfig(key string) Config

func (*MapConfig) GetFloat64

func (cfg *MapConfig) GetFloat64(key string) float64

func (*MapConfig) GetInt

func (cfg *MapConfig) GetInt(key string) int

func (*MapConfig) GetMap

func (cfg *MapConfig) GetMap(key string) map[string]interface{}

func (*MapConfig) GetMapString

func (cfg *MapConfig) GetMapString(key string) map[string]string

func (*MapConfig) GetString

func (cfg *MapConfig) GetString(key string) string

func (*MapConfig) GetStringSlice

func (cfg *MapConfig) GetStringSlice(key string) []string

func (*MapConfig) GetTime

func (cfg *MapConfig) GetTime(key string) time.Time

func (*MapConfig) IsSet

func (cfg *MapConfig) IsSet(key string) bool

func (*MapConfig) Set

func (cfg *MapConfig) Set(key string, value interface{})

func (*MapConfig) SetDefault

func (cfg *MapConfig) SetDefault(key string, value interface{})

func (*MapConfig) SetRequired

func (cfg *MapConfig) SetRequired(key string)

Jump to

Keyboard shortcuts

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