Documentation ¶
Index ¶
- Variables
- func BindFlags(flags *pflag.FlagSet)
- func Duration(def time.Duration, keys ...string) time.Duration
- func Get(key string) string
- func Int(def int, key string) int
- func On(def bool, keys ...string) bool
- func RegisterListener(fn func(*Properties))
- func Set(key string, value any)
- func String(def string, keys ...string) string
- func Update(props map[string]string)
- type Properties
- func (p *Properties) Duration(def time.Duration, keys ...string) time.Duration
- func (p *Properties) Get(key string) string
- func (p *Properties) GetAll() map[string]string
- func (p *Properties) Int(def int, key string) int
- func (p *Properties) LoadFile(filename string) error
- func (p *Properties) On(def bool, keys ...string) bool
- func (p *Properties) RegisterListener(fn func(*Properties))
- func (p *Properties) Set(key string, value any)
- func (p *Properties) String(def string, keys ...string) string
- func (p *Properties) Update(props map[string]string)
- func (p *Properties) Watch() func()
Constants ¶
This section is empty.
Variables ¶
View Source
var Global = &Properties{ m: make(map[string]string), }
View Source
var LoadFile = func(filename string) error { return Global.LoadFile(filename) }
Functions ¶
func RegisterListener ¶
func RegisterListener(fn func(*Properties))
Types ¶
type Properties ¶
type Properties struct { Reload func() // contains filtered or unexported fields }
func (*Properties) Get ¶
func (p *Properties) Get(key string) string
func (*Properties) GetAll ¶
func (p *Properties) GetAll() map[string]string
func (*Properties) LoadFile ¶
func (p *Properties) LoadFile(filename string) error
func (*Properties) RegisterListener ¶
func (p *Properties) RegisterListener(fn func(*Properties))
func (*Properties) Set ¶
func (p *Properties) Set(key string, value any)
func (*Properties) Update ¶
func (p *Properties) Update(props map[string]string)
func (*Properties) Watch ¶ added in v1.27.0
func (p *Properties) Watch() func()
Click to show internal directories.
Click to hide internal directories.