camlistore: github.com/jbreiding/camlistore/pkg/blobserver/localdisk Index | Files

package localdisk

import "github.com/jbreiding/camlistore/pkg/blobserver/localdisk"

Package localdisk registers the "filesystem" blobserver storage type, storing blobs in a forest of sharded directories at the specified root.

Example low-level config:

"/storage/": {
    "handler": "storage-filesystem",
    "handlerArgs": {
       "path": "/var/camlistore/blobs"
     }
},

Index

Package Files

enumerate.go generation.go localdisk.go path.go receive.go receive_posix.go stat.go upgrade32.go

func IsDir Uses

func IsDir(root string) (bool, error)

IsDir reports whether root is a localdisk (file-per-blob) storage directory.

type DiskStorage Uses

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

DiskStorage implements the blobserver.Storage interface using the local filesystem.

func New Uses

func New(root string) (*DiskStorage, error)

New returns a new local disk storage implementation at the provided root directory, which must already exist.

func (*DiskStorage) EnumerateBlobs Uses

func (ds *DiskStorage) EnumerateBlobs(ctx context.Context, dest chan<- blob.SizedRef, after string, limit int) error

func (*DiskStorage) Fetch Uses

func (ds *DiskStorage) Fetch(br blob.Ref) (io.ReadCloser, uint32, error)

func (*DiskStorage) ReceiveBlob Uses

func (ds *DiskStorage) ReceiveBlob(blobRef blob.Ref, source io.Reader) (ref blob.SizedRef, err error)

func (*DiskStorage) RemoveBlobs Uses

func (ds *DiskStorage) RemoveBlobs(blobs []blob.Ref) error

func (*DiskStorage) ResetStorageGeneration Uses

func (ds *DiskStorage) ResetStorageGeneration() error

ResetStorageGeneration reinitializes the generation by recreating the GENERATION.dat file with a new random string

func (*DiskStorage) StatBlobs Uses

func (ds *DiskStorage) StatBlobs(dest chan<- blob.SizedRef, blobs []blob.Ref) error

func (*DiskStorage) StorageGeneration Uses

func (ds *DiskStorage) StorageGeneration() (initTime time.Time, random string, err error)

StorageGeneration returns the generation's initialization time, and the random string.

func (*DiskStorage) String Uses

func (ds *DiskStorage) String() string

func (*DiskStorage) SubFetch Uses

func (ds *DiskStorage) SubFetch(br blob.Ref, offset, length int64) (io.ReadCloser, error)

Package localdisk imports 19 packages (graph). Updated 2018-06-25. Refresh now. Tools for package owners.