yamlconfig

package module
v0.0.0-...-a4f01b6 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2023 License: MIT Imports: 13 Imported by: 5

README

yamlconfig

go config lib, made yaml-configs easy

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigSection

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

//////////////////////////////////////////////////////////////////////////////

func (*ConfigSection) GetBool

func (m *ConfigSection) GetBool(key string) bool

//////////////////////////////////////////////////////////////////////////////

func (*ConfigSection) GetBoolDefault

func (m *ConfigSection) GetBoolDefault(key string, def bool) bool

//////////////////////////////////////////////////////////////////////////////

func (*ConfigSection) GetDuration

func (m *ConfigSection) GetDuration(key string) time.Duration

//////////////////////////////////////////////////////////////////////////////

func (*ConfigSection) GetDurationDefault

func (m *ConfigSection) GetDurationDefault(key string, def time.Duration) time.Duration

//////////////////////////////////////////////////////////////////////////////

func (*ConfigSection) GetFloat64

func (m *ConfigSection) GetFloat64(key string) float64

//////////////////////////////////////////////////////////////////////////////

func (*ConfigSection) GetFloat64Default

func (m *ConfigSection) GetFloat64Default(key string, def float64) float64

//////////////////////////////////////////////////////////////////////////////

func (*ConfigSection) GetInt

func (m *ConfigSection) GetInt(key string) int

//////////////////////////////////////////////////////////////////////////////

func (*ConfigSection) GetIntDefault

func (m *ConfigSection) GetIntDefault(key string, def int) int

//////////////////////////////////////////////////////////////////////////////

func (*ConfigSection) GetObject

func (m *ConfigSection) GetObject(key string) interface{}

//////////////////////////////////////////////////////////////////////////////

func (*ConfigSection) GetObjectDefault

func (m *ConfigSection) GetObjectDefault(key string, def interface{}) interface{}

//////////////////////////////////////////////////////////////////////////////

func (*ConfigSection) GetRaw

func (m *ConfigSection) GetRaw() interface{}

func (*ConfigSection) GetSection

func (m *ConfigSection) GetSection(key string) (*ConfigSection, error)

//////////////////////////////////////////////////////////////////////////////

func (*ConfigSection) GetString

func (m *ConfigSection) GetString(key string) string

//////////////////////////////////////////////////////////////////////////////

func (*ConfigSection) GetStringDefault

func (m *ConfigSection) GetStringDefault(key string, def string) string

//////////////////////////////////////////////////////////////////////////////

func (*ConfigSection) GetStringList

func (m *ConfigSection) GetStringList(key string) []string

//////////////////////////////////////////////////////////////////////////////

func (*ConfigSection) MustGetSection

func (m *ConfigSection) MustGetSection(key string) *ConfigSection

//////////////////////////////////////////////////////////////////////////////

func (*ConfigSection) Unmarshal

func (m *ConfigSection) Unmarshal(target interface{}) error

//////////////////////////////////////////////////////////////////////////////

type YamlConfig

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

func New

func New(filePath string) *YamlConfig

//////////////////////////////////////////////////////////////////////////////

func (*YamlConfig) GetConfigSection

func (c *YamlConfig) GetConfigSection(key string) (*ConfigSection, error)

//////////////////////////////////////////////////////////////////////////////

func (*YamlConfig) Load

func (c *YamlConfig) Load(loadDefaults loadDefFn, watchConfig bool) error

//////////////////////////////////////////////////////////////////////////////

func (*YamlConfig) SetDefault

func (c *YamlConfig) SetDefault(key string, value interface{})

//////////////////////////////////////////////////////////////////////////////

Jump to

Keyboard shortcuts

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