objstore: github.com/SphereSoftware/objstore/storage Index | Files

package storage

import "github.com/SphereSoftware/objstore/storage"


Package Files

helpers.go local.go remote.go


var ErrNotFound = errors.New("NoSuchKey: The specified key does not exist.")

type DiskStats Uses

type DiskStats struct {
    BytesAll  uint64 `json:"bytes_all"`
    BytesUsed uint64 `json:"bytes_used"`
    BytesFree uint64 `json:"bytes_free"`

type LocalStorage Uses

type LocalStorage interface {
    Prefix() string
    Read(key string) (*os.File, error)
    Stat(key string) (os.FileInfo, error)
    Delete(key string) error
    Write(key string, body io.Reader) (int64, error)
    ListFiles(prefix string) ([]os.FileInfo, error)
    CheckAccess(prefix string) error
    DiskStats() (*DiskStats, error)

LocalStorage provides access to the local filesystem.

func NewLocalStorage Uses

func NewLocalStorage(prefix string) LocalStorage

type RemoteStorage Uses

type RemoteStorage interface {
    PutObject(key string, r io.ReadSeeker, meta map[string]string) (*Spec, error)
    GetObject(key string, version ...string) (*Spec, error)
    HeadObject(key string, version ...string) (*Spec, error)
    ListObjects(prefix string, startAfter ...string) ([]*Spec, error)
    CheckAccess(prefix string) error
    Bucket() string

RemoteStorage provides object access backend, it's usually an AWS S3 client pointed to a specific bucket.

func NewS3Storage Uses

func NewS3Storage(region, bucket string) RemoteStorage

type Spec Uses

type Spec struct {
    Path      string
    Key       string
    Body      io.ReadCloser
    ETag      string
    Version   string
    UpdatedAt time.Time
    Meta      map[string]string
    Size      int64

Package storage imports 14 packages (graph). Updated 2017-09-27. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).