store

package
v0.6.1019 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package store is the runhost's store of the releases it has run: each one's archive and the facts it arrived with, encrypted at rest, so a later run of the same release need not send it again. Whatever comes out of the store is verified again before it runs; the store keeps bytes, not trust.

An entry is the magic, a 12-byte nonce, and AES-256-GCM over a length- prefixed JSON document (job.Release) followed by the archive, with the release's digest as additional data, so an entry moved to another digest's name does not open. The key is the store's own, made at its first use and kept owner-only beside it.

Index

Constants

View Source
const KeyFile = "store.key"

KeyFile is the store key's file name, beside the store's directory.

Variables

View Source
var ErrDamaged = errors.New("the runhost's stored release does not open: it was changed since it was stored")

ErrDamaged means an entry did not open with the store's key: it was changed, moved or cut.

View Source
var ErrNotStored = errors.New("the runhost's store holds no such release")

ErrNotStored means the store holds no release of that digest.

Functions

This section is empty.

Types

type Store

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

Store is the release store under Dir.

func Open

func Open(dir, keyFile string) (*Store, error)

Open opens the store under dir (made 0700), whose key is keyFile, made at first use.

func (*Store) Get

func (s *Store) Get(digest string) (job.Release, []byte, error)

Get reads the release of digest and its archive back.

func (*Store) Has

func (s *Store) Has(digest string) bool

Has says whether the store holds a release of digest.

func (*Store) Put

func (s *Store) Put(rel job.Release, archive []byte) error

Put stores the release rel and its archive, replacing an entry of the same digest. The entry is written whole under a temporary name, then renamed.

func (*Store) Remove

func (s *Store) Remove(digest string) error

Remove deletes the release of digest; one not stored is not an error.

Jump to

Keyboard shortcuts

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