filesystem

package
v0.0.0-...-8bfda83 Latest Latest
Warning

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

Go to latest
Published: May 12, 2015 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	BaseDir string
}

func (*Backend) BlobIterator

func (backend *Backend) BlobIterator() model.Iterator

BlobIterator returns an iterator that iterates all blobs as Blob structs.

func (*Backend) CountBlobRefs

func (backend *Backend) CountBlobRefs(blobID string) (count int, err error)

CountBlobRefs counts all BlobRef occurrences with blobID in all known databases.

func (*Backend) CountImageRefs

func (backend *Backend) CountImageRefs(imageID string) (count int, err error)

CountImageRefs counts all ImageRef occurrences with imageID in all known databases.

func (*Backend) DeleteBlob

func (backend *Backend) DeleteBlob(blob *media.Blob) error

DeleteBlob does not delete the file associated with it, also use DeleteFile().

func (*Backend) DeleteFile

func (backend *Backend) DeleteFile(id string) error

Returns ErrNotFound if no file with id is found.

func (*Backend) DeleteImage

func (backend *Backend) DeleteImage(image *media.Image) error

func (*Backend) FileReader

func (backend *Backend) FileReader(id string) (reader io.ReadCloser, filename, contentType string, err error)

Returns ErrNotFound if no file with id is found.

func (*Backend) FileWriter

func (backend *Backend) FileWriter(filename, contentType string) (writer io.WriteCloser, id string, err error)

func (*Backend) ImageIterator

func (backend *Backend) ImageIterator() model.Iterator

ImageIterator returns an iterator that iterates all images as Image structs.

func (*Backend) LoadBlob

func (backend *Backend) LoadBlob(id string) (*media.Blob, error)

func (*Backend) LoadImage

func (backend *Backend) LoadImage(id string) (*media.Image, error)

Returns ErrNotFound if no image with id is found.

func (*Backend) RemoveAllBlobRefs

func (backend *Backend) RemoveAllBlobRefs(blobID string) (count int, err error)

RemoveAllBlobRefs removes all BlobRef occurrences with blobID in all known databases.

func (*Backend) RemoveAllImageRefs

func (backend *Backend) RemoveAllImageRefs(imageID string) (count int, err error)

RemoveAllImageRefs removes all ImageRef occurrences with imageID in all known databases.

func (*Backend) SaveBlob

func (backend *Backend) SaveBlob(blob *media.Blob) error

func (*Backend) SaveImage

func (backend *Backend) SaveImage(image *media.Image) error

SaveImage saves image and updates its ID if it is empty.

Jump to

Keyboard shortcuts

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