config

package
v0.0.0-...-5bb0c7b Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2021 License: MIT Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AesKeySalt string
)

Functions

This section is empty.

Types

type Config

type Config struct {
	AesKey []byte
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(path string) *Config

func NewConfigWithString

func NewConfigWithString(configStr string) *Config

func NewRemoteConfig

func NewRemoteConfig(provider, addr, path, configType string) *Config

func ParseConfig

func ParseConfig(configStr string, configType string) *Config

func (*Config) BindEnv

func (cfg *Config) BindEnv(input ...string) error

func (*Config) DecryptString

func (cfg *Config) DecryptString(str string) string

func (*Config) EncryptString

func (cfg *Config) EncryptString(str string) string

func (*Config) Exit

func (cfg *Config) Exit()

func (*Config) ExtractStringFromMap

func (cfg *Config) ExtractStringFromMap(m map[string]interface{}, path string, defaultValue string) string

func (*Config) GetAllKeys

func (cfg *Config) GetAllKeys() []string

func (*Config) GetBool

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

func (*Config) GetDuration

func (cfg *Config) GetDuration(path string) time.Duration

func (*Config) GetFloat64

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

func (*Config) GetInt

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

func (*Config) GetInt32

func (cfg *Config) GetInt32(path string) int32

func (*Config) GetInt64

func (cfg *Config) GetInt64(path string) int64

func (*Config) GetMapSlice

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

func (*Config) GetString

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

func (*Config) GetStringMapString

func (cfg *Config) GetStringMapString(path string) map[string]string

func (*Config) GetStringSlice

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

func (*Config) GetValue

func (cfg *Config) GetValue(path string) interface{}

func (*Config) Save

func (cfg *Config) Save(path string) error

func (*Config) SetDefault

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

func (*Config) SetValue

func (cfg *Config) SetValue(path string, val interface{})

Directories

Path Synopsis
tool

Jump to

Keyboard shortcuts

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