juju: github.com/juju/juju/state/storage Index | Files

package storage

import "github.com/juju/juju/state/storage"

Index

Package Files

storage.go

type Storage Uses

type Storage interface {
    // Get returns an io.ReadCloser for data at path, namespaced to the
    // model.
    //
    // If the data is still being uploaded and is not fully written yet, a
    // blobstore.ErrUploadPending error is returned. This means the path is
    // valid but the caller should try again later to retrieve the data.
    Get(path string) (r io.ReadCloser, length int64, err error)

    // Put stores data from reader at path, namespaced to the model.
    Put(path string, r io.Reader, length int64) error

    // PutAndCheckHash stores data from reader at path, namespaced to
    // the model. It also ensures the stored data has the correct
    // hash.
    PutAndCheckHash(path string, r io.Reader, length int64, hash string) error

    // Remove removes data at path, namespaced to the model.
    Remove(path string) error
}

Storage is an interface providing methods for storing and retrieving data by path.

func NewStorage Uses

func NewStorage(modelUUID string, session *mgo.Session) Storage

NewStorage returns a Storage for the model with the specified UUID.

Package storage imports 3 packages (graph) and is imported by 226 packages. Updated 2018-08-22. Refresh now. Tools for package owners.