Documentation
¶
Overview ¶
Snapshot repository — namespaced CRUD over types.Snapshot.
Package repos — StorageClass and Volume repositories.
Volume repository — namespaced CRUD over types.Volume.
Index ¶
- Constants
- func MakeAuditRef(namespace, name string) string
- type AuditFilter
- type AuditRepo
- type BaseRepo
- func (r *BaseRepo[T]) Core() store.Store
- func (r *BaseRepo[T]) Create(ctx context.Context, namespace, name string, obj *T) error
- func (r *BaseRepo[T]) CreateRef(ctx context.Context, ref string, obj *T) error
- func (r *BaseRepo[T]) Delete(ctx context.Context, namespace, name string) error
- func (r *BaseRepo[T]) DeleteRef(ctx context.Context, ref string) error
- func (r *BaseRepo[T]) Get(ctx context.Context, namespace, name string) (*T, error)
- func (r *BaseRepo[T]) GetHistory(ctx context.Context, ref string) ([]store.HistoricalVersion, error)
- func (r *BaseRepo[T]) GetRef(ctx context.Context, ref string) (*T, error)
- func (r *BaseRepo[T]) GetVersion(ctx context.Context, ref string, version string) (*T, error)
- func (r *BaseRepo[T]) List(ctx context.Context, namespace string) ([]*T, error)
- func (r *BaseRepo[T]) Update(ctx context.Context, namespace, name string, obj *T, ...) error
- func (r *BaseRepo[T]) UpdateRef(ctx context.Context, ref string, obj *T, opts ...store.UpdateOption) error
- func (r *BaseRepo[T]) Watch(ctx context.Context, namespace string) (<-chan store.WatchEvent, error)
- type ConfigOption
- type ConfigmapRepo
- func (r *ConfigmapRepo) Create(ctx context.Context, ref string, c *types.Configmap) error
- func (r *ConfigmapRepo) Delete(ctx context.Context, namespace, name string) error
- func (r *ConfigmapRepo) Get(ctx context.Context, namespace, name string) (*types.Configmap, error)
- func (r *ConfigmapRepo) List(ctx context.Context, namespace string) ([]*types.Configmap, error)
- func (r *ConfigmapRepo) Update(ctx context.Context, namespace, name string, c *types.Configmap, ...) error
- type InstanceOption
- type InstanceRepo
- func (r *InstanceRepo) Core() store.Store
- func (r *InstanceRepo) CountByService(ctx context.Context, namespace, serviceID string) (int, error)
- func (r *InstanceRepo) CountByStatus(ctx context.Context, namespace string, status types.InstanceStatus) (int, error)
- func (r *InstanceRepo) Create(ctx context.Context, i *types.Instance) error
- func (r *InstanceRepo) CreateRef(ctx context.Context, ref string, i *types.Instance) error
- func (r *InstanceRepo) Delete(ctx context.Context, ref string) error
- func (r *InstanceRepo) Get(ctx context.Context, ref string) (*types.Instance, error)
- func (r *InstanceRepo) GetByInstanceID(ctx context.Context, namespace, instanceID string) (*types.Instance, error)
- func (r *InstanceRepo) GetByName(ctx context.Context, namespace, name string) (*types.Instance, error)
- func (r *InstanceRepo) GetHistory(ctx context.Context, ref string) ([]store.HistoricalVersion, error)
- func (r *InstanceRepo) GetServiceInstances(ctx context.Context, serviceID string) ([]*types.Instance, error)
- func (r *InstanceRepo) GetVersion(ctx context.Context, ref string, version string) (*types.Instance, error)
- func (r *InstanceRepo) IncrementRestartCount(ctx context.Context, ref string) error
- func (r *InstanceRepo) List(ctx context.Context, namespace string) ([]*types.Instance, error)
- func (r *InstanceRepo) ListByNode(ctx context.Context, namespace, nodeID string) ([]*types.Instance, error)
- func (r *InstanceRepo) ListByService(ctx context.Context, namespace, serviceID string) ([]*types.Instance, error)
- func (r *InstanceRepo) ListByServiceName(ctx context.Context, namespace, serviceName string) ([]*types.Instance, error)
- func (r *InstanceRepo) ListByStatus(ctx context.Context, namespace string, status types.InstanceStatus) ([]*types.Instance, error)
- func (r *InstanceRepo) ListFailed(ctx context.Context, namespace string) ([]*types.Instance, error)
- func (r *InstanceRepo) ListPending(ctx context.Context, namespace string) ([]*types.Instance, error)
- func (r *InstanceRepo) ListRunning(ctx context.Context, namespace string) ([]*types.Instance, error)
- func (r *InstanceRepo) MarkForDeletion(ctx context.Context, ref string) error
- func (r *InstanceRepo) Update(ctx context.Context, ref string, i *types.Instance, opts ...store.UpdateOption) error
- func (r *InstanceRepo) UpdateContainerID(ctx context.Context, ref string, containerID string) error
- func (r *InstanceRepo) UpdateIP(ctx context.Context, ref string, ip string) error
- func (r *InstanceRepo) UpdatePID(ctx context.Context, ref string, pid int) error
- func (r *InstanceRepo) UpdateStatus(ctx context.Context, ref string, status types.InstanceStatus, ...) error
- func (r *InstanceRepo) Watch(ctx context.Context, namespace string) (<-chan store.WatchEvent, error)
- type NamespaceOption
- type NamespaceRepo
- func (r *NamespaceRepo) BootstrapDefaultNamespaces(ctx context.Context) error
- func (r *NamespaceRepo) Create(ctx context.Context, ns *types.Namespace) error
- func (r *NamespaceRepo) CreateBuiltIns(ctx context.Context, ns *types.Namespace) error
- func (r *NamespaceRepo) Delete(ctx context.Context, name string) error
- func (r *NamespaceRepo) Exists(ctx context.Context, name string) (bool, error)
- func (r *NamespaceRepo) Get(ctx context.Context, name string) (*types.Namespace, error)
- func (r *NamespaceRepo) List(ctx context.Context) ([]*types.Namespace, error)
- func (r *NamespaceRepo) Update(ctx context.Context, ns *types.Namespace) error
- func (r *NamespaceRepo) Watch(ctx context.Context) (<-chan store.WatchEvent, error)
- type PolicyRepo
- func (r *PolicyRepo) Create(ctx context.Context, p *types.Policy) error
- func (r *PolicyRepo) Delete(ctx context.Context, name string) error
- func (r *PolicyRepo) Get(ctx context.Context, name string) (*types.Policy, error)
- func (r *PolicyRepo) List(ctx context.Context) ([]types.Policy, error)
- func (r *PolicyRepo) Update(ctx context.Context, p *types.Policy) error
- type SecretOption
- type SecretRepo
- func (r *SecretRepo) Create(ctx context.Context, s *types.Secret) error
- func (r *SecretRepo) CreateRef(ctx context.Context, ref string, s *types.Secret) error
- func (r *SecretRepo) Delete(ctx context.Context, namespace, name string) error
- func (r *SecretRepo) Get(ctx context.Context, namespace, name string) (*types.Secret, error)
- func (r *SecretRepo) GetVersionN(ctx context.Context, namespace, name string, version int) (*types.Secret, error)
- func (r *SecretRepo) List(ctx context.Context, namespace string) ([]*types.Secret, error)
- func (r *SecretRepo) ListVersions(ctx context.Context, namespace, name string) ([]*types.Secret, error)
- func (r *SecretRepo) Rollback(ctx context.Context, namespace, name string, toVersion int, ...) (*types.Secret, error)
- func (r *SecretRepo) Update(ctx context.Context, namespace, name string, s *types.Secret, ...) error
- type ServiceOption
- type ServiceRepo
- func (r *ServiceRepo) Core() store.Store
- func (r *ServiceRepo) Create(ctx context.Context, s *types.Service) error
- func (r *ServiceRepo) CreateRef(ctx context.Context, ref string, s *types.Service) error
- func (r *ServiceRepo) Delete(ctx context.Context, ref string) error
- func (r *ServiceRepo) Get(ctx context.Context, ref string) (*types.Service, error)
- func (r *ServiceRepo) GetByName(ctx context.Context, namespace, name string) (*types.Service, error)
- func (r *ServiceRepo) GetByServiceID(ctx context.Context, namespace, serviceID string) (*types.Service, error)
- func (r *ServiceRepo) GetDependents(ctx context.Context, ref string) ([]*types.Service, error)
- func (r *ServiceRepo) GetHistory(ctx context.Context, ref string) ([]store.HistoricalVersion, error)
- func (r *ServiceRepo) GetVersion(ctx context.Context, ref string, version string) (*types.Service, error)
- func (r *ServiceRepo) List(ctx context.Context, namespace string) ([]*types.Service, error)
- func (r *ServiceRepo) ListByLabelSelector(ctx context.Context, namespace string, selector map[string]string) ([]*types.Service, error)
- func (r *ServiceRepo) ListByStatus(ctx context.Context, namespace string, status types.ServiceStatus) ([]*types.Service, error)
- func (r *ServiceRepo) Update(ctx context.Context, ref string, s *types.Service, opts ...store.UpdateOption) error
- func (r *ServiceRepo) UpdateScale(ctx context.Context, ref string, scale int) error
- func (r *ServiceRepo) UpdateStatus(ctx context.Context, ref string, status types.ServiceStatus) error
- func (r *ServiceRepo) UpdateStatusByName(ctx context.Context, namespace, name string, status types.ServiceStatus) error
- func (r *ServiceRepo) Watch(ctx context.Context, namespace string) (<-chan store.WatchEvent, error)
- type SnapshotRepo
- func (r *SnapshotRepo) Create(ctx context.Context, s *types.Snapshot) error
- func (r *SnapshotRepo) Delete(ctx context.Context, namespace, name string) error
- func (r *SnapshotRepo) Get(ctx context.Context, namespace, name string) (*types.Snapshot, error)
- func (r *SnapshotRepo) List(ctx context.Context, namespace string) ([]*types.Snapshot, error)
- func (r *SnapshotRepo) ListAll(ctx context.Context) ([]*types.Snapshot, error)
- func (r *SnapshotRepo) Update(ctx context.Context, s *types.Snapshot, opts ...store.UpdateOption) error
- type StorageClassRepo
- func (r *StorageClassRepo) Create(ctx context.Context, sc *types.StorageClass) error
- func (r *StorageClassRepo) Delete(ctx context.Context, name string) error
- func (r *StorageClassRepo) Get(ctx context.Context, name string) (*types.StorageClass, error)
- func (r *StorageClassRepo) List(ctx context.Context) ([]*types.StorageClass, error)
- func (r *StorageClassRepo) Update(ctx context.Context, sc *types.StorageClass, opts ...store.UpdateOption) error
- type TokenRepo
- func (r *TokenRepo) FindBySecret(ctx context.Context, secret string) (*types.Token, error)
- func (r *TokenRepo) Get(ctx context.Context, id string) (*types.Token, error)
- func (r *TokenRepo) Issue(ctx context.Context, name, subjectID, subjectType string, desc string, ...) (*types.Token, string, error)
- func (r *TokenRepo) List(ctx context.Context) ([]types.Token, error)
- func (r *TokenRepo) Revoke(ctx context.Context, id string) error
- type UserRepo
- func (r *UserRepo) Create(ctx context.Context, u *types.User) (*types.User, error)
- func (r *UserRepo) Delete(ctx context.Context, id string) error
- func (r *UserRepo) Get(ctx context.Context, id string) (*types.User, error)
- func (r *UserRepo) GetByName(ctx context.Context, name string) (*types.User, error)
- func (r *UserRepo) GetByNameOrID(ctx context.Context, nameOrID string) (*types.User, error)
- func (r *UserRepo) List(ctx context.Context) ([]*types.User, error)
- func (r *UserRepo) Update(ctx context.Context, u *types.User) error
- type VolumeRepo
- func (r *VolumeRepo) Create(ctx context.Context, v *types.Volume) error
- func (r *VolumeRepo) Delete(ctx context.Context, namespace, name string) error
- func (r *VolumeRepo) Get(ctx context.Context, namespace, name string) (*types.Volume, error)
- func (r *VolumeRepo) List(ctx context.Context, namespace string) ([]*types.Volume, error)
- func (r *VolumeRepo) ListAll(ctx context.Context) ([]*types.Volume, error)
- func (r *VolumeRepo) Update(ctx context.Context, v *types.Volume, opts ...store.UpdateOption) error
Constants ¶
const TokenSecretPrefix = "rune_"
TokenSecretPrefix is the human-visible prefix on every Rune token secret. It exists so the secrets are easy to spot in the wild (logs, screenshots, terraform output, leaked configs) and so that secret scanners (gitleaks, GitHub secret scanning, etc.) can match on a stable, distinctive marker. The prefix is mandatory: tokens presented without it are rejected at validation time.
Variables ¶
This section is empty.
Functions ¶
func MakeAuditRef ¶
MakeRef returns the canonical "<namespace>/<name>" string used as ResourceRef in audit events. Returns just the name when namespace is empty.
Types ¶
type AuditFilter ¶
type AuditFilter struct {
Resource string // exact match on Resource
ResourceRef string // exact match on ResourceRef ("ns/name")
Namespace string // exact match on Namespace
Actor string // exact match on Actor
Action string // exact match on Action
Since time.Time // events with Timestamp >= Since
Until time.Time // events with Timestamp < Until (zero = no bound)
}
AuditFilter narrows a List query. Zero-value fields are ignored.
type AuditRepo ¶
type AuditRepo struct {
// contains filtered or unexported fields
}
AuditRepo provides append-only persistence and query access for audit events.
Events are stored under the reserved namespace "system" with names of the form "<rfc3339nano-ts>-<uuid>" so that the natural list order from the underlying store is roughly chronological. The id field on the event is the authoritative identifier; the storage name is an implementation detail.
func NewAuditRepo ¶
NewAuditRepo constructs an audit repository backed by the given store.
func (*AuditRepo) Append ¶
Append persists an audit event. ID and Timestamp are populated if unset. Append never errors out the caller's request path on failure; callers should log the error and continue. Returning the error here lets callers decide.
func (*AuditRepo) List ¶
func (r *AuditRepo) List(ctx context.Context, f AuditFilter, limit int) ([]*types.AuditEvent, error)
List returns audit events matching the filter, newest first, capped at limit. A limit of 0 or less applies a default cap of 200.
type BaseRepo ¶
type BaseRepo[T any] struct { // contains filtered or unexported fields }
BaseRepo provides common CRUD over the core store for a specific resource type. T is the typed payload struct (e.g., *types.Service, *types.Secret).
func NewBaseRepo ¶
func (*BaseRepo[T]) GetHistory ¶
func (*BaseRepo[T]) GetVersion ¶
type ConfigOption ¶
type ConfigOption func(*ConfigmapRepo)
func WithConfigLimits ¶
func WithConfigLimits(limits store.Limits) ConfigOption
type ConfigmapRepo ¶
type ConfigmapRepo struct {
// contains filtered or unexported fields
}
func NewConfigRepo ¶
func NewConfigRepo(core store.Store, opts ...ConfigOption) *ConfigmapRepo
func (*ConfigmapRepo) Delete ¶
func (r *ConfigmapRepo) Delete(ctx context.Context, namespace, name string) error
type InstanceOption ¶
type InstanceOption func(*InstanceRepo)
type InstanceRepo ¶
type InstanceRepo struct {
// contains filtered or unexported fields
}
func NewInstanceRepo ¶
func NewInstanceRepo(core store.Store, opts ...InstanceOption) *InstanceRepo
func (*InstanceRepo) Core ¶
func (r *InstanceRepo) Core() store.Store
Core returns the underlying store
func (*InstanceRepo) CountByService ¶
func (r *InstanceRepo) CountByService(ctx context.Context, namespace, serviceID string) (int, error)
CountByService returns the count of instances for a specific service
func (*InstanceRepo) CountByStatus ¶
func (r *InstanceRepo) CountByStatus(ctx context.Context, namespace string, status types.InstanceStatus) (int, error)
CountByStatus returns the count of instances with a specific status
func (*InstanceRepo) GetByInstanceID ¶
func (r *InstanceRepo) GetByInstanceID(ctx context.Context, namespace, instanceID string) (*types.Instance, error)
GetByInstanceID retrieves an instance by its ID (not name)
func (*InstanceRepo) GetByName ¶
func (r *InstanceRepo) GetByName(ctx context.Context, namespace, name string) (*types.Instance, error)
GetByName retrieves an instance by name and namespace
func (*InstanceRepo) GetHistory ¶
func (r *InstanceRepo) GetHistory(ctx context.Context, ref string) ([]store.HistoricalVersion, error)
GetHistory returns version history for an instance
func (*InstanceRepo) GetServiceInstances ¶
func (r *InstanceRepo) GetServiceInstances(ctx context.Context, serviceID string) ([]*types.Instance, error)
GetServiceInstances returns all instances for a service across all namespaces
func (*InstanceRepo) GetVersion ¶
func (r *InstanceRepo) GetVersion(ctx context.Context, ref string, version string) (*types.Instance, error)
GetVersion returns a specific version of an instance
func (*InstanceRepo) IncrementRestartCount ¶
func (r *InstanceRepo) IncrementRestartCount(ctx context.Context, ref string) error
IncrementRestartCount increments the restart count for an instance
func (*InstanceRepo) ListByNode ¶
func (r *InstanceRepo) ListByNode(ctx context.Context, namespace, nodeID string) ([]*types.Instance, error)
ListByNode returns all instances running on a specific node
func (*InstanceRepo) ListByService ¶
func (r *InstanceRepo) ListByService(ctx context.Context, namespace, serviceID string) ([]*types.Instance, error)
ListByService returns all instances belonging to a specific service
func (*InstanceRepo) ListByServiceName ¶
func (r *InstanceRepo) ListByServiceName(ctx context.Context, namespace, serviceName string) ([]*types.Instance, error)
ListByServiceName returns all instances belonging to a service by name
func (*InstanceRepo) ListByStatus ¶
func (r *InstanceRepo) ListByStatus(ctx context.Context, namespace string, status types.InstanceStatus) ([]*types.Instance, error)
ListByStatus returns instances with the given status
func (*InstanceRepo) ListFailed ¶
ListFailed returns all failed instances in a namespace
func (*InstanceRepo) ListPending ¶
func (r *InstanceRepo) ListPending(ctx context.Context, namespace string) ([]*types.Instance, error)
ListPending returns all pending instances in a namespace
func (*InstanceRepo) ListRunning ¶
func (r *InstanceRepo) ListRunning(ctx context.Context, namespace string) ([]*types.Instance, error)
ListRunning returns all running instances in a namespace
func (*InstanceRepo) MarkForDeletion ¶
func (r *InstanceRepo) MarkForDeletion(ctx context.Context, ref string) error
MarkForDeletion marks an instance for deletion
func (*InstanceRepo) Update ¶
func (r *InstanceRepo) Update(ctx context.Context, ref string, i *types.Instance, opts ...store.UpdateOption) error
func (*InstanceRepo) UpdateContainerID ¶
UpdateContainerID updates only the container ID of an instance
func (*InstanceRepo) UpdateStatus ¶
func (r *InstanceRepo) UpdateStatus(ctx context.Context, ref string, status types.InstanceStatus, statusMessage string) error
UpdateStatus updates only the status of an instance
func (*InstanceRepo) Watch ¶
func (r *InstanceRepo) Watch(ctx context.Context, namespace string) (<-chan store.WatchEvent, error)
Watch proxies to the base store
type NamespaceOption ¶
type NamespaceOption func(*NamespaceRepo)
type NamespaceRepo ¶
type NamespaceRepo struct {
// contains filtered or unexported fields
}
func NewNamespaceRepo ¶
func NewNamespaceRepo(core store.Store, opts ...NamespaceOption) *NamespaceRepo
func (*NamespaceRepo) BootstrapDefaultNamespaces ¶
func (r *NamespaceRepo) BootstrapDefaultNamespaces(ctx context.Context) error
BootstrapDefaultNamespaces creates the default and system namespaces if they don't exist
func (*NamespaceRepo) CreateBuiltIns ¶
CreateBuiltIns creates a new namespace
func (*NamespaceRepo) Delete ¶
func (r *NamespaceRepo) Delete(ctx context.Context, name string) error
Delete removes a namespace
func (*NamespaceRepo) Watch ¶
func (r *NamespaceRepo) Watch(ctx context.Context) (<-chan store.WatchEvent, error)
Watch watches for namespace changes
type PolicyRepo ¶
type PolicyRepo struct {
// contains filtered or unexported fields
}
func NewPolicyRepo ¶
func NewPolicyRepo(st store.Store) *PolicyRepo
type SecretOption ¶
type SecretOption func(*SecretRepo)
func WithKEKBytes ¶
func WithKEKBytes(key []byte) SecretOption
func WithKEKOptions ¶
func WithKEKOptions(opts *crypto.KEKOptions) SecretOption
func WithSecretLimits ¶
func WithSecretLimits(limits store.Limits) SecretOption
type SecretRepo ¶
type SecretRepo struct {
// contains filtered or unexported fields
}
func NewSecretRepo ¶
func NewSecretRepo(core store.Store, opts ...SecretOption) *SecretRepo
func (*SecretRepo) Delete ¶
func (r *SecretRepo) Delete(ctx context.Context, namespace, name string) error
func (*SecretRepo) GetVersionN ¶
func (r *SecretRepo) GetVersionN(ctx context.Context, namespace, name string, version int) (*types.Secret, error)
GetVersionN returns a specific historical version of a secret. The version numbers are the monotonically-increasing user-facing integers carried on types.Secret.Version, NOT the opaque store version IDs.
func (*SecretRepo) ListVersions ¶
func (r *SecretRepo) ListVersions(ctx context.Context, namespace, name string) ([]*types.Secret, error)
ListVersions returns every historical version of a secret, decrypted, in descending Version order. Useful for `rune secret versions`.
The underlying store keeps every Update as a distinct version row so this includes plaintext data for each one — callers must therefore gate access behind the secrets:reveal verb if they expose Data downstream.
func (*SecretRepo) Rollback ¶
func (r *SecretRepo) Rollback(ctx context.Context, namespace, name string, toVersion int, opts ...store.UpdateOption) (*types.Secret, error)
Rollback rewrites the secret to the contents of a prior version, producing a NEW version (head+1). The old versions are retained in history. Returns the freshly-written secret on success.
type ServiceOption ¶
type ServiceOption func(*ServiceRepo)
type ServiceRepo ¶
type ServiceRepo struct {
// contains filtered or unexported fields
}
func NewServiceRepo ¶
func NewServiceRepo(core store.Store, opts ...ServiceOption) *ServiceRepo
func (*ServiceRepo) Core ¶
func (r *ServiceRepo) Core() store.Store
Core returns the underlying store
func (*ServiceRepo) GetByName ¶
func (r *ServiceRepo) GetByName(ctx context.Context, namespace, name string) (*types.Service, error)
GetByName retrieves a service by name and namespace
func (*ServiceRepo) GetByServiceID ¶
func (r *ServiceRepo) GetByServiceID(ctx context.Context, namespace, serviceID string) (*types.Service, error)
GetByServiceID retrieves a service by its ID (not name)
func (*ServiceRepo) GetDependents ¶
GetDependents returns all services that depend on the given service
func (*ServiceRepo) GetHistory ¶
func (r *ServiceRepo) GetHistory(ctx context.Context, ref string) ([]store.HistoricalVersion, error)
GetHistory returns version history for a service
func (*ServiceRepo) GetVersion ¶
func (r *ServiceRepo) GetVersion(ctx context.Context, ref string, version string) (*types.Service, error)
GetVersion returns a specific version of a service
func (*ServiceRepo) ListByLabelSelector ¶
func (r *ServiceRepo) ListByLabelSelector(ctx context.Context, namespace string, selector map[string]string) ([]*types.Service, error)
ListByLabelSelector returns services matching the given label selector
func (*ServiceRepo) ListByStatus ¶
func (r *ServiceRepo) ListByStatus(ctx context.Context, namespace string, status types.ServiceStatus) ([]*types.Service, error)
ListByStatus returns services with the given status
func (*ServiceRepo) Update ¶
func (r *ServiceRepo) Update(ctx context.Context, ref string, s *types.Service, opts ...store.UpdateOption) error
func (*ServiceRepo) UpdateScale ¶
UpdateScale updates only the scale of a service
func (*ServiceRepo) UpdateStatus ¶
func (r *ServiceRepo) UpdateStatus(ctx context.Context, ref string, status types.ServiceStatus) error
UpdateStatus updates only the status of a service
func (*ServiceRepo) UpdateStatusByName ¶
func (r *ServiceRepo) UpdateStatusByName(ctx context.Context, namespace, name string, status types.ServiceStatus) error
UpdateStatusByName updates only the status of a service by name and namespace
func (*ServiceRepo) Watch ¶
func (r *ServiceRepo) Watch(ctx context.Context, namespace string) (<-chan store.WatchEvent, error)
Watch proxies to the base store
type SnapshotRepo ¶
type SnapshotRepo struct {
// contains filtered or unexported fields
}
SnapshotRepo provides CRUD over Snapshot resources.
func NewSnapshotRepo ¶
func NewSnapshotRepo(core store.Store) *SnapshotRepo
NewSnapshotRepo constructs a SnapshotRepo.
func (*SnapshotRepo) Create ¶
Create writes a new Snapshot row, populating ID, timestamps, and a default Pending phase if the caller did not supply one.
func (*SnapshotRepo) Delete ¶
func (r *SnapshotRepo) Delete(ctx context.Context, namespace, name string) error
Delete removes a Snapshot row. The orchestrator's SnapshotController watches for the resulting DELETED event and runs the per-driver reclaim path.
func (*SnapshotRepo) ListAll ¶
ListAll returns every Snapshot across every namespace. Mirrors VolumeRepo.ListAll: enumerates via NamespaceRepo + per-namespace List so it works on backends that don't support cross-namespace listing.
func (*SnapshotRepo) Update ¶
func (r *SnapshotRepo) Update(ctx context.Context, s *types.Snapshot, opts ...store.UpdateOption) error
Update writes an updated Snapshot, preserving CreatedAt/ID and refreshing UpdatedAt.
type StorageClassRepo ¶
type StorageClassRepo struct {
// contains filtered or unexported fields
}
StorageClassRepo provides CRUD over StorageClass resources.
func NewStorageClassRepo ¶
func NewStorageClassRepo(core store.Store) *StorageClassRepo
NewStorageClassRepo constructs a StorageClassRepo.
func (*StorageClassRepo) Create ¶
func (r *StorageClassRepo) Create(ctx context.Context, sc *types.StorageClass) error
Create writes a new StorageClass row, populating ID and timestamps.
func (*StorageClassRepo) Delete ¶
func (r *StorageClassRepo) Delete(ctx context.Context, name string) error
Delete removes a StorageClass.
func (*StorageClassRepo) Get ¶
func (r *StorageClassRepo) Get(ctx context.Context, name string) (*types.StorageClass, error)
Get retrieves a StorageClass by name.
func (*StorageClassRepo) List ¶
func (r *StorageClassRepo) List(ctx context.Context) ([]*types.StorageClass, error)
List returns every StorageClass.
func (*StorageClassRepo) Update ¶
func (r *StorageClassRepo) Update(ctx context.Context, sc *types.StorageClass, opts ...store.UpdateOption) error
Update writes an updated StorageClass, refreshing UpdatedAt and preserving CreatedAt from the existing row.
type TokenRepo ¶
type TokenRepo struct {
// contains filtered or unexported fields
}
func NewTokenRepo ¶
func (*TokenRepo) FindBySecret ¶
FindBySecret tries to locate and validate a token by comparing the hash.
type UserRepo ¶
type UserRepo struct {
// contains filtered or unexported fields
}
func NewUserRepo ¶
func (*UserRepo) GetByNameOrID ¶
type VolumeRepo ¶
type VolumeRepo struct {
// contains filtered or unexported fields
}
VolumeRepo provides CRUD over Volume resources.
func NewVolumeRepo ¶
func NewVolumeRepo(core store.Store) *VolumeRepo
NewVolumeRepo constructs a VolumeRepo.
func (*VolumeRepo) Create ¶
Create writes a new Volume row, populating ID, timestamps, and a default Pending status if the caller did not supply one.
func (*VolumeRepo) Delete ¶
func (r *VolumeRepo) Delete(ctx context.Context, namespace, name string) error
Delete removes a Volume row. The orchestrator's VolumeController watches for the resulting DELETED event and runs the per-driver reclaim path.
func (*VolumeRepo) ListAll ¶
ListAll returns every Volume across every namespace. This is the cross-namespace projection used by cluster-scoped operations like the StorageClass cascade-delete safety check.
We deliberately enumerate via NamespaceRepo + per-namespace List rather than the underlying store.ListAll, because the in-memory test stores do not implement true cross-namespace listing — they treat the empty namespace as a literal key. Going through the namespace list keeps this correct on every backend.
func (*VolumeRepo) Update ¶
func (r *VolumeRepo) Update(ctx context.Context, v *types.Volume, opts ...store.UpdateOption) error
Update writes an updated Volume, preserving CreatedAt/ID and refreshing UpdatedAt.