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 ¶
const RequestRetention = 90 * 24 * time.Hour
RequestRetention is how long the request ledger keeps a request id.
Variables ¶
This section is empty.
Functions ¶
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 ¶
func (s *Server) For(host packagebridge.HostIdentity) kernelsettingsv1.KernelSettingsServer
For returns the KernelSettings server that host reaches; it has the shape of packagebridge.KernelSettingsProvider.