Documentation ¶
Index ¶
Constants ¶
const DefaultTTL = 10
DefaultTTL is the default time-to-live in seconds for updates to etcd
const DefaultUpdateInterval = 8
DefaultUpdateInterval is the default frequently in seconds the key will be updated until Stop() is called
Variables ¶
var (
ErrIntervalTooSmall = errors.New("interval must be at least 1 second")
)
Functions ¶
This section is empty.
Types ¶
type Sidekick ¶
Sidekick periodically updates a key in etcd until Stop() is called
func New ¶
New returns a Sidekick pointer if there was no error initially setting the value, and there will be a goroutine updating the value every UpdateInterval seconds until Stop() is called If a non-nil error is returned there will be no goroutine performing updates
func (*Sidekick) SetLogger ¶
SetLogger sets a logger, by default no logs are written. This is a no-op if Stop() has been called.
func (*Sidekick) Stop ¶
func (sk *Sidekick) Stop()
Stop stops the goroutine performing updates. This is a no-op if Stop() has been called.
func (*Sidekick) TTL ¶
TTL sets the time-to-live on every update made to etcd. This is a no-op if Stop() has been called. TODO: validation on TTL
func (*Sidekick) UpdateInterval ¶
UpdateInterval sets the update interval to the value in seconds. This is a no-op if Stop() has been called.