Documentation ¶
Index ¶
- func Get(k string) string
- func GetAll() map[string]string
- func GetSafe(k string) string
- func LoadAll() error
- func NewDefaultClient(name string, machines []string)
- func SetDefaults(kv map[string]string)
- type Client
- func (c *Client) Get(k string) string
- func (c *Client) GetAll() map[string]string
- func (c *Client) GetSafe(k string) string
- func (c *Client) LoadAll() (err error)
- func (c *Client) NewLock(name string, ttl int) *Lock
- func (c *Client) NewRegister(name string) *Register
- func (c *Client) SetDefaults(kv map[string]string) (err error)
- type Handler
- type Lock
- type Register
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDefaultClient ¶
Create a new default client with a given name and set of machines.
func SetDefaults ¶
Set default key/value pairs using the default client.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
Create a new client with a given namespace and array of hosts If no machine set is given we use the default of 127.0.0.1:4001
func (*Client) NewRegister ¶
type Handler ¶
type Handler func(*Lock)
A handler is a method that consumes a lock. It is responsible for watching for loss of the lock and releasing it when done.
type Lock ¶
type Lock struct { Lost chan int // Handler should read to indicate the lock was lost // contains filtered or unexported fields }
type Register ¶
type Register struct {
// contains filtered or unexported fields
}
func NewRegister ¶
Create a new register using the default client
Click to show internal directories.
Click to hide internal directories.