Documentation ¶
Overview ¶
Package config is an interface for dynamic configuration.
Index ¶
- Variables
- func Bytes() []byte
- func Consul(paths ...string) error
- func DefaultRemotePath(sdname, path string) string
- func Files(files ...string) error
- func Get(keys ...string) reader.Value
- func JSONEncoder() encoder.Encoder
- func Listen(structPtr interface{}) loader.Refresher
- func Map() map[string]interface{}
- func Parse(data string, format string, structPtr interface{}) error
- func Range(f func(k string, v interface{}))
- func RemoteKV(p string) (string, error)
- func Scan(v interface{}) error
- func String() string
- func Sync() error
- func TomlEncoder() encoder.Encoder
- type Config
- type Namespace
- type Option
- type Options
- type Watcher
Constants ¶
This section is empty.
Variables ¶
View Source
var ConsulAddr = "127.0.0.1:8500"
View Source
var Default = New()
Default is a default config instance
Functions ¶
func Listen ¶
Listen wrap Default's Listen func, use for watching a struct data which maybe change anytime
Types ¶
type Config ¶
type Config interface { reader.Values LoadFile(f ...string) error LoadPath(p string, isPrefix bool, format string) error Sync() error Listen(interface{}) loader.Refresher }
Config represents a config instance
type Namespace ¶
type Namespace struct {
// contains filtered or unexported fields
}
func NewNamespace ¶
func NewNamespaceD ¶
func NewNamespaceD() *Namespace
func (*Namespace) GetMemoryD ¶
type Option ¶
type Option func(o *Options)
Option represents a func
func WithSource ¶
WithSource appends a source to list of sources
Directories ¶
Path | Synopsis |
---|---|
Package encoder handles source encoding formats
|
Package encoder handles source encoding formats |
package loader manages loading from multiple sources
|
package loader manages loading from multiple sources |
Package reader parses change sets and provides config values
|
Package reader parses change sets and provides config values |
Package source is the interface for sources
|
Package source is the interface for sources |
file
Package file is a file source.
|
Package file is a file source. |
memory
Package memory is a memory source
|
Package memory is a memory source |
Click to show internal directories.
Click to hide internal directories.