Documentation
¶
Index ¶
- Constants
- type ContainerState
- type DB
- func (d *DB) ClearAllControllerVolumeMounts() error
- func (d *DB) ClearControllerMicroserviceRuntimeFields() error
- func (d *DB) ClearControllerMicroservices() error
- func (d *DB) ClearControllerRegistries() error
- func (d *DB) ClearLocalRuntimeClasses() error
- func (d *DB) ClearLocalWorkloadRuntimeFields() error
- func (d *DB) ClearLocalWorkloads() error
- func (d *DB) ClearRuntimeContainerRefs(scope string) error
- func (d *DB) ClearServiceAccountTokens() error
- func (d *DB) Close() error
- func (d *DB) Conn() *sql.DB
- func (d *DB) DeleteAgentPrivateKey() error
- func (d *DB) DeleteControllerVolumeMount(uuid string) error
- func (d *DB) DeleteEdgeGuardSignature() error
- func (d *DB) DeleteLocalRegistry(id int) error
- func (d *DB) DeleteLocalRuntimeClass(name string) error
- func (d *DB) DeleteLocalWorkload(id string) error
- func (d *DB) DeleteRuntimeContainerRef(msUUID, scope string) error
- func (d *DB) DeleteSystemControlPlane() error
- func (d *DB) EnsureDefaultControllerRegistries() error
- func (d *DB) EnsureDefaultLocalRegistries() error
- func (d *DB) FindLocalWorkloadsByAppAndName(application, name string) ([]*models.LocalDeployedMicroservice, error)
- func (d *DB) GetAgentPrivateKey() (privateKeyB64 string, found bool, err error)
- func (d *DB) GetControllerVolumeMountByUUID(uuid string) (*VolumeMountRecord, error)
- func (d *DB) GetEdgeGuardSignature() (signature string, found bool, err error)
- func (d *DB) GetLocalRegistry(id int) (*models.Registry, error)
- func (d *DB) GetLocalRuntimeClass(name string) (*models.LocalRuntimeClass, error)
- func (d *DB) GetLocalWorkload(id string) (*models.LocalDeployedMicroservice, error)
- func (d *DB) GetRuntimeContainerRef(msUUID, scope string) (*ContainerState, error)
- func (d *DB) GetSystemControlPlane() (*models.ControlPlaneDeployment, bool, error)
- func (d *DB) ListActiveServiceAccountTokens() ([]*models.ServiceAccountToken, error)
- func (d *DB) ListLocalRuntimeClasses() ([]*models.LocalRuntimeClass, error)
- func (d *DB) ListLocalWorkloads() ([]*models.LocalDeployedMicroservice, error)
- func (d *DB) ListServiceAccountTokens() ([]*models.ServiceAccountToken, error)
- func (d *DB) LoadAllControllerVolumeMounts() ([]VolumeMountRecord, error)
- func (d *DB) LoadControllerMicroservices() ([]*models.Microservice, error)
- func (d *DB) LoadControllerRegistries() ([]*models.Registry, error)
- func (d *DB) LoadLocalRegistries() ([]*models.Registry, error)
- func (d *DB) Open(dir string) error
- func (d *DB) ReplaceAllControllerVolumeMounts(records []VolumeMountRecord) error
- func (d *DB) RevokeAllServiceAccountTokens(revokedAtSec int64) error
- func (d *DB) RevokeServiceAccountToken(jti string, revokedAtSec int64) error
- func (d *DB) SaveControllerMicroservices(microservices []*models.Microservice) error
- func (d *DB) SaveControllerRegistries(registries []*models.Registry) error
- func (d *DB) UpsertAgentPrivateKey(privateKeyB64 string) error
- func (d *DB) UpsertControllerRegistry(reg *models.Registry) error
- func (d *DB) UpsertControllerVolumeMount(rec VolumeMountRecord) error
- func (d *DB) UpsertEdgeGuardSignature(jwt string) error
- func (d *DB) UpsertLocalRegistry(reg *models.Registry) error
- func (d *DB) UpsertLocalRuntimeClass(rc *models.LocalRuntimeClass) error
- func (d *DB) UpsertLocalWorkload(ms *models.LocalDeployedMicroservice) error
- func (d *DB) UpsertRuntimeContainerRef(msUUID, scope, workloadID, sandboxID string) error
- func (d *DB) UpsertServiceAccountToken(token *models.ServiceAccountToken) error
- func (d *DB) UpsertSystemControlPlane(dep *models.ControlPlaneDeployment) error
- type VolumeMountRecord
Constants ¶
const ( RuntimeScopeController = "controller" RuntimeScopeLocal = "local" )
Runtime container ref scopes stored in runtime_container_refs.scope.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContainerState ¶
ContainerState holds workload and sandbox container IDs for a microservice at a scope.
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB wraps the SQLite database connection
func (*DB) ClearAllControllerVolumeMounts ¶
ClearAllControllerVolumeMounts removes all controller volume mount rows (used on deprovision).
func (*DB) ClearControllerMicroserviceRuntimeFields ¶
ClearControllerMicroserviceRuntimeFields clears ephemeral runtime columns while keeping spec rows.
func (*DB) ClearControllerMicroservices ¶
ClearControllerMicroservices removes all controller microservice rows (used on deprovision).
func (*DB) ClearControllerRegistries ¶
ClearControllerRegistries removes all controller registry rows (used on deprovision).
func (*DB) ClearLocalRuntimeClasses ¶
ClearLocalRuntimeClasses removes all RuntimeClass rows.
func (*DB) ClearLocalWorkloadRuntimeFields ¶
ClearLocalWorkloadRuntimeFields clears runtime tracking on local workload rows.
func (*DB) ClearLocalWorkloads ¶
ClearLocalWorkloads removes all local workload records.
func (*DB) ClearRuntimeContainerRefs ¶
ClearRuntimeContainerRefs removes runtime container ref rows. When scope is non-empty, only rows matching that scope are deleted.
func (*DB) ClearServiceAccountTokens ¶
ClearServiceAccountTokens removes all token metadata rows.
func (*DB) Close ¶
Close checkpoints the WAL (TRUNCATE) then closes the connection. Production path: internal/supervisor.(*Supervisor).Stop() calls store.GetInstance().Close() last.
func (*DB) DeleteAgentPrivateKey ¶
DeleteAgentPrivateKey removes the provisioned private key payload.
func (*DB) DeleteControllerVolumeMount ¶
DeleteControllerVolumeMount removes a controller volume mount record by UUID.
func (*DB) DeleteEdgeGuardSignature ¶
DeleteEdgeGuardSignature removes the stored edgeguard signature JWT.
func (*DB) DeleteLocalRegistry ¶
DeleteLocalRegistry deletes a local registry by ID.
func (*DB) DeleteLocalRuntimeClass ¶
DeleteLocalRuntimeClass deletes one RuntimeClass by name.
func (*DB) DeleteLocalWorkload ¶
DeleteLocalWorkload removes a local workload record by id.
func (*DB) DeleteRuntimeContainerRef ¶
DeleteRuntimeContainerRef removes the runtime container ref for msUUID at scope.
func (*DB) DeleteSystemControlPlane ¶
DeleteSystemControlPlane removes the singleton system control plane row.
func (*DB) EnsureDefaultControllerRegistries ¶
EnsureDefaultControllerRegistries ensures docker.io and from_cache defaults exist.
func (*DB) EnsureDefaultLocalRegistries ¶
EnsureDefaultLocalRegistries ensures default public registries exist in local table.
func (*DB) FindLocalWorkloadsByAppAndName ¶
func (d *DB) FindLocalWorkloadsByAppAndName(application, name string) ([]*models.LocalDeployedMicroservice, error)
FindLocalWorkloadsByAppAndName finds local workloads by app/name.
func (*DB) GetAgentPrivateKey ¶
GetAgentPrivateKey reads the provisioned private key payload (base64 JWK). Returns found=false when there is no stored key.
func (*DB) GetControllerVolumeMountByUUID ¶
func (d *DB) GetControllerVolumeMountByUUID(uuid string) (*VolumeMountRecord, error)
GetControllerVolumeMountByUUID retrieves a single controller volume mount record by UUID.
func (*DB) GetEdgeGuardSignature ¶
GetEdgeGuardSignature reads the current edgeguard hardware signature JWT. Returns found=false when there is no stored signature.
func (*DB) GetLocalRegistry ¶
GetLocalRegistry gets one local registry by ID.
func (*DB) GetLocalRuntimeClass ¶
func (d *DB) GetLocalRuntimeClass(name string) (*models.LocalRuntimeClass, error)
GetLocalRuntimeClass returns one RuntimeClass by name.
func (*DB) GetLocalWorkload ¶
func (d *DB) GetLocalWorkload(id string) (*models.LocalDeployedMicroservice, error)
GetLocalWorkload retrieves one local workload record by id.
func (*DB) GetRuntimeContainerRef ¶
func (d *DB) GetRuntimeContainerRef(msUUID, scope string) (*ContainerState, error)
GetRuntimeContainerRef returns the runtime container ref for msUUID at scope. Returns nil if not found or DB not opened.
func (*DB) GetSystemControlPlane ¶
func (d *DB) GetSystemControlPlane() (*models.ControlPlaneDeployment, bool, error)
GetSystemControlPlane reads the singleton system control plane row. Returns found=false when no deployment is stored.
func (*DB) ListActiveServiceAccountTokens ¶
func (d *DB) ListActiveServiceAccountTokens() ([]*models.ServiceAccountToken, error)
ListActiveServiceAccountTokens lists non-revoked token metadata.
func (*DB) ListLocalRuntimeClasses ¶
func (d *DB) ListLocalRuntimeClasses() ([]*models.LocalRuntimeClass, error)
ListLocalRuntimeClasses returns all RuntimeClass rows ordered by name.
func (*DB) ListLocalWorkloads ¶
func (d *DB) ListLocalWorkloads() ([]*models.LocalDeployedMicroservice, error)
ListLocalWorkloads returns all local workload records.
func (*DB) ListServiceAccountTokens ¶
func (d *DB) ListServiceAccountTokens() ([]*models.ServiceAccountToken, error)
ListServiceAccountTokens lists token metadata.
func (*DB) LoadAllControllerVolumeMounts ¶
func (d *DB) LoadAllControllerVolumeMounts() ([]VolumeMountRecord, error)
LoadAllControllerVolumeMounts retrieves all controller volume mount records.
func (*DB) LoadControllerMicroservices ¶
func (d *DB) LoadControllerMicroservices() ([]*models.Microservice, error)
LoadControllerMicroservices retrieves all controller microservices ordered by uuid.
func (*DB) LoadControllerRegistries ¶
LoadControllerRegistries retrieves all controller registries ordered by id.
func (*DB) LoadLocalRegistries ¶
LoadLocalRegistries retrieves all local registries ordered by id.
func (*DB) Open ¶
Open opens (or creates) the SQLite database at the given directory and runs migrations
func (*DB) ReplaceAllControllerVolumeMounts ¶
func (d *DB) ReplaceAllControllerVolumeMounts(records []VolumeMountRecord) error
ReplaceAllControllerVolumeMounts atomically replaces all controller volume mount rows. Used by the volume mount manager's full-save on every write.
func (*DB) RevokeAllServiceAccountTokens ¶
RevokeAllServiceAccountTokens marks all tokens revoked.
func (*DB) RevokeServiceAccountToken ¶
RevokeServiceAccountToken revokes a token by JTI.
func (*DB) SaveControllerMicroservices ¶
func (d *DB) SaveControllerMicroservices(microservices []*models.Microservice) error
SaveControllerMicroservices replaces all controller microservice rows in a single transaction.
func (*DB) SaveControllerRegistries ¶
SaveControllerRegistries replaces all controller registry rows in a single transaction.
func (*DB) UpsertAgentPrivateKey ¶
UpsertAgentPrivateKey stores the provisioned private key payload (base64 JWK).
func (*DB) UpsertControllerRegistry ¶
UpsertControllerRegistry inserts or updates one controller registry row.
func (*DB) UpsertControllerVolumeMount ¶
func (d *DB) UpsertControllerVolumeMount(rec VolumeMountRecord) error
UpsertControllerVolumeMount inserts or replaces a controller volume mount record.
func (*DB) UpsertEdgeGuardSignature ¶
UpsertEdgeGuardSignature stores the current edgeguard hardware signature JWT.
func (*DB) UpsertLocalRegistry ¶
UpsertLocalRegistry inserts or updates one local registry row.
func (*DB) UpsertLocalRuntimeClass ¶
func (d *DB) UpsertLocalRuntimeClass(rc *models.LocalRuntimeClass) error
UpsertLocalRuntimeClass inserts or updates one RuntimeClass row.
func (*DB) UpsertLocalWorkload ¶
func (d *DB) UpsertLocalWorkload(ms *models.LocalDeployedMicroservice) error
UpsertLocalWorkload upserts a local workload record.
func (*DB) UpsertRuntimeContainerRef ¶
UpsertRuntimeContainerRef upserts a runtime container ref row.
func (*DB) UpsertServiceAccountToken ¶
func (d *DB) UpsertServiceAccountToken(token *models.ServiceAccountToken) error
UpsertServiceAccountToken upserts token metadata.
func (*DB) UpsertSystemControlPlane ¶
func (d *DB) UpsertSystemControlPlane(dep *models.ControlPlaneDeployment) error
UpsertSystemControlPlane stores the singleton system control plane row.
type VolumeMountRecord ¶
type VolumeMountRecord struct {
UUID string
Name string
Version float64
Kind string // "SECRET" or "CONFIGMAP"
Checksum string
Microservices []string // stored as JSON TEXT array
Data map[string]any // stored as JSON TEXT (key->base64 pairs)
UpdatedAt int64
}
VolumeMountRecord represents a single volume mount index entry. UUID, Name, Version, Kind, Checksum are real typed columns. Microservices and Data are JSON-serialized TEXT columns.