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

applicationrelease

package
v0.55.11 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package applicationrelease holds the owner-signed record of one scoped application release change: the retained copy of the application's prior data, the prior intent, and the release transition it authorizes.

A forward change stops only the selected application, copies each of its governed volumes into an operation-bound retained volume, reads the copy back as a file-tree digest and then selects the target release in the StackSpec; normal generate and Apply run the change. A rollback stops the application again, copies the retained data back, proves the live tree equals the checkpoint digest and restores the prior intent; the next Apply may then start the earlier release on exactly that data. While a record is open, Apply starts only the release it expects; without one, Apply refuses every move to an earlier release.

Index

Constants

View Source
const APIVersion = "stackkit.application-release/v1"
View Source
const Directory = ".stackkit/applications/releases"

Directory holds one owner-signed record per scoped release operation.

Variables

This section is empty.

Functions

func CanAdvance

func CanAdvance(from, next State) bool

CanAdvance reports whether a record in state from may move to next.

func ValidOperationID

func ValidOperationID(id string) bool

ValidOperationID reports whether id is a scoped release operation identity.

Types

type Image

type Image struct {
	Ref    string `json:"ref"`
	Digest string `json:"digest"`
}

type Readback

type Readback struct {
	Files  int64  `json:"files"`
	Bytes  int64  `json:"bytes"`
	Digest string `json:"digest"`
}

type Record

type Record struct {
	APIVersion     string `json:"apiVersion"`
	OperationID    string `json:"operationId"`
	State          State  `json:"state"`
	UseCaseRef     string `json:"useCaseRef"`
	WorkloadRef    string `json:"workloadRef"`
	ModuleRef      string `json:"moduleRef"`
	NodeRef        string `json:"nodeRef"`
	ComposeProject string `json:"composeProject"`
	EntryComponent string `json:"entryComponent"`
	PriorRelease   string `json:"priorRelease"`
	PriorImage     Image  `json:"priorImage"`
	TargetRelease  string `json:"targetRelease"`
	TargetImage    Image  `json:"targetImage"`
	PriorSpecHash  string `json:"priorSpecHash"`
	TargetSpecHash string `json:"targetSpecHash"`
	// PriorSpec and TargetSpec are the exact canonical StackSpec bytes.
	PriorSpec        []byte    `json:"priorSpec"`
	TargetSpec       []byte    `json:"targetSpec"`
	PlanHash         string    `json:"planHash"`
	KopiaHelperImage string    `json:"kopiaHelperImage"`
	Volumes          []Volume  `json:"volumes"`
	CreatedAt        time.Time `json:"createdAt"`
	UpdatedAt        time.Time `json:"updatedAt"`

	Signature localevidence.OwnerApplicationReleaseSignature `json:"signature"`
}

func List

func List(workspace string) ([]Record, error)

List returns every verified record, oldest first.

func OpenFor

func OpenFor(workspace, workload string) (Record, bool, error)

OpenFor returns the one record that still governs a workload.

func Persist

func Persist(workspace string, record Record) (Record, error)

Persist signs and atomically replaces the record of its operation. A new record must start at StateCheckpointStarted; an existing one may move only along the declared transitions.

func Read

func Read(workspace, operation string) (Record, error)

Read returns the verified record of one operation.

func (Record) Open

func (record Record) Open() bool

Open reports whether the record still governs its application: retained data exists or a transition is incomplete.

type State

type State string
const (
	// StateCheckpointStarted: the application may be stopped and its
	// retained copies may be incomplete; live data is unchanged.
	StateCheckpointStarted State = "checkpoint-started"
	// StateCheckpointed: retained copies are complete and read back, the
	// target release is selected, and the application stays stopped until
	// Apply starts the target release.
	StateCheckpointed State = "checkpointed"
	// StateRollbackStarted: live data may be partly restored.
	StateRollbackStarted State = "rollback-started"
	// StateRolledBack: live data equals the checkpoint, the prior intent is
	// selected, and the next Apply may start the prior release.
	StateRolledBack State = "rolled-back"
	// StateAbandoned: a checkpoint that never completed was released; the
	// prior intent and runtime stay authoritative.
	StateAbandoned State = "abandoned"
	// StateFinalized: retained copies are removed; the record is history.
	StateFinalized State = "finalized"
)

type Volume

type Volume struct {
	ComponentRef   string    `json:"componentRef"`
	LogicalName    string    `json:"logicalName"`
	ComposeProject string    `json:"composeProject"`
	LiveName       string    `json:"liveName"`
	RollbackName   string    `json:"rollbackName"`
	Checkpoint     *Readback `json:"checkpoint,omitempty"`
}

Volume is one governed live volume of the application and its retained, operation-bound copy.

Jump to

Keyboard shortcuts

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