etcd

package
v0.4.2-rc3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EtcdStore

type EtcdStore struct {
	EtcdStoreOptions
	Logger *zap.SugaredLogger
	Client *clientv3.Client
}

EtcdStore implements TokenStore and TenantStore.

func NewEtcdStore

func NewEtcdStore(ctx context.Context, conf *v1beta1.EtcdStorageSpec, opts ...EtcdStoreOption) *EtcdStore

func (*EtcdStore) CreateCluster

func (e *EtcdStore) CreateCluster(ctx context.Context, cluster *core.Cluster) error

func (*EtcdStore) CreateRole

func (e *EtcdStore) CreateRole(ctx context.Context, role *core.Role) error

func (*EtcdStore) CreateRoleBinding

func (e *EtcdStore) CreateRoleBinding(ctx context.Context, roleBinding *core.RoleBinding) error

func (*EtcdStore) CreateToken

func (e *EtcdStore) CreateToken(ctx context.Context, ttl time.Duration, opts ...storage.TokenCreateOption) (*core.BootstrapToken, error)

func (*EtcdStore) DeleteCluster

func (e *EtcdStore) DeleteCluster(ctx context.Context, ref *core.Reference) error

func (*EtcdStore) DeleteRole

func (e *EtcdStore) DeleteRole(ctx context.Context, ref *core.Reference) error

func (*EtcdStore) DeleteRoleBinding

func (e *EtcdStore) DeleteRoleBinding(ctx context.Context, ref *core.Reference) error

func (*EtcdStore) DeleteToken

func (e *EtcdStore) DeleteToken(ctx context.Context, ref *core.Reference) error

func (*EtcdStore) GetCluster

func (e *EtcdStore) GetCluster(ctx context.Context, ref *core.Reference) (*core.Cluster, error)

func (*EtcdStore) GetRole

func (e *EtcdStore) GetRole(ctx context.Context, ref *core.Reference) (*core.Role, error)

func (*EtcdStore) GetRoleBinding

func (e *EtcdStore) GetRoleBinding(ctx context.Context, ref *core.Reference) (*core.RoleBinding, error)

func (*EtcdStore) GetToken

func (e *EtcdStore) GetToken(ctx context.Context, ref *core.Reference) (*core.BootstrapToken, error)

func (*EtcdStore) KeyValueStore

func (e *EtcdStore) KeyValueStore(prefix string) (storage.KeyValueStore, error)

func (*EtcdStore) KeyringStore

func (e *EtcdStore) KeyringStore(ctx context.Context, prefix string, ref *core.Reference) (storage.KeyringStore, error)

func (*EtcdStore) ListClusters

func (e *EtcdStore) ListClusters(
	ctx context.Context,
	matchLabels *core.LabelSelector,
	matchOptions core.MatchOptions,
) (*core.ClusterList, error)

func (*EtcdStore) ListRoleBindings

func (e *EtcdStore) ListRoleBindings(ctx context.Context) (*core.RoleBindingList, error)

func (*EtcdStore) ListRoles

func (e *EtcdStore) ListRoles(ctx context.Context) (*core.RoleList, error)

func (*EtcdStore) ListTokens

func (e *EtcdStore) ListTokens(ctx context.Context) ([]*core.BootstrapToken, error)

func (*EtcdStore) UpdateCluster

func (e *EtcdStore) UpdateCluster(
	ctx context.Context,
	ref *core.Reference,
	mutator storage.MutatorFunc[*core.Cluster],
) (*core.Cluster, error)

func (*EtcdStore) UpdateToken

type EtcdStoreOption

type EtcdStoreOption func(*EtcdStoreOptions)

func WithCommandTimeout

func WithCommandTimeout(timeout time.Duration) EtcdStoreOption

func WithPrefix

func WithPrefix(prefix string) EtcdStoreOption

type EtcdStoreOptions

type EtcdStoreOptions struct {
	Prefix         string
	CommandTimeout time.Duration
}

func (*EtcdStoreOptions) Apply

func (o *EtcdStoreOptions) Apply(opts ...EtcdStoreOption)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL