Documentation ¶
Index ¶
- type DefaultSetting
- func (ctx *DefaultSetting) ExecTemplate(r io.Reader) (io.Reader, error)
- func (ctx *DefaultSetting) Get(key string) (string, bool)
- func (ctx *DefaultSetting) GetValue(key string, result interface{}) error
- func (ctx *DefaultSetting) LoadValue(r io.Reader) error
- func (ctx *DefaultSetting) RefreshEnv()
- func (ctx *DefaultSetting) SetValueReader(r ValueReader)
- type JsonValue
- type Opt
- type Setting
- type Value
- type ValueReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultSetting ¶
type DefaultSetting struct { Value *Value Env map[string]string // contains filtered or unexported fields }
var Default *DefaultSetting = NewSetting()
func NewSetting ¶
func NewSetting(opts ...Opt) *DefaultSetting
func (*DefaultSetting) ExecTemplate ¶
func (*DefaultSetting) Get ¶
func (ctx *DefaultSetting) Get(key string) (string, bool)
Env.ENVNAME Value.A.B.C
func (*DefaultSetting) GetValue ¶
func (ctx *DefaultSetting) GetValue(key string, result interface{}) error
Value.A.B.C 依赖于ValueReader的序列化和反序列化方式
func (*DefaultSetting) RefreshEnv ¶
func (ctx *DefaultSetting) RefreshEnv()
func (*DefaultSetting) SetValueReader ¶
func (ctx *DefaultSetting) SetValueReader(r ValueReader)
type Opt ¶
type Opt func(ctx *DefaultSetting) error
func SetValueReader ¶
func SetValueReader(r ValueReader) Opt
Click to show internal directories.
Click to hide internal directories.