config

package
v0.0.0-...-b6deb6c Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2017 License: Apache-2.0 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 struct {
	// contains filtered or unexported fields
}

Config manager

func NewConfig

func NewConfig(configPath string) *Config

NewConfig returns a new instance of Config by configPath.

func NewRawConfig

func NewRawConfig() *Config

NewRawConfig new config without underlying config file.

func (*Config) ContainsKey

func (cf *Config) ContainsKey(key string) bool

ContainsKey judge whether the key is set in the config.

func (*Config) Get

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

Get a key return interface

func (*Config) GetBool

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

GetBool a key return int64

func (*Config) GetFloat64

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

GetFloat64 a key return Float64

func (*Config) GetInt

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

GetInt a key return int

func (*Config) GetInt64

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

GetInt64 a key return int64

func (*Config) GetString

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

GetString a key return string

func (*Config) MergeConfig

func (cf *Config) MergeConfig(configPath string) (*Config, error)

MergeConfig merge config by the config file path, the file try to merge should have same format.

func (*Config) OnConfigChange

func (cf *Config) OnConfigChange(run func(in fsnotify.Event))

OnConfigChange register function to invoke when config file change.

func (*Config) Set

func (cf *Config) Set(key string, value interface{})

Set key:value

Jump to

Keyboard shortcuts

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