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. It also keeps named entries, a credential the runhost holds at rest for its runs (the credits token), under the same key.
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
- Variables
- func NewKey() ([]byte, error)
- type Store
- func (s *Store) Entries() ([]string, error)
- func (s *Store) Entry(name string) ([]byte, error)
- func (s *Store) Get(digest string) (job.Release, []byte, error)
- func (s *Store) Has(digest string) bool
- func (s *Store) Put(rel job.Release, archive []byte) error
- func (s *Store) PutEntry(name string, value []byte) error
- func (s *Store) Remove(digest string) error
- func (s *Store) RemoveEntry(name string) error
Constants ¶
const KeyFile = "store.key"
KeyFile is the store key's file name, beside the store's directory.
Variables ¶
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.
var ErrNoEntry = errors.New("the runhost's store holds no such entry")
ErrNoEntry means the store holds no entry of that name.
var ErrNotStored = errors.New("the runhost's store holds no such release")
ErrNotStored means the store holds no release of that digest.
Functions ¶
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the release store under Dir.
func OpenWithKey ¶ added in v0.7.11
OpenWithKey opens the store under dir (made 0700) with key, a 32-byte key its caller keeps.
func (*Store) Entries ¶ added in v0.7.11
Entries are the names of the entries the store holds, sorted.
func (*Store) Put ¶
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) PutEntry ¶ added in v0.7.3
PutEntry stores value as the entry name, replacing one of the same name. The entry's name is its additional data, so an entry renamed does not open as another.
func (*Store) RemoveEntry ¶ added in v0.7.3
RemoveEntry deletes the entry name; one not stored is not an error.