kernelsettings

package
v4.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package kernelsettings serves the KernelSettings contract (sdk/api/kernelsettings/v1, docs/architecture/settings-service.md) to official packages: the system settings in v2_system_config and the backup configuration row, per namespace (service.SettingsNamespaces).

Every call is authorized for the namespace's capability against the calling host's current generation. Writes run in one transaction with the audit entries the kernel's own handlers record for the same change and the request ledger, and bump the namespace's generation once committed, so every copy of it the kernel keeps in memory reloads before the call returns.

Index

Constants

View Source
const RequestRetention = 90 * 24 * time.Hour

RequestRetention is how long the request ledger keeps a request id.

Variables

This section is empty.

Functions

func PruneRequests

func PruneRequests(db *gorm.DB, now time.Time) (int64, error)

PruneRequests deletes request ledger rows older than RequestRetention.

Types

type Authorizer

type Authorizer interface {
	AuthorizeCapability(ctx context.Context, host packagebridge.HostIdentity, capability string) error
}

Authorizer admits a calling host to a capability.

type Server

type Server struct {
	DB         *gorm.DB
	Authorizer Authorizer
	// Now defaults to time.Now.
	Now func() time.Time
}

Server holds what every host's KernelSettings calls share.

func (*Server) For

For returns the KernelSettings server that host reaches; it has the shape of packagebridge.KernelSettingsProvider.

Jump to

Keyboard shortcuts

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