core

package
v0.0.0-...-e90703b Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PkgName    = "配置读取"
	PkgVersion = "v1.0.0"
)

Variables

This section is empty.

Functions

func FileExists

func FileExists(name string) bool

FileExists reports whether the named file or directory exists.

Types

type Config

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

func NewConfig

func NewConfig() *Config

func NewConfigWithPath

func NewConfigWithPath(path string, morePath ...string) *Config

func (*Config) AddPath

func (receiver *Config) AddPath(path string, morePath ...string)

func (*Config) Bool

func (receiver *Config) Bool(key string) (bool, bool)

func (*Config) DefaultBool

func (receiver *Config) DefaultBool(key string, defaultVal bool) bool

func (*Config) DefaultInt

func (receiver *Config) DefaultInt(key string, defaultVal int) int

func (*Config) DefaultInt64

func (receiver *Config) DefaultInt64(key string, defaultVal int64) int64

func (*Config) DefaultString

func (receiver *Config) DefaultString(key string, defaultVal string) string

func (*Config) Get

func (receiver *Config) Get(key string) (interface{}, bool)

func (*Config) GetCurrentCache

func (receiver *Config) GetCurrentCache() map[string]map[string]interface{}

func (*Config) Int

func (receiver *Config) Int(key string) (int, bool)

func (*Config) Int64

func (receiver *Config) Int64(key string) (int64, bool)

func (*Config) SetDefaultSplitStr

func (receiver *Config) SetDefaultSplitStr(str string)

func (*Config) SetMaxFileWatch

func (receiver *Config) SetMaxFileWatch(num int8)

func (*Config) SetReadOrder

func (receiver *Config) SetReadOrder(first ReadOrder, more ...ReadOrder)

func (*Config) String

func (receiver *Config) String(key string) (string, bool)

func (*Config) StringList

func (receiver *Config) StringList(key string) ([]string, error)

func (*Config) WatchChange

func (receiver *Config) WatchChange(isOpen bool)

type ReadOrder

type ReadOrder int
const (
	ReadFromParam ReadOrder = iota
	ReadFromEnv
	ReadFromFile
)

func DefaultReadOrder

func DefaultReadOrder() []ReadOrder

Jump to

Keyboard shortcuts

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