Documentation ¶
Overview ¶
Package internal is a generated GoMock package.
Package internal is a generated GoMock package.
Package internal is a generated GoMock package.
Index ¶
- Constants
- Variables
- type EtcdClient
- type KV
- type Listener
- type MockEtcdClient
- func (m *MockEtcdClient) ActiveConnection() *grpc.ClientConn
- func (m *MockEtcdClient) Close() error
- func (m *MockEtcdClient) Ctx() context.Context
- func (m *MockEtcdClient) EXPECT() *MockEtcdClientMockRecorder
- func (m *MockEtcdClient) Get(ctx context.Context, key string, opts ...clientv3.OpOption) (*clientv3.GetResponse, error)
- func (m *MockEtcdClient) Grant(ctx context.Context, ttl int64) (*clientv3.LeaseGrantResponse, error)
- func (m *MockEtcdClient) KeepAlive(ctx context.Context, id clientv3.LeaseID) (<-chan *clientv3.LeaseKeepAliveResponse, error)
- func (m *MockEtcdClient) Put(ctx context.Context, key, val string, opts ...clientv3.OpOption) (*clientv3.PutResponse, error)
- func (m *MockEtcdClient) Revoke(ctx context.Context, id clientv3.LeaseID) (*clientv3.LeaseRevokeResponse, error)
- func (m *MockEtcdClient) Watch(ctx context.Context, key string, opts ...clientv3.OpOption) clientv3.WatchChan
- type MockEtcdClientMockRecorder
- func (mr *MockEtcdClientMockRecorder) ActiveConnection() *gomock.Call
- func (mr *MockEtcdClientMockRecorder) Close() *gomock.Call
- func (mr *MockEtcdClientMockRecorder) Ctx() *gomock.Call
- func (mr *MockEtcdClientMockRecorder) Get(ctx, key interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockEtcdClientMockRecorder) Grant(ctx, ttl interface{}) *gomock.Call
- func (mr *MockEtcdClientMockRecorder) KeepAlive(ctx, id interface{}) *gomock.Call
- func (mr *MockEtcdClientMockRecorder) Put(ctx, key, val interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockEtcdClientMockRecorder) Revoke(ctx, id interface{}) *gomock.Call
- func (mr *MockEtcdClientMockRecorder) Watch(ctx, key interface{}, opts ...interface{}) *gomock.Call
- type MockUpdateListener
- type MockUpdateListenerMockRecorder
- type MocketcdConn
- type MocketcdConnMockRecorder
- type Registry
- type UpdateListener
Constants ¶
const (
// Delimiter is a separator that separates the etcd path.
Delimiter = '/'
)
Variables ¶
var ( // DialTimeout is the dial timeout. DialTimeout = dialTimeout // RequestTimeout is the request timeout. RequestTimeout = requestTimeout // NewClient is used to create etcd clients. NewClient = DialClient )
Functions ¶
This section is empty.
Types ¶
type EtcdClient ¶
type EtcdClient interface { ActiveConnection() *grpc.ClientConn Close() error Ctx() context.Context Get(ctx context.Context, key string, opts ...clientv3.OpOption) (*clientv3.GetResponse, error) Grant(ctx context.Context, ttl int64) (*clientv3.LeaseGrantResponse, error) KeepAlive(ctx context.Context, id clientv3.LeaseID) (<-chan *clientv3.LeaseKeepAliveResponse, error) Put(ctx context.Context, key, val string, opts ...clientv3.OpOption) (*clientv3.PutResponse, error) Revoke(ctx context.Context, id clientv3.LeaseID) (*clientv3.LeaseRevokeResponse, error) Watch(ctx context.Context, key string, opts ...clientv3.OpOption) clientv3.WatchChan }
EtcdClient interface represents an etcd client.
func DialClient ¶
func DialClient(endpoints []string) (EtcdClient, error)
DialClient dials an etcd cluster with given endpoints.
type MockEtcdClient ¶
type MockEtcdClient struct {
// contains filtered or unexported fields
}
MockEtcdClient is a mock of EtcdClient interface
func NewMockEtcdClient ¶
func NewMockEtcdClient(ctrl *gomock.Controller) *MockEtcdClient
NewMockEtcdClient creates a new mock instance
func (*MockEtcdClient) ActiveConnection ¶
func (m *MockEtcdClient) ActiveConnection() *grpc.ClientConn
ActiveConnection mocks base method
func (*MockEtcdClient) EXPECT ¶
func (m *MockEtcdClient) EXPECT() *MockEtcdClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockEtcdClient) Get ¶
func (m *MockEtcdClient) Get(ctx context.Context, key string, opts ...clientv3.OpOption) (*clientv3.GetResponse, error)
Get mocks base method
func (*MockEtcdClient) Grant ¶
func (m *MockEtcdClient) Grant(ctx context.Context, ttl int64) (*clientv3.LeaseGrantResponse, error)
Grant mocks base method
func (*MockEtcdClient) KeepAlive ¶
func (m *MockEtcdClient) KeepAlive(ctx context.Context, id clientv3.LeaseID) (<-chan *clientv3.LeaseKeepAliveResponse, error)
KeepAlive mocks base method
func (*MockEtcdClient) Put ¶
func (m *MockEtcdClient) Put(ctx context.Context, key, val string, opts ...clientv3.OpOption) (*clientv3.PutResponse, error)
Put mocks base method
func (*MockEtcdClient) Revoke ¶
func (m *MockEtcdClient) Revoke(ctx context.Context, id clientv3.LeaseID) (*clientv3.LeaseRevokeResponse, error)
Revoke mocks base method
type MockEtcdClientMockRecorder ¶
type MockEtcdClientMockRecorder struct {
// contains filtered or unexported fields
}
MockEtcdClientMockRecorder is the mock recorder for MockEtcdClient
func (*MockEtcdClientMockRecorder) ActiveConnection ¶
func (mr *MockEtcdClientMockRecorder) ActiveConnection() *gomock.Call
ActiveConnection indicates an expected call of ActiveConnection
func (*MockEtcdClientMockRecorder) Close ¶
func (mr *MockEtcdClientMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close
func (*MockEtcdClientMockRecorder) Ctx ¶
func (mr *MockEtcdClientMockRecorder) Ctx() *gomock.Call
Ctx indicates an expected call of Ctx
func (*MockEtcdClientMockRecorder) Get ¶
func (mr *MockEtcdClientMockRecorder) Get(ctx, key interface{}, opts ...interface{}) *gomock.Call
Get indicates an expected call of Get
func (*MockEtcdClientMockRecorder) Grant ¶
func (mr *MockEtcdClientMockRecorder) Grant(ctx, ttl interface{}) *gomock.Call
Grant indicates an expected call of Grant
func (*MockEtcdClientMockRecorder) KeepAlive ¶
func (mr *MockEtcdClientMockRecorder) KeepAlive(ctx, id interface{}) *gomock.Call
KeepAlive indicates an expected call of KeepAlive
func (*MockEtcdClientMockRecorder) Put ¶
func (mr *MockEtcdClientMockRecorder) Put(ctx, key, val interface{}, opts ...interface{}) *gomock.Call
Put indicates an expected call of Put
func (*MockEtcdClientMockRecorder) Revoke ¶
func (mr *MockEtcdClientMockRecorder) Revoke(ctx, id interface{}) *gomock.Call
Revoke indicates an expected call of Revoke
func (*MockEtcdClientMockRecorder) Watch ¶
func (mr *MockEtcdClientMockRecorder) Watch(ctx, key interface{}, opts ...interface{}) *gomock.Call
Watch indicates an expected call of Watch
type MockUpdateListener ¶
type MockUpdateListener struct {
// contains filtered or unexported fields
}
MockUpdateListener is a mock of UpdateListener interface
func NewMockUpdateListener ¶
func NewMockUpdateListener(ctrl *gomock.Controller) *MockUpdateListener
NewMockUpdateListener creates a new mock instance
func (*MockUpdateListener) EXPECT ¶
func (m *MockUpdateListener) EXPECT() *MockUpdateListenerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockUpdateListener) OnAdd ¶
func (m *MockUpdateListener) OnAdd(kv KV)
OnAdd mocks base method
func (*MockUpdateListener) OnDelete ¶
func (m *MockUpdateListener) OnDelete(kv KV)
OnDelete mocks base method
type MockUpdateListenerMockRecorder ¶
type MockUpdateListenerMockRecorder struct {
// contains filtered or unexported fields
}
MockUpdateListenerMockRecorder is the mock recorder for MockUpdateListener
func (*MockUpdateListenerMockRecorder) OnAdd ¶
func (mr *MockUpdateListenerMockRecorder) OnAdd(kv interface{}) *gomock.Call
OnAdd indicates an expected call of OnAdd
func (*MockUpdateListenerMockRecorder) OnDelete ¶
func (mr *MockUpdateListenerMockRecorder) OnDelete(kv interface{}) *gomock.Call
OnDelete indicates an expected call of OnDelete
type MocketcdConn ¶
type MocketcdConn struct {
// contains filtered or unexported fields
}
MocketcdConn is a mock of etcdConn interface
func NewMocketcdConn ¶
func NewMocketcdConn(ctrl *gomock.Controller) *MocketcdConn
NewMocketcdConn creates a new mock instance
func (*MocketcdConn) EXPECT ¶
func (m *MocketcdConn) EXPECT() *MocketcdConnMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MocketcdConn) GetState ¶
func (m *MocketcdConn) GetState() connectivity.State
GetState mocks base method
func (*MocketcdConn) WaitForStateChange ¶
func (m *MocketcdConn) WaitForStateChange(ctx context.Context, sourceState connectivity.State) bool
WaitForStateChange mocks base method
type MocketcdConnMockRecorder ¶
type MocketcdConnMockRecorder struct {
// contains filtered or unexported fields
}
MocketcdConnMockRecorder is the mock recorder for MocketcdConn
func (*MocketcdConnMockRecorder) GetState ¶
func (mr *MocketcdConnMockRecorder) GetState() *gomock.Call
GetState indicates an expected call of GetState
func (*MocketcdConnMockRecorder) WaitForStateChange ¶
func (mr *MocketcdConnMockRecorder) WaitForStateChange(ctx, sourceState interface{}) *gomock.Call
WaitForStateChange indicates an expected call of WaitForStateChange
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
A Registry is a registry that manages the etcd client connections.
type UpdateListener ¶
UpdateListener wraps the OnAdd and OnDelete methods.