Documentation
¶
Index ¶
- Constants
- func InitPlugin()
- type EtcdPlugin
- func (self *EtcdPlugin) DelObj(key string) error
- func (self *EtcdPlugin) DeregisterService(serviceInfo api.ServiceInfo) error
- func (self *EtcdPlugin) GetLocalAddr() (string, error)
- func (self *EtcdPlugin) GetObj(key string, retVal interface{}) error
- func (self *EtcdPlugin) GetService(name string) ([]api.ServiceInfo, error)
- func (self *EtcdPlugin) Init(machines []string) error
- func (self *EtcdPlugin) ListDir(key string) ([]string, error)
- func (self *EtcdPlugin) NewLock(name string, myId string, ttl uint64) (api.LockInterface, error)
- func (self *EtcdPlugin) RegisterService(serviceInfo api.ServiceInfo) error
- func (self *EtcdPlugin) SetObj(key string, value interface{}) error
- func (self *EtcdPlugin) WatchService(name string, eventCh chan api.WatchServiceEvent, stopCh chan bool) error
- type Lock
Constants ¶
View Source
const EtcdErrorCodeKeyExists = 105
View Source
const EtcdErrorCodeNotFound = 100
Etcd error codes
View Source
const SERVICE_TTL = 60
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EtcdPlugin ¶
type EtcdPlugin struct {
// contains filtered or unexported fields
}
func (*EtcdPlugin) DeregisterService ¶
func (self *EtcdPlugin) DeregisterService(serviceInfo api.ServiceInfo) error
Deregister a service This removes the service from the registry and stops the refresh groutine
func (*EtcdPlugin) GetLocalAddr ¶
func (self *EtcdPlugin) GetLocalAddr() (string, error)
Return the local address where etcd is listening
func (*EtcdPlugin) GetObj ¶
func (self *EtcdPlugin) GetObj(key string, retVal interface{}) error
Get an object
func (*EtcdPlugin) GetService ¶
func (self *EtcdPlugin) GetService(name string) ([]api.ServiceInfo, error)
List all end points for a service
func (*EtcdPlugin) Init ¶
func (self *EtcdPlugin) Init(machines []string) error
Initialize the etcd client
func (*EtcdPlugin) ListDir ¶
func (self *EtcdPlugin) ListDir(key string) ([]string, error)
Get a list of objects in a directory
func (*EtcdPlugin) NewLock ¶
func (self *EtcdPlugin) NewLock(name string, myId string, ttl uint64) (api.LockInterface, error)
Create a new lock
func (*EtcdPlugin) RegisterService ¶
func (self *EtcdPlugin) RegisterService(serviceInfo api.ServiceInfo) error
Register a service Service is registered with a ttl for 60sec and a goroutine is created to refresh the ttl.
func (*EtcdPlugin) SetObj ¶
func (self *EtcdPlugin) SetObj(key string, value interface{}) error
Save an object, create if it doesnt exist
func (*EtcdPlugin) WatchService ¶
func (self *EtcdPlugin) WatchService(name string, eventCh chan api.WatchServiceEvent, stopCh chan bool) error
Watch for a service
Click to show internal directories.
Click to hide internal directories.