Documentation
¶
Overview ¶
Package applysetup defines the container-local installer boundary. Products own configuration changes, conflict handling, runtime activation and atomic audits.
Index ¶
- Constants
- func Decode(file string, dest any) error
- func DecodeRaw(raw []byte, dest any) error
- func HTTPS(s string) bool
- func Identifier(s string) bool
- func Interval(raw string) (time.Duration, error)
- func RequestRestart(ctx context.Context, socket string) error
- func Secret(file string) (string, error)
- func Stage(dataDir, file, id string, canonical []byte, check bool) (string, error)
- func StartLocal(ctx context.Context, socket string, ...) (func() error, error)
- func WriteCapabilities(out io.Writer, service string, features ...string) error
- func WritePreparation(out io.Writer, service, id, status string) error
- type Backup
- type Capabilities
- type Common
- type Identity
- type Object
- type Options
- type Recovery
- type Refusal
- type Report
- type SSO
Constants ¶
const MaxBundleBytes = 128 << 10
const MaxSecretBytes = 4 << 10
const ReportSchema = "ky.product-setup-report/1"
const Schema = "ky.product-setup/1"
Variables ¶
This section is empty.
Functions ¶
func Identifier ¶
func Stage ¶
Stage publishes already validated, canonical, secret-free product metadata. Products decode/validate their own envelope before calling it; this function owns only immutable private-file preparation, never accounts or configuration.
func StartLocal ¶
func StartLocal(ctx context.Context, socket string, apply func(context.Context, []byte, bool) (Report, error), restart func()) (func() error, error)
StartLocal exposes setup only over a private filesystem socket. The product callback validates its own payload and owns all changes. Restart is the product's graceful-stop request; a workload controller restarts it with the committed configuration.
func WriteCapabilities ¶
Types ¶
type Capabilities ¶
type Common ¶
type Common struct {
Schema string `json:"schema"`
Service string `json:"service"`
SetupID string `json:"setupId"`
SSO *SSO `json:"sso,omitempty"`
Admins []Identity `json:"admins,omitempty"`
Everyday []Identity `json:"everyday,omitempty"`
Backup *Backup `json:"backup,omitempty"`
}
func (Common) ValidatePreparation ¶
ValidatePreparation checks secret-free metadata before any filesystem mutation. Products still validate their own service, callbacks and extended fields.
type Options ¶
func ParsePreparation ¶
ParsePreparation is an explicit product opt-in. Legacy callers of Parse still refuse --stage instead of accidentally interpreting it as ordinary setup.
type Refusal ¶
type Refusal struct{ Reason string }
Refusal carries a fixed, public-safe explanation chosen by the product. Never put request values, credentials or a database error into Reason.
type Report ¶
type Report struct {
Schema string `json:"schema"`
Service string `json:"service"`
SetupID string `json:"setupId"`
Created []Object `json:"created"`
Present []Object `json:"present"`
Pending []Object `json:"pending"`
}