inmemory

package
v2.0.0-alpha.0+incompa... Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2015 License: Apache-2.0 Imports: 11 Imported by: 0

README

Docker-Registry In-Memory Storage Driver

An implementation of the storagedriver.StorageDriver interface which uses local memory for object storage.

IMPORTANT: This storage driver does not persist data across runs, and primarily exists for testing.

Parameters

None

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

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

Driver is a storagedriver.StorageDriver implementation backed by a local map. Intended solely for example and testing purposes.

func New

func New() *Driver

New constructs a new Driver.

func (*Driver) Delete

func (d *Driver) Delete(path string) error

Delete recursively deletes all objects stored at "path" and its subpaths.

func (*Driver) GetContent

func (d *Driver) GetContent(path string) ([]byte, error)

GetContent retrieves the content stored at "path" as a []byte.

func (*Driver) List

func (d *Driver) List(path string) ([]string, error)

List returns a list of the objects that are direct descendants of the given path.

func (*Driver) Move

func (d *Driver) Move(sourcePath string, destPath string) error

Move moves an object stored at sourcePath to destPath, removing the original object.

func (*Driver) PutContent

func (d *Driver) PutContent(p string, contents []byte) error

PutContent stores the []byte content at a location designated by "path".

func (*Driver) ReadStream

func (d *Driver) ReadStream(path string, offset int64) (io.ReadCloser, error)

ReadStream retrieves an io.ReadCloser for the content stored at "path" with a given byte offset.

func (*Driver) Stat

func (d *Driver) Stat(path string) (storagedriver.FileInfo, error)

Stat returns info about the provided path.

func (*Driver) URLFor

func (d *Driver) URLFor(path string, options map[string]interface{}) (string, error)

URLFor returns a URL which may be used to retrieve the content stored at the given path. May return an UnsupportedMethodErr in certain StorageDriver implementations.

func (*Driver) WriteStream

func (d *Driver) WriteStream(path string, offset int64, reader io.Reader) (nn int64, err error)

WriteStream stores the contents of the provided io.ReadCloser at a location designated by the given path.

Jump to

Keyboard shortcuts

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