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
- func AddAccount(endpoints []string, user, pass string)
- func AddTLS(endpoints []string, certFile, certKeyFile, caFile string, ...) error
- func GetTLS(endpoints []string) (*tls.Config, bool)
- type Account
- 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 any, opts ...any) *gomock.Call
- func (mr *MockEtcdClientMockRecorder) Grant(ctx, ttl any) *gomock.Call
- func (mr *MockEtcdClientMockRecorder) KeepAlive(ctx, id any) *gomock.Call
- func (mr *MockEtcdClientMockRecorder) Put(ctx, key, val any, opts ...any) *gomock.Call
- func (mr *MockEtcdClientMockRecorder) Revoke(ctx, id any) *gomock.Call
- func (mr *MockEtcdClientMockRecorder) Watch(ctx, key any, opts ...any) *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 ¶
func AddAccount ¶
AddAccount adds the username/password for the given etcd cluster.
Types ¶
type Account ¶
Account holds the username/password for an etcd cluster.
func GetAccount ¶
GetAccount gets the username/password for the given etcd cluster.
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 any, opts ...any) *gomock.Call
Get indicates an expected call of Get
func (*MockEtcdClientMockRecorder) Grant ¶
func (mr *MockEtcdClientMockRecorder) Grant(ctx, ttl any) *gomock.Call
Grant indicates an expected call of Grant
func (*MockEtcdClientMockRecorder) KeepAlive ¶
func (mr *MockEtcdClientMockRecorder) KeepAlive(ctx, id any) *gomock.Call
KeepAlive indicates an expected call of KeepAlive
func (*MockEtcdClientMockRecorder) Put ¶
func (mr *MockEtcdClientMockRecorder) Put(ctx, key, val any, opts ...any) *gomock.Call
Put indicates an expected call of Put
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
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 any) *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.