toolstorage

package
v0.0.0-...-a002913 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2015 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metadata

type Metadata struct {
	Version version.Binary
	Size    int64
	SHA256  string
}

Metadata describes a Juju tools tarball.

type Storage

type Storage interface {
	// AddTools adds the tools tarball and metadata into state,
	// replacing existing metadata if any exists with the specified
	// version.
	AddTools(io.Reader, Metadata) error

	// Tools returns the Metadata and tools tarball contents
	// for the specified version if it exists, else an error
	// satisfying errors.IsNotFound.
	Tools(version.Binary) (Metadata, io.ReadCloser, error)

	// AllMetadata returns metadata for the full list of tools in
	// the catalogue.
	AllMetadata() ([]Metadata, error)

	// Metadata returns the Metadata for the specified version
	// if it exists, else an error satisfying errors.IsNotFound.
	Metadata(v version.Binary) (Metadata, error)
}

Storage provides methods for storing and retrieving tools by version.

func NewStorage

func NewStorage(
	envUUID string,
	managedStorage blobstore.ManagedStorage,
	metadataCollection *mgo.Collection,
	runner jujutxn.Runner,
) Storage

NewStorage constructs a new Storage that stores tools tarballs in the provided ManagedStorage, and tools metadata in the provided collection using the provided transaction runner.

type StorageCloser

type StorageCloser interface {
	Storage
	Close() error
}

StorageCloser extends the Storage interface with a Close method.

Jump to

Keyboard shortcuts

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