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

volume

package
v0.5.0 Latest Latest
Warning

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

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

Documentation

Overview

Package volume keeps the records of a stack's installations in a volume of its target, where whoever reaches the target finds them: the CI that deployed the stack, and anyone who imported its manifest.

The volume is reached through a container that never starts, of an empty image nemo makes on the target: Docker's archive API copies the records in and out of it, over the connection to the target, with nothing running. Opened, the store copies the volume into a local directory, which the file store serves; each write goes back to the volume.

The container of a store held for writing is named after the stack: another can't be created while it exists, so a second nemo writing the stack finds it busy.

Index

Constants

View Source
const (
	// Label names the stack whose records a volume or a container holds.
	// It is not the stack's own label, which uninstalling a stack selects.
	Label = "io.nemo.records"
	// Image is the empty image of the containers that reach the volumes.
	Image = "nemo-records:1"
)

Variables

View Source
var ErrBusy = errors.New("busy")

ErrBusy is returned when another nemo holds the stack for writing.

Functions

func Name

func Name(stack string) string

Name is the name of the volume, and of the container that holds it.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store is the store of one stack, from Open to Close.

func Open

func Open(ctx context.Context, api client.APIClient, stack string, held bool) (*Store, error)

Open copies the records of the stack from its volume, which it creates the first time. Held, it is the stack's only writer until Close: another Open held fails with ErrBusy.

func (*Store) Close

func (store *Store) Close(ctx context.Context) error

Close removes the container, which frees the stack, and the local copy.

func (*Store) GetInstallation

func (store *Store) GetInstallation(ctx context.Context, stack, name string) (storage.Installation, error)

func (*Store) GetOutputs

func (store *Store) GetOutputs(ctx context.Context, stack, name, resultID string) (map[string]string, error)

func (*Store) GetRun

func (store *Store) GetRun(ctx context.Context, stack, name, id string) (cnab.Claim, error)

func (*Store) ListInstallations

func (store *Store) ListInstallations(ctx context.Context, stack string) ([]storage.Installation, error)

func (*Store) ListResults

func (store *Store) ListResults(ctx context.Context, stack, name string) ([]cnab.Result, error)

func (*Store) ListRuns

func (store *Store) ListRuns(ctx context.Context, stack, name string) ([]cnab.Claim, error)

func (*Store) Owner

func (store *Store) Owner() string

Owner is who manages the stack: empty for nemo, else the tool that set it.

func (*Store) SaveInstallation

func (store *Store) SaveInstallation(ctx context.Context, installation storage.Installation) error

func (*Store) SaveResult

func (store *Store) SaveResult(ctx context.Context, stack, name string, result cnab.Result, outputs map[string]string) error

func (*Store) SaveRun

func (store *Store) SaveRun(ctx context.Context, stack, name string, run cnab.Claim) error

func (*Store) SetOwner

func (store *Store) SetOwner(ctx context.Context, owner string) error

SetOwner records who manages the stack.

Jump to

Keyboard shortcuts

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