storage

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: Apache-2.0 Imports: 12 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = &NotFoundError{}

Functions

func ApplyRoleBindingTaints

func ApplyRoleBindingTaints(ctx context.Context, store RBACStore, rb *core.RoleBinding) error

func NewRBACProvider

func NewRBACProvider(store SubjectAccessCapableStore) rbac.Provider

Types

type ClusterMutator

type ClusterMutator = MutatorFunc[*core.Cluster]

type ClusterSelector

type ClusterSelector struct {
	ClusterIDs    []string
	LabelSelector *core.LabelSelector
	MatchOptions  core.MatchOptions
}

func (ClusterSelector) Predicate

func (p ClusterSelector) Predicate() SelectorPredicate

type ClusterStore

type ClusterStore interface {
	CreateCluster(ctx context.Context, cluster *core.Cluster) error
	DeleteCluster(ctx context.Context, ref *core.Reference) error
	GetCluster(ctx context.Context, ref *core.Reference) (*core.Cluster, error)
	UpdateCluster(ctx context.Context, ref *core.Reference, mutator ClusterMutator) (*core.Cluster, error)
	ListClusters(ctx context.Context, matchLabels *core.LabelSelector, matchOptions core.MatchOptions) (*core.ClusterList, error)
}

type CompositeBackend

func (*CompositeBackend) IsValid

func (cb *CompositeBackend) IsValid() bool

func (*CompositeBackend) Use

func (cb *CompositeBackend) Use(store any)

type KeyValueStore

type KeyValueStore interface {
	Put(ctx context.Context, key string, value []byte) error
	Get(ctx context.Context, key string) ([]byte, error)
	ListKeys(ctx context.Context, prefix string) ([]string, error)
}

type KeyValueStoreBroker

type KeyValueStoreBroker interface {
	KeyValueStore(namespace string) (KeyValueStore, error)
}

type KeyringStore

type KeyringStore interface {
	Put(ctx context.Context, keyring keyring.Keyring) error
	Get(ctx context.Context) (keyring.Keyring, error)
}

type KeyringStoreBroker

type KeyringStoreBroker interface {
	KeyringStore(ctx context.Context, namespace string, ref *core.Reference) (KeyringStore, error)
}

type MutatorFunc

type MutatorFunc[T any] func(T)

func NewAddCapabilityMutator

func NewAddCapabilityMutator[O core.MetadataAccessor[T], T core.Capability[T]](capability T) MutatorFunc[O]

func NewCompositeMutator

func NewCompositeMutator[T any](mutators ...MutatorFunc[T]) MutatorFunc[T]

func NewIncrementUsageCountMutator

func NewIncrementUsageCountMutator() MutatorFunc[*core.BootstrapToken]

func NewRemoveCapabilityMutator

func NewRemoveCapabilityMutator[O core.MetadataAccessor[T], T core.Capability[T]](capability T) MutatorFunc[O]

type NotFoundError

type NotFoundError struct{}

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

func (*NotFoundError) GRPCStatus

func (e *NotFoundError) GRPCStatus() *status.Status

type RBACStore

type RBACStore interface {
	CreateRole(context.Context, *core.Role) error
	DeleteRole(context.Context, *core.Reference) error
	GetRole(context.Context, *core.Reference) (*core.Role, error)
	CreateRoleBinding(context.Context, *core.RoleBinding) error
	DeleteRoleBinding(context.Context, *core.Reference) error
	GetRoleBinding(context.Context, *core.Reference) (*core.RoleBinding, error)
	ListRoles(context.Context) (*core.RoleList, error)
	ListRoleBindings(context.Context) (*core.RoleBindingList, error)
}

type SelectorPredicate

type SelectorPredicate func(*core.Cluster) bool

type SubjectAccessCapableStore

type SubjectAccessCapableStore interface {
	ListClusters(ctx context.Context, matchLabels *core.LabelSelector, matchOptions core.MatchOptions) (*core.ClusterList, error)
	GetRole(ctx context.Context, ref *core.Reference) (*core.Role, error)
	ListRoleBindings(ctx context.Context) (*core.RoleBindingList, error)
}

A store that can be used to compute subject access rules

type TokenCreateOption

type TokenCreateOption func(*TokenCreateOptions)

func WithCapabilities

func WithCapabilities(capabilities []*core.TokenCapability) TokenCreateOption

func WithLabels

func WithLabels(labels map[string]string) TokenCreateOption

type TokenCreateOptions

type TokenCreateOptions struct {
	Labels       map[string]string
	Capabilities []*core.TokenCapability
}

func NewTokenCreateOptions

func NewTokenCreateOptions() TokenCreateOptions

func (*TokenCreateOptions) Apply

func (o *TokenCreateOptions) Apply(opts ...TokenCreateOption)

type TokenMutator

type TokenMutator = MutatorFunc[*core.BootstrapToken]

type TokenStore

type TokenStore interface {
	CreateToken(ctx context.Context, ttl time.Duration, opts ...TokenCreateOption) (*core.BootstrapToken, error)
	DeleteToken(ctx context.Context, ref *core.Reference) error
	GetToken(ctx context.Context, ref *core.Reference) (*core.BootstrapToken, error)
	UpdateToken(ctx context.Context, ref *core.Reference, mutator TokenMutator) (*core.BootstrapToken, error)
	ListTokens(ctx context.Context) ([]*core.BootstrapToken, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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