Documentation
¶
Index ¶
- type BootstrapCoreRepository
- func (r *BootstrapCoreRepository) LoadBootstrapCore() (bootstrap.BootstrapCoreState, error)
- func (r *BootstrapCoreRepository) Migrations() []Migration
- func (r *BootstrapCoreRepository) Reload(ctx context.Context) error
- func (r *BootstrapCoreRepository) SaveBootstrapCore(state bootstrap.BootstrapCoreState) error
- type CookbookArtifactBundle
- type CookbookArtifactFileRecord
- type CookbookArtifactRecord
- type CookbookOrganizationRecord
- type CookbookRepository
- func (r *CookbookRepository) DecodeCookbookArtifact(bundle CookbookArtifactBundle) (bootstrap.CookbookArtifact, error)
- func (r *CookbookRepository) DecodeCookbookVersion(bundle CookbookVersionBundle) (bootstrap.CookbookVersion, error)
- func (r *CookbookRepository) EncodeCookbookArtifact(orgName string, artifact bootstrap.CookbookArtifact) (CookbookArtifactBundle, error)
- func (r *CookbookRepository) EncodeCookbookVersion(orgName string, version bootstrap.CookbookVersion) (CookbookVersionBundle, error)
- func (r *CookbookRepository) Migrations() []Migration
- func (r *CookbookRepository) OrganizationRecords() []CookbookOrganizationRecord
- func (r *CookbookRepository) Reload(ctx context.Context) error
- type CookbookVersionBundle
- type CookbookVersionFileRecord
- type CookbookVersionRecord
- type CoreDataBagItemRecord
- type CoreObjectACLRecord
- type CoreObjectJSONRecord
- type CoreObjectRepository
- func (r *CoreObjectRepository) DecodeCoreObjects(rows CoreObjectRows) (bootstrap.CoreObjectState, error)
- func (r *CoreObjectRepository) EncodeCoreObjects(state bootstrap.CoreObjectState) (CoreObjectRows, error)
- func (r *CoreObjectRepository) LoadCoreObjects() (bootstrap.CoreObjectState, error)
- func (r *CoreObjectRepository) Migrations() []Migration
- func (r *CoreObjectRepository) Reload(ctx context.Context) error
- func (r *CoreObjectRepository) SaveCoreObjects(state bootstrap.CoreObjectState) error
- type CoreObjectRows
- type CorePolicyRevisionRecord
- type CoreSandboxChecksumRecord
- type CoreSandboxRecord
- type MaintenanceRepository
- func (r *MaintenanceRepository) Check(ctx context.Context) (maintenance.CheckResult, error)
- func (r *MaintenanceRepository) Disable(ctx context.Context, input maintenance.DisableInput) (maintenance.State, error)
- func (r *MaintenanceRepository) Enable(ctx context.Context, input maintenance.EnableInput) (maintenance.State, error)
- func (r *MaintenanceRepository) Migrations() []Migration
- func (r *MaintenanceRepository) Read(ctx context.Context) (maintenance.State, error)
- type Migration
- type Status
- type Store
- func (s *Store) ActivateCookbookPersistence(ctx context.Context) error
- func (s *Store) ActivateCookbookPersistenceWithDB(ctx context.Context, db *sql.DB) error
- func (s *Store) BootstrapCore() *BootstrapCoreRepository
- func (s *Store) BootstrapCorePersistenceActive() bool
- func (s *Store) Close() error
- func (s *Store) Configured() bool
- func (s *Store) CookbookPersistenceActive() bool
- func (s *Store) CookbookStore() bootstrap.CookbookStore
- func (s *Store) Cookbooks() *CookbookRepository
- func (s *Store) CoreObjectPersistenceActive() bool
- func (s *Store) CoreObjects() *CoreObjectRepository
- func (s *Store) Maintenance() *MaintenanceRepository
- func (s *Store) MaintenancePersistenceActive() bool
- func (s *Store) Name() string
- func (s *Store) ReloadPersistence(ctx context.Context) error
- func (s *Store) Status() Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BootstrapCoreRepository ¶
type BootstrapCoreRepository struct {
// contains filtered or unexported fields
}
func (*BootstrapCoreRepository) LoadBootstrapCore ¶
func (r *BootstrapCoreRepository) LoadBootstrapCore() (bootstrap.BootstrapCoreState, error)
func (*BootstrapCoreRepository) Migrations ¶
func (r *BootstrapCoreRepository) Migrations() []Migration
func (*BootstrapCoreRepository) Reload ¶ added in v0.2.0
func (r *BootstrapCoreRepository) Reload(ctx context.Context) error
Reload refreshes the repository snapshot from PostgreSQL without emitting write-side effects. Future online repair flows call this before rehydrating live service caches after direct database mutations.
func (*BootstrapCoreRepository) SaveBootstrapCore ¶
func (r *BootstrapCoreRepository) SaveBootstrapCore(state bootstrap.BootstrapCoreState) error
type CookbookArtifactBundle ¶
type CookbookArtifactBundle struct {
Artifact CookbookArtifactRecord
Files []CookbookArtifactFileRecord
}
type CookbookArtifactRecord ¶
type CookbookRepository ¶
type CookbookRepository struct {
// contains filtered or unexported fields
}
func (*CookbookRepository) DecodeCookbookArtifact ¶
func (r *CookbookRepository) DecodeCookbookArtifact(bundle CookbookArtifactBundle) (bootstrap.CookbookArtifact, error)
func (*CookbookRepository) DecodeCookbookVersion ¶
func (r *CookbookRepository) DecodeCookbookVersion(bundle CookbookVersionBundle) (bootstrap.CookbookVersion, error)
func (*CookbookRepository) EncodeCookbookArtifact ¶
func (r *CookbookRepository) EncodeCookbookArtifact(orgName string, artifact bootstrap.CookbookArtifact) (CookbookArtifactBundle, error)
func (*CookbookRepository) EncodeCookbookVersion ¶
func (r *CookbookRepository) EncodeCookbookVersion(orgName string, version bootstrap.CookbookVersion) (CookbookVersionBundle, error)
func (*CookbookRepository) Migrations ¶
func (r *CookbookRepository) Migrations() []Migration
func (*CookbookRepository) OrganizationRecords ¶
func (r *CookbookRepository) OrganizationRecords() []CookbookOrganizationRecord
func (*CookbookRepository) Reload ¶ added in v0.2.0
func (r *CookbookRepository) Reload(ctx context.Context) error
Reload refreshes the in-process cookbook repository snapshot from PostgreSQL. This is the cookbook-side cache invalidation seam needed before any direct database repair can safely become online.
type CookbookVersionBundle ¶
type CookbookVersionBundle struct {
Version CookbookVersionRecord
Files []CookbookVersionFileRecord
}
type CookbookVersionRecord ¶
type CookbookVersionRecord struct {
Organization string
CookbookName string
Version string
FullName string
JSONClass string
ChefType string
Frozen bool
MetadataJSON []byte
}
func (CookbookVersionRecord) CookbookType ¶
func (r CookbookVersionRecord) CookbookType() string
type CoreDataBagItemRecord ¶
type CoreObjectACLRecord ¶
type CoreObjectJSONRecord ¶
type CoreObjectRepository ¶
type CoreObjectRepository struct {
// contains filtered or unexported fields
}
func (*CoreObjectRepository) DecodeCoreObjects ¶
func (r *CoreObjectRepository) DecodeCoreObjects(rows CoreObjectRows) (bootstrap.CoreObjectState, error)
func (*CoreObjectRepository) EncodeCoreObjects ¶
func (r *CoreObjectRepository) EncodeCoreObjects(state bootstrap.CoreObjectState) (CoreObjectRows, error)
func (*CoreObjectRepository) LoadCoreObjects ¶
func (r *CoreObjectRepository) LoadCoreObjects() (bootstrap.CoreObjectState, error)
func (*CoreObjectRepository) Migrations ¶
func (r *CoreObjectRepository) Migrations() []Migration
func (*CoreObjectRepository) Reload ¶ added in v0.2.0
func (r *CoreObjectRepository) Reload(ctx context.Context) error
Reload refreshes the repository snapshot from PostgreSQL without indexing or write-path side effects. Live services can use it before reloading their in-memory core object maps after a controlled direct repair.
func (*CoreObjectRepository) SaveCoreObjects ¶
func (r *CoreObjectRepository) SaveCoreObjects(state bootstrap.CoreObjectState) error
type CoreObjectRows ¶
type CoreObjectRows struct {
Environments []CoreObjectJSONRecord
Nodes []CoreObjectJSONRecord
Roles []CoreObjectJSONRecord
DataBags []CoreObjectJSONRecord
DataBagItems []CoreDataBagItemRecord
PolicyRevisions []CorePolicyRevisionRecord
PolicyGroups []CoreObjectJSONRecord
Sandboxes []CoreSandboxRecord
SandboxChecksums []CoreSandboxChecksumRecord
ACLs []CoreObjectACLRecord
}
type CoreSandboxRecord ¶
type MaintenanceRepository ¶ added in v0.2.0
type MaintenanceRepository struct {
// contains filtered or unexported fields
}
func (*MaintenanceRepository) Check ¶ added in v0.2.0
func (r *MaintenanceRepository) Check(ctx context.Context) (maintenance.CheckResult, error)
Check evaluates whether the persisted maintenance state should currently block writes while preserving expired state for truthful diagnostics.
func (*MaintenanceRepository) Disable ¶ added in v0.2.0
func (r *MaintenanceRepository) Disable(ctx context.Context, input maintenance.DisableInput) (maintenance.State, error)
Disable clears the singleton active maintenance row. The operation is idempotent so cleanup can be retried safely after interrupted admin flows.
func (*MaintenanceRepository) Enable ¶ added in v0.2.0
func (r *MaintenanceRepository) Enable(ctx context.Context, input maintenance.EnableInput) (maintenance.State, error)
Enable normalizes and persists an active maintenance window. Active PostgreSQL repositories upsert the singleton row so repeated enable commands are deterministic and cross-process visible.
func (*MaintenanceRepository) Migrations ¶ added in v0.2.0
func (r *MaintenanceRepository) Migrations() []Migration
Migrations exposes the maintenance schema migration for startup activation and migration-exposure tests.
func (*MaintenanceRepository) Read ¶ added in v0.2.0
func (r *MaintenanceRepository) Read(ctx context.Context) (maintenance.State, error)
Read returns the current maintenance state. Once activated, it reads through PostgreSQL on every call so sibling OpenCook processes observe the same gate.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) ActivateCookbookPersistence ¶
func (*Store) ActivateCookbookPersistenceWithDB ¶
ActivateCookbookPersistenceWithDB activates all PostgreSQL-backed persistence repositories on an existing connection. The historical name remains because callers already use it as the app-wide PostgreSQL activation seam.
func (*Store) BootstrapCore ¶
func (s *Store) BootstrapCore() *BootstrapCoreRepository
func (*Store) BootstrapCorePersistenceActive ¶
func (*Store) Configured ¶
func (*Store) CookbookPersistenceActive ¶
func (*Store) CookbookStore ¶
func (s *Store) CookbookStore() bootstrap.CookbookStore
func (*Store) Cookbooks ¶
func (s *Store) Cookbooks() *CookbookRepository
func (*Store) CoreObjectPersistenceActive ¶
func (*Store) CoreObjects ¶
func (s *Store) CoreObjects() *CoreObjectRepository
func (*Store) Maintenance ¶ added in v0.2.0
func (s *Store) Maintenance() *MaintenanceRepository
Maintenance returns the repository used for operator-visible maintenance state. It is process-local before activation and PostgreSQL-backed after the parent store activates persistence.
func (*Store) MaintenancePersistenceActive ¶ added in v0.2.0
MaintenancePersistenceActive reports whether the shared PostgreSQL maintenance-state repository is active for this store.
func (*Store) ReloadPersistence ¶ added in v0.2.0
ReloadPersistence refreshes repository snapshots that are otherwise cached in-process. It loads every snapshot before publishing any of them, preventing future repair flows from mixing fresh cookbook state with stale identity or core-object state after a mid-reload failure.