Documentation ¶
Index ¶
- Constants
- Variables
- func WaitEvents(c *clientv3.Client, key string, rev int64, evs []mvccpb.Event_EventType) (*clientv3.Event, error)
- func WaitPrefixEvents(c *clientv3.Client, prefix string, rev int64, evs []mvccpb.Event_EventType) (*clientv3.Event, error)
- type EphemeralKV
- type EtcdDiscovery
- type EtcdGateway
- func (o *EtcdGateway) Broadcast(message *qtiny.Message, discovery qtiny.Discovery) error
- func (o *EtcdGateway) GetMeta() map[string]interface{}
- func (o *EtcdGateway) GetType() string
- func (o *EtcdGateway) Init(config map[string]interface{}) error
- func (o *EtcdGateway) Multicast(message *qtiny.Message, discovery qtiny.Discovery) error
- func (o *EtcdGateway) Post(message *qtiny.Message, discovery qtiny.Discovery) error
- func (o *EtcdGateway) Start(config map[string]interface{}) error
- func (o *EtcdGateway) Stop(config map[string]interface{}) error
- func (o *EtcdGateway) String() string
- type EtcdWatcher
- func (o *EtcdWatcher) AddConnectCallback(callback EtcdWatcherCallback)
- func (o *EtcdWatcher) Compact(recv int64, timeout time.Duration, opts ...clientv3.CompactOption) (*clientv3.CompactResponse, error)
- func (o *EtcdWatcher) Create(path string, data string, timeout time.Duration) (bool, error)
- func (o *EtcdWatcher) Delete(path string, timeout time.Duration, opts ...clientv3.OpOption) (*clientv3.DeleteResponse, error)
- func (o *EtcdWatcher) Get(path string, timeout time.Duration, opts ...clientv3.OpOption) (*clientv3.GetResponse, error)
- func (o *EtcdWatcher) GetConn() *clientv3.Client
- func (o *EtcdWatcher) GetContextWithTimeout(parent context.Context, timeout time.Duration) context.Context
- func (o *EtcdWatcher) IsConnected() bool
- func (o *EtcdWatcher) Put(path string, val string, timeout time.Duration, opts ...clientv3.OpOption) (*clientv3.PutResponse, error)
- func (o *EtcdWatcher) PutWithTTL(path string, val string, ttl int64, timeout time.Duration, ...) (*clientv3.PutResponse, *clientv3.LeaseGrantResponse, error)
- func (o *EtcdWatcher) Start(config map[string]interface{}) error
- func (o *EtcdWatcher) Stop(map[string]interface{}) error
- func (o *EtcdWatcher) WaitForConnected() <-chan bool
- func (o *EtcdWatcher) Watch(path string, timeout time.Duration, opts ...clientv3.OpOption) clientv3.WatchChan
- func (o *EtcdWatcher) Watch2(wtype WatchType, path string, data interface{}, routine WatchRoutine)
- type EtcdWatcherCallback
- type EtcdWatcherEvent
- type Queue
- type RemoteKV
- type WatchBox
- type WatchRoutine
- type WatchType
Constants ¶
View Source
const PathNano = "/qnano"
View Source
const PathNodeQueue = "/qqueue"
Variables ¶
Functions ¶
Types ¶
type EphemeralKV ¶
type EphemeralKV struct{ RemoteKV }
EphemeralKV is a new key associated with a session lease
type EtcdDiscovery ¶
type EtcdDiscovery struct { }
type EtcdGateway ¶
type EtcdGateway struct { memory.MemGateway // contains filtered or unexported fields }
func (*EtcdGateway) GetMeta ¶
func (o *EtcdGateway) GetMeta() map[string]interface{}
func (*EtcdGateway) GetType ¶
func (o *EtcdGateway) GetType() string
func (*EtcdGateway) Init ¶
func (o *EtcdGateway) Init(config map[string]interface{}) error
func (*EtcdGateway) Start ¶
func (o *EtcdGateway) Start(config map[string]interface{}) error
func (*EtcdGateway) Stop ¶
func (o *EtcdGateway) Stop(config map[string]interface{}) error
func (*EtcdGateway) String ¶
func (o *EtcdGateway) String() string
type EtcdWatcher ¶
type EtcdWatcher struct { Id string Endpoints []string HeartbeatPath string SessionTimeout time.Duration ReconnectInterval time.Duration Logger *log.Logger // contains filtered or unexported fields }
func (*EtcdWatcher) AddConnectCallback ¶
func (o *EtcdWatcher) AddConnectCallback(callback EtcdWatcherCallback)
func (*EtcdWatcher) Compact ¶
func (o *EtcdWatcher) Compact(recv int64, timeout time.Duration, opts ...clientv3.CompactOption) (*clientv3.CompactResponse, error)
func (*EtcdWatcher) Delete ¶
func (o *EtcdWatcher) Delete(path string, timeout time.Duration, opts ...clientv3.OpOption) (*clientv3.DeleteResponse, error)
func (*EtcdWatcher) Get ¶
func (o *EtcdWatcher) Get(path string, timeout time.Duration, opts ...clientv3.OpOption) (*clientv3.GetResponse, error)
func (*EtcdWatcher) GetConn ¶
func (o *EtcdWatcher) GetConn() *clientv3.Client
func (*EtcdWatcher) GetContextWithTimeout ¶
func (*EtcdWatcher) IsConnected ¶
func (o *EtcdWatcher) IsConnected() bool
func (*EtcdWatcher) Put ¶
func (o *EtcdWatcher) Put(path string, val string, timeout time.Duration, opts ...clientv3.OpOption) (*clientv3.PutResponse, error)
func (*EtcdWatcher) PutWithTTL ¶
func (o *EtcdWatcher) PutWithTTL(path string, val string, ttl int64, timeout time.Duration, opts ...clientv3.OpOption) (*clientv3.PutResponse, *clientv3.LeaseGrantResponse, error)
func (*EtcdWatcher) Start ¶
func (o *EtcdWatcher) Start(config map[string]interface{}) error
func (*EtcdWatcher) Stop ¶
func (o *EtcdWatcher) Stop(map[string]interface{}) error
func (*EtcdWatcher) WaitForConnected ¶
func (o *EtcdWatcher) WaitForConnected() <-chan bool
func (*EtcdWatcher) Watch2 ¶
func (o *EtcdWatcher) Watch2(wtype WatchType, path string, data interface{}, routine WatchRoutine)
type EtcdWatcherCallback ¶
type EtcdWatcherCallback func(event EtcdWatcherEvent, watcher *EtcdWatcher, err error)
type EtcdWatcherEvent ¶
type EtcdWatcherEvent int
const ( EtcdWatcherEventConnected EtcdWatcherEvent = 1 EtcdWatcherEventDisconnected EtcdWatcherEvent = 2 )
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue implements a multi-reader, multi-writer distributed queue.
type RemoteKV ¶
type RemoteKV struct {
// contains filtered or unexported fields
}
RemoteKV is a key/revision pair created by the client and stored on etcd
type WatchBox ¶
type WatchRoutine ¶
Click to show internal directories.
Click to hide internal directories.