store

package
v0.9.1-beta2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AppConfigDirectory is the Docker App directory name inside Docker config directory
	AppConfigDirectory = "app"
	// ImageStoreDirectory is the bundle store directory name
	ImageStoreDirectory = "bundles"
	// CredentialStoreDirectory is the credential store directory name
	CredentialStoreDirectory = "credentials"
	// InstallationStoreDirectory is the installations store directory name
	InstallationStoreDirectory = "installations"
)

Variables

This section is empty.

Functions

func ComputeDigest

func ComputeDigest(bundle io.WriterTo) (digest.Digest, error)

ComputeDigest takes a bundle and produce a unigue reference.Digested

func StringToNamedRef

func StringToNamedRef(s string) (reference.Named, error)

StringToNamedRef converts a string to a named reference

Types

type ApplicationStore

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

ApplicationStore is the main point to access different stores: - Bundle store persists all bundles built or fetched locally - Credential store persists all the credentials, per context basis - Installation store persists all the installations, per context basis

func NewApplicationStore

func NewApplicationStore(configDir string) (*ApplicationStore, error)

NewApplicationStore creates a new application store, nested inside a docker configuration directory. It will create all the directory hierarchy if anything is missing.

func (ApplicationStore) CredentialStore

func (a ApplicationStore) CredentialStore(context string) (CredentialStore, error)

CredentialStore initializes and returns a context based credential store

func (ApplicationStore) ImageStore

func (a ApplicationStore) ImageStore() (ImageStore, error)

ImageStore initializes and returns a bundle store

func (ApplicationStore) InstallationStore

func (a ApplicationStore) InstallationStore(context string) (InstallationStore, error)

InstallationStore initializes and returns a context based installation store

type CredentialStore

type CredentialStore interface {
	Store(creds *credentials.CredentialSet) error
	Read(credentialSetName string) (*credentials.CredentialSet, error)
}

CredentialStore persists credential sets to a specific path.

type ID

type ID digest.Digest

ID is an unique identifier for docker app image bundle, implementing reference.Reference

func FromAppImage

func FromAppImage(img *image.AppImage) (ID, error)

func FromString

func FromString(s string) (ID, error)

func (ID) Digest

func (id ID) Digest() digest.Digest

func (ID) String

func (id ID) String() string

type ImageStore

type ImageStore interface {
	// Store do store the bundle with optional reference, and return it's unique ID
	Store(img *image.AppImage, ref reference.Reference) (reference.Digested, error)
	Read(ref reference.Reference) (*image.AppImage, error)
	List() ([]reference.Reference, error)
	Remove(ref reference.Reference, force bool) error
	LookUp(refOrID string) (reference.Reference, error)
}

func NewImageStore

func NewImageStore(path string) (ImageStore, error)

NewImageStore creates a new bundle store with the given path and initializes it

type Installation

type Installation struct {
	claim.Claim
	RelocationMap relocation.ImageRelocationMap
	Reference     string `json:"reference,omitempty"`
}

Installation is a CNAB claim with an information of where the bundle comes from. It persists the result of an installation and its parameters and context.

func NewInstallation

func NewInstallation(name string, reference string, bndl *image.AppImage) (*Installation, error)

func (Installation) SetParameter

func (i Installation) SetParameter(name string, value string)

SetParameter sets the parameter value if the installation bundle has a defined parameter with that name.

type InstallationStore

type InstallationStore interface {
	List() ([]string, error)
	Store(installation *Installation) error
	Read(installationName string) (*Installation, error)
	Delete(installationName string) error
}

InstallationStore is an interface to persist, delete, list and read installations.

type UnknownReferenceError

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

UnknownReferenceError represents a reference not found in the bundle store

func (*UnknownReferenceError) Error

func (e *UnknownReferenceError) Error() string

func (*UnknownReferenceError) NotFound

func (e *UnknownReferenceError) NotFound()

NotFound satisfies interface github.com/docker/docker/errdefs.ErrNotFound

Jump to

Keyboard shortcuts

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