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

file

package
v0.3.2 Latest Latest
Warning

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

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

Documentation

Overview

Package file is a store in a local directory, one per installation, in the directory of its stack, next to the stack's manifest:

<root>/<stack>/installations/<name>/installation.json
<root>/<stack>/installations/<name>/runs/<claim id>.json
<root>/<stack>/installations/<name>/results/<result id>.json
<root>/<stack>/installations/<name>/outputs/<result id>/<output>

Files are written whole, through a temporary file, and readable by their owner only.

Index

Constants

View Source
const HomeVariable = "NEMO_HOME"

HomeVariable overrides where nemo keeps its files.

Variables

This section is empty.

Functions

func DefaultRoot

func DefaultRoot() (string, error)

DefaultRoot is $NEMO_HOME, or ~/.nemo.

Types

type Store

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

Store is a store in a directory.

func New

func New(root string) *Store

New returns the store in root.

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)

GetOutputs reads the files a result's outputs were written to.

func (*Store) GetRun

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

GetRun reads the claim of that ID.

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)

ListResults returns the results sorted by ID, ULIDs too.

func (*Store) ListRuns

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

ListRuns returns the claims sorted by ID: claim IDs are ULIDs, which sort by time.

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

SaveResult writes the result, named after its ID, and each output in a file of its own.

func (*Store) SaveRun

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

SaveRun writes the claim, named after its ID.

Jump to

Keyboard shortcuts

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