file

package
v0.0.30 Latest Latest
Warning

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

Go to latest
Published: May 7, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFileConfig

func NewFileConfig() config.Config

NewFileConfig create new file config with default collection name.

Types

type Config

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

Config is File config adapter.

func (*Config) AllSettings

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

AllSettings get all config value

func (*Config) Get

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

Get get config value by key.

func (*Config) GetBool

func (fc *Config) GetBool(key string) bool

GetBool get bool config value by key

func (*Config) GetDuration

func (fc *Config) GetDuration(key string) time.Duration

GetDuration get Duration config value by key

func (*Config) GetFloat64

func (fc *Config) GetFloat64(key string) float64

GetFloat64 get float64 config value by key

func (*Config) GetInt

func (fc *Config) GetInt(key string) int

GetInt get Int config value by key

func (*Config) GetInt32

func (fc *Config) GetInt32(key string) int32

GetInt32 get Int32 config value by key

func (*Config) GetInt64

func (fc *Config) GetInt64(key string) int64

GetInt64 get Int64 config value by key

func (*Config) GetString

func (fc *Config) GetString(key string) string

GetString get string config value by key

func (*Config) GetStringMap

func (fc *Config) GetStringMap(key string) map[string]interface{}

GetStringMap get stringMap config value by key

func (*Config) GetStringMapString

func (fc *Config) GetStringMapString(key string) map[string]string

GetStringMapString get stringMapstring config value by key

func (*Config) GetStringSlice

func (fc *Config) GetStringSlice(key string) []string

GetStringSlice get stringSlice config value by key

func (*Config) GetTime

func (fc *Config) GetTime(key string) time.Time

GetTime get time config value by key

func (*Config) IsExist

func (fc *Config) IsExist(key string) bool

IsExist check config's existence in file.

func (*Config) StartAndGC

func (fc *Config) StartAndGC(cfg config.Param) error

StartAndGC start file config adapter. config is like {"path":"/etc/niffer", "name":"xxxxx.json","config_type":"json"} the cache item in redis are stored forever, so no gc operation.

Jump to

Keyboard shortcuts

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