Documentation ¶
Overview ¶
Package etcd implements data storage using etcd.
Key layout:
<prefix>/ ├── tokens/ │ └── <id>: core.BootstrapToken ├── clusters/ │ └── <id>: core.Cluster ├── roles/ │ └── <id>: core.Role ├── rolebindings/ │ └── <id>: core.RoleBinding ├── keyrings/ │ └── <cluster-id>/ │ └── <capability-id>: keyring.Keyring │── kv/ │ ├── <prefix1>/ │ │ └── ... │ └── <prefix2>/ │ └── ...
Index ¶
- type EtcdStore
- func (e *EtcdStore) CreateCluster(ctx context.Context, cluster *corev1.Cluster) error
- func (e *EtcdStore) CreateRole(ctx context.Context, role *corev1.Role) error
- func (e *EtcdStore) CreateRoleBinding(ctx context.Context, roleBinding *corev1.RoleBinding) error
- func (e *EtcdStore) CreateToken(ctx context.Context, ttl time.Duration, opts ...storage.TokenCreateOption) (*corev1.BootstrapToken, error)
- func (e *EtcdStore) DeleteCluster(ctx context.Context, ref *corev1.Reference) error
- func (e *EtcdStore) DeleteRole(ctx context.Context, ref *corev1.Reference) error
- func (e *EtcdStore) DeleteRoleBinding(ctx context.Context, ref *corev1.Reference) error
- func (e *EtcdStore) DeleteToken(ctx context.Context, ref *corev1.Reference) error
- func (e *EtcdStore) GetCluster(ctx context.Context, ref *corev1.Reference) (*corev1.Cluster, error)
- func (e *EtcdStore) GetRole(ctx context.Context, ref *corev1.Reference) (*corev1.Role, error)
- func (e *EtcdStore) GetRoleBinding(ctx context.Context, ref *corev1.Reference) (*corev1.RoleBinding, error)
- func (e *EtcdStore) GetToken(ctx context.Context, ref *corev1.Reference) (*corev1.BootstrapToken, error)
- func (e *EtcdStore) KeyValueStore(prefix string) storage.KeyValueStore
- func (e *EtcdStore) KeyringStore(prefix string, ref *corev1.Reference) storage.KeyringStore
- func (e *EtcdStore) ListClusters(ctx context.Context, matchLabels *corev1.LabelSelector, ...) (*corev1.ClusterList, error)
- func (e *EtcdStore) ListRoleBindings(ctx context.Context) (*corev1.RoleBindingList, error)
- func (e *EtcdStore) ListRoles(ctx context.Context) (*corev1.RoleList, error)
- func (e *EtcdStore) ListTokens(ctx context.Context) ([]*corev1.BootstrapToken, error)
- func (e *EtcdStore) UpdateCluster(ctx context.Context, ref *corev1.Reference, ...) (*corev1.Cluster, error)
- func (e *EtcdStore) UpdateToken(ctx context.Context, ref *corev1.Reference, ...) (*corev1.BootstrapToken, error)
- func (e *EtcdStore) WatchCluster(ctx context.Context, cluster *corev1.Cluster) (<-chan storage.WatchEvent[*corev1.Cluster], error)
- func (e *EtcdStore) WatchClusters(ctx context.Context, knownClusters []*corev1.Cluster) (<-chan storage.WatchEvent[*corev1.Cluster], error)
- type EtcdStoreOption
- type EtcdStoreOptions
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 (*EtcdStore) CreateRole ¶
func (*EtcdStore) CreateRoleBinding ¶
func (*EtcdStore) CreateToken ¶
func (e *EtcdStore) CreateToken(ctx context.Context, ttl time.Duration, opts ...storage.TokenCreateOption) (*corev1.BootstrapToken, error)
func (*EtcdStore) DeleteCluster ¶
func (*EtcdStore) DeleteRole ¶
func (*EtcdStore) DeleteRoleBinding ¶
func (*EtcdStore) DeleteToken ¶
func (*EtcdStore) GetCluster ¶
func (*EtcdStore) GetRoleBinding ¶
func (*EtcdStore) KeyValueStore ¶
func (e *EtcdStore) KeyValueStore(prefix string) storage.KeyValueStore
func (*EtcdStore) KeyringStore ¶
func (*EtcdStore) ListClusters ¶
func (e *EtcdStore) ListClusters( ctx context.Context, matchLabels *corev1.LabelSelector, matchOptions corev1.MatchOptions, ) (*corev1.ClusterList, error)
func (*EtcdStore) ListRoleBindings ¶
func (*EtcdStore) ListTokens ¶
func (*EtcdStore) UpdateCluster ¶
func (*EtcdStore) UpdateToken ¶
func (e *EtcdStore) UpdateToken(ctx context.Context, ref *corev1.Reference, mutator storage.MutatorFunc[*corev1.BootstrapToken]) (*corev1.BootstrapToken, error)
func (*EtcdStore) WatchCluster ¶ added in v0.6.0
type EtcdStoreOption ¶
type EtcdStoreOption func(*EtcdStoreOptions)
func WithPrefix ¶
func WithPrefix(prefix string) EtcdStoreOption
type EtcdStoreOptions ¶
type EtcdStoreOptions struct {
Prefix string
}
Click to show internal directories.
Click to hide internal directories.