Help us shape the future of Go! Take the 2026 Go Developer Survey

coreinstallation

package
v0.4.26 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package coreinstallation owns the repository-independent Core lifecycle.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcquireLifecycleLock added in v0.4.24

func AcquireLifecycleLock(root string) (func(), error)

AcquireLifecycleLock serializes bootstrap and provider upgrades of one installation, across releases. The kernel releases the lock on process exit; durable update receipts still govern recovery after an interrupted mutation. The caller must release the returned lock after all verification completes.

func AcquireStateFileLock added in v0.4.25

func AcquireStateFileLock(root string) (func(), error)

AcquireStateFileLock reuses the existing kernel lock for another existing state owner. The caller proves directory/file ownership and protection using its native metadata authority before entering this serialization boundary.

Types

type Defaults

type Defaults struct {
	LocalWorkspaces     bool `json:"local_workspaces"`
	ExplicitSources     bool `json:"explicit_sources"`
	ProtectedManagement bool `json:"protected_management"`
}

type MachineRole

type MachineRole string
const (
	Development MachineRole = "development"
	Deployment  MachineRole = "deployment"
)

func (MachineRole) Defaults

func (r MachineRole) Defaults() Defaults

type Spec

type Spec struct {
	Target      string      `json:"target"`
	Runtime     string      `json:"runtime"`
	MachineRole MachineRole `json:"machine_role"`
	HA          bool        `json:"ha"`
}

type State

type State struct {
	Version        string          `json:"version"`
	ID             string          `json:"installation_id"`
	Owner          string          `json:"owner"`
	Spec           Spec            `json:"spec"`
	Defaults       Defaults        `json:"defaults"`
	Placement      string          `json:"placement"`
	Phase          string          `json:"phase"`
	Ready          bool            `json:"ready"`
	Capabilities   map[string]bool `json:"capabilities"`
	IdentityIssuer string          `json:"identity_issuer,omitempty"`
}

func Load

func Load(root string) (State, error)

func Run

func Run(ctx context.Context, root string, spec Spec, steps Steps) (State, error)

Run records identity before provisioning and verifies again on every retry. A failed stage is durable; no retry manufactures a new installation identity.

type Steps

type Steps struct {
	Preflight func(context.Context, State) error
	SQL       func(context.Context, State) error
	Secrets   func(context.Context, State) error
	Identity  func(context.Context, State) (string, error)
	Verify    func(context.Context, State) error
}

Jump to

Keyboard shortcuts

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