Documentation ¶
Overview ¶
confdis manages JSON based configuration in redis
Index ¶
Constants ¶
View Source
const PUB_SUFFIX = ":_changes"
View Source
const PUB_VALUE = "{\"library\": \"confdis\"}"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfDis ¶
type ConfDis struct { Changes chan error // Channel to receive config updates (value is return of reload()) // contains filtered or unexported fields }
func (*ConfDis) AtomicSave ¶
AtomicSave is like save, but only writes the changed config back to redis if somebody else did not make a change already (notified via pubsub). Note that the converse is not necessarily true; somebody else -- specifically, reload() -- *could* overwrite the changes written by AtomicSave.
func (*ConfDis) GetConfig ¶
func (c *ConfDis) GetConfig() interface{}
GetConfig returns the current snapshot of config struct.
func (*ConfDis) MustReceiveChanges ¶
func (c *ConfDis) MustReceiveChanges()
MustReceiveChanges listens for change notifications and updates the internal config. Will panic if there is an error reading the new config.
Click to show internal directories.
Click to hide internal directories.