Documentation
¶
Index ¶
- Constants
- 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) List(ctx context.Context, namespace string) ([]*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 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
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 ¶
This section is empty.
Types ¶
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
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 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
}