Documentation
¶
Index ¶
- Variables
- func Provide(i *do.Injector)
- func RemoveHost(ctx context.Context, client *clientv3.Client, certSvc *certificates.Service, ...) error
- func RemoveHostCredentials(ctx context.Context, client *clientv3.Client, certSvc *certificates.Service, ...) error
- func RemoveInstanceEtcdUser(ctx context.Context, client *clientv3.Client, certSvc *certificates.Service, ...) error
- func RemoveMember(ctx context.Context, client *clientv3.Client, hostID string) error
- func VerifyJoinToken(certSvc *certificates.Service, in string) error
- type ClusterMember
- type EmbeddedEtcd
- func (e *EmbeddedEtcd) AddHost(ctx context.Context, opts HostCredentialOptions) (*HostCredentials, error)
- func (e *EmbeddedEtcd) ClientEndpoints() []string
- func (e *EmbeddedEtcd) Error() <-chan error
- func (e *EmbeddedEtcd) GetClient() (*clientv3.Client, error)
- func (e *EmbeddedEtcd) HealthCheck() common.ComponentStatus
- func (e *EmbeddedEtcd) Initialized() <-chan struct{}
- func (e *EmbeddedEtcd) IsInitialized() (bool, error)
- func (e *EmbeddedEtcd) Join(ctx context.Context, options JoinOptions) error
- func (e *EmbeddedEtcd) JoinToken() (string, error)
- func (e *EmbeddedEtcd) Leader(ctx context.Context) (*ClusterMember, error)
- func (e *EmbeddedEtcd) PeerEndpoints() []string
- func (e *EmbeddedEtcd) PromoteWhenReady(ctx context.Context, client *clientv3.Client, memberName string) error
- func (e *EmbeddedEtcd) RemoveHost(ctx context.Context, hostID string) error
- func (e *EmbeddedEtcd) Shutdown() error
- func (e *EmbeddedEtcd) Start(ctx context.Context) error
- func (e *EmbeddedEtcd) VerifyJoinToken(in string) error
- type Etcd
- type HostCredentialOptions
- type HostCredentials
- type InstanceUserCredentials
- type InstanceUserOptions
- type JoinOptions
- type RemoteEtcd
- func (r *RemoteEtcd) AddHost(ctx context.Context, opts HostCredentialOptions) (*HostCredentials, error)
- func (r *RemoteEtcd) Error() <-chan error
- func (r *RemoteEtcd) GetClient() (*clientv3.Client, error)
- func (r *RemoteEtcd) HealthCheck() common.ComponentStatus
- func (r *RemoteEtcd) Initialized() <-chan struct{}
- func (r *RemoteEtcd) IsInitialized() (bool, error)
- func (r *RemoteEtcd) Join(ctx context.Context, options JoinOptions) error
- func (r *RemoteEtcd) JoinToken() (string, error)
- func (r *RemoteEtcd) Leader(ctx context.Context) (*ClusterMember, error)
- func (r *RemoteEtcd) RemoveHost(ctx context.Context, hostID string) error
- func (r *RemoteEtcd) Shutdown() error
- func (r *RemoteEtcd) Start(ctx context.Context) error
- func (r *RemoteEtcd) VerifyJoinToken(in string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMinimumClusterSize = errors.New("cannot remove a member from a cluster with less than three nodes") ErrCannotRemoveSelf = errors.New("cannot remove self from cluster") ErrInvalidJoinToken = errors.New("invalid join token") )
View Source
var ErrOperationNotSupported = errors.New("operation not supported")
Functions ¶
func RemoveHost ¶
func RemoveHostCredentials ¶
func RemoveInstanceEtcdUser ¶
func RemoveMember ¶
func VerifyJoinToken ¶
func VerifyJoinToken(certSvc *certificates.Service, in string) error
Types ¶
type ClusterMember ¶
func GetClusterLeader ¶
type EmbeddedEtcd ¶
type EmbeddedEtcd struct {
// contains filtered or unexported fields
}
func NewEmbeddedEtcd ¶
func NewEmbeddedEtcd(cfg *config.Manager, logger zerolog.Logger) *EmbeddedEtcd
func (*EmbeddedEtcd) AddHost ¶
func (e *EmbeddedEtcd) AddHost(ctx context.Context, opts HostCredentialOptions) (*HostCredentials, error)
func (*EmbeddedEtcd) ClientEndpoints ¶
func (e *EmbeddedEtcd) ClientEndpoints() []string
func (*EmbeddedEtcd) Error ¶
func (e *EmbeddedEtcd) Error() <-chan error
func (*EmbeddedEtcd) HealthCheck ¶
func (e *EmbeddedEtcd) HealthCheck() common.ComponentStatus
func (*EmbeddedEtcd) Initialized ¶
func (e *EmbeddedEtcd) Initialized() <-chan struct{}
func (*EmbeddedEtcd) IsInitialized ¶
func (e *EmbeddedEtcd) IsInitialized() (bool, error)
func (*EmbeddedEtcd) Join ¶
func (e *EmbeddedEtcd) Join(ctx context.Context, options JoinOptions) error
func (*EmbeddedEtcd) JoinToken ¶
func (e *EmbeddedEtcd) JoinToken() (string, error)
func (*EmbeddedEtcd) Leader ¶
func (e *EmbeddedEtcd) Leader(ctx context.Context) (*ClusterMember, error)
func (*EmbeddedEtcd) PeerEndpoints ¶
func (e *EmbeddedEtcd) PeerEndpoints() []string
func (*EmbeddedEtcd) PromoteWhenReady ¶
func (*EmbeddedEtcd) RemoveHost ¶
func (e *EmbeddedEtcd) RemoveHost(ctx context.Context, hostID string) error
func (*EmbeddedEtcd) Shutdown ¶
func (e *EmbeddedEtcd) Shutdown() error
func (*EmbeddedEtcd) VerifyJoinToken ¶
func (e *EmbeddedEtcd) VerifyJoinToken(in string) error
type Etcd ¶
type Etcd interface {
common.HealthCheckable
IsInitialized() (bool, error)
Start(ctx context.Context) error
Join(ctx context.Context, options JoinOptions) error
Initialized() <-chan struct{}
Error() <-chan error
GetClient() (*clientv3.Client, error)
Leader(ctx context.Context) (*ClusterMember, error)
AddHost(ctx context.Context, opts HostCredentialOptions) (*HostCredentials, error)
RemoveHost(ctx context.Context, hostID string) error
JoinToken() (string, error)
VerifyJoinToken(in string) error
}
type HostCredentialOptions ¶
type HostCredentials ¶
type HostCredentials struct {
Username string
Password string
CaCert []byte
ClientCert []byte
ClientKey []byte
ServerCert []byte
ServerKey []byte
}
func CreateHostCredentials ¶
func CreateHostCredentials( ctx context.Context, client *clientv3.Client, certSvc *certificates.Service, opts HostCredentialOptions, ) (*HostCredentials, error)
type InstanceUserCredentials ¶
type InstanceUserCredentials struct {
Username string
Password string
CaCert []byte
ClientCert []byte
ClientKey []byte
}
func CreateInstanceEtcdUser ¶
func CreateInstanceEtcdUser( ctx context.Context, client *clientv3.Client, certSvc *certificates.Service, opts InstanceUserOptions, ) (*InstanceUserCredentials, error)
type InstanceUserOptions ¶
type JoinOptions ¶
type JoinOptions struct {
Leader *ClusterMember
Credentials *HostCredentials
}
type RemoteEtcd ¶
type RemoteEtcd struct {
// contains filtered or unexported fields
}
func NewRemoteEtcd ¶
func NewRemoteEtcd(cfg *config.Manager, logger zerolog.Logger) *RemoteEtcd
func (*RemoteEtcd) AddHost ¶
func (r *RemoteEtcd) AddHost(ctx context.Context, opts HostCredentialOptions) (*HostCredentials, error)
func (*RemoteEtcd) Error ¶
func (r *RemoteEtcd) Error() <-chan error
func (*RemoteEtcd) HealthCheck ¶
func (r *RemoteEtcd) HealthCheck() common.ComponentStatus
func (*RemoteEtcd) Initialized ¶
func (r *RemoteEtcd) Initialized() <-chan struct{}
func (*RemoteEtcd) IsInitialized ¶
func (r *RemoteEtcd) IsInitialized() (bool, error)
func (*RemoteEtcd) Join ¶
func (r *RemoteEtcd) Join(ctx context.Context, options JoinOptions) error
func (*RemoteEtcd) JoinToken ¶
func (r *RemoteEtcd) JoinToken() (string, error)
func (*RemoteEtcd) Leader ¶
func (r *RemoteEtcd) Leader(ctx context.Context) (*ClusterMember, error)
func (*RemoteEtcd) RemoveHost ¶
func (r *RemoteEtcd) RemoveHost(ctx context.Context, hostID string) error
func (*RemoteEtcd) Shutdown ¶
func (r *RemoteEtcd) Shutdown() error
func (*RemoteEtcd) VerifyJoinToken ¶
func (r *RemoteEtcd) VerifyJoinToken(in string) error
Click to show internal directories.
Click to hide internal directories.