Skip to content

billhathaway/sidekick

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sidekick is a library that will update a key in etcd periodically.

If sidekick.New() returns without an error, there will be a goroutine keeping the key refreshed in etcd.

GoDoc

Example:

hostname,err := os.Hostname()  
// comma separated list of server URLs  
etcdServers := "http://localhost:4001"  
etcdPath := "/servers/web/" + hostname  
value := "running"  
sk, _ := sidekick.New(etcdServers,etcdpath,value)  

To change the value of the key, use:

sk.Value("newValue")  

To stop updates to etcd, use:

sk.Stop()  

To change from the default key TTL or update interval use:

sk.TTL(seconds)  
sk.UpdateInterval(seconds)  

If you want a standalone utility, see the sidekicker directory.

About

Go library to periodically update a key in etcd

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages