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
- Variables
- func Name(stack string) string
- type Store
- func (store *Store) Close(ctx context.Context) error
- func (store *Store) GetInstallation(ctx context.Context, stack, name string) (storage.Installation, error)
- func (store *Store) GetOutputs(ctx context.Context, stack, name, resultID string) (map[string]string, error)
- func (store *Store) GetRun(ctx context.Context, stack, name, id string) (cnab.Claim, error)
- func (store *Store) ListInstallations(ctx context.Context, stack string) ([]storage.Installation, error)
- func (store *Store) ListResults(ctx context.Context, stack, name string) ([]cnab.Result, error)
- func (store *Store) ListRuns(ctx context.Context, stack, name string) ([]cnab.Claim, error)
- func (store *Store) Owner() string
- func (store *Store) SaveInstallation(ctx context.Context, installation storage.Installation) error
- func (store *Store) SaveResult(ctx context.Context, stack, name string, result cnab.Result, ...) error
- func (store *Store) SaveRun(ctx context.Context, stack, name string, run cnab.Claim) error
- func (store *Store) SetOwner(ctx context.Context, owner string) error
Constants ¶
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 ¶
var ErrBusy = errors.New("busy")
ErrBusy is returned when another nemo holds the stack for writing.
Functions ¶
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the store of one stack, from Open to Close.
func Open ¶
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.