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

package objstore

import "github.com/SphereSoftware/objstore"

Index

Package Files

helpers.go objstore.go

Constants

const (
    EventOpaqueData cluster.EventType = cluster.EventOpaqueData
)

Variables

var ErrNotFound = errors.New("not found")

func CheckID Uses

func CheckID(str string) bool

func GenerateID Uses

func GenerateID() string

type ConsistencyLevel Uses

type ConsistencyLevel journal.ConsistencyLevel

func (ConsistencyLevel) Check Uses

func (c ConsistencyLevel) Check() (journal.ConsistencyLevel, error)

type DiskStats Uses

type DiskStats storage.DiskStats

type EventAnnounce Uses

type EventAnnounce cluster.EventAnnounce

type FileMeta Uses

type FileMeta journal.FileMeta

type FileMetaList Uses

type FileMetaList journal.FileMetaList

type Store Uses

type Store interface {
    NodeID() string
    IsReady() bool
    SetDebug(v bool)
    WaitOutbound(timeout time.Duration)
    WaitInbound(timeout time.Duration)
    ReceiveEventAnnounce(event *EventAnnounce)
    EmitEventAnnounce(event *EventAnnounce)
    DiskStats() (*DiskStats, error)
    Close() error

    // HeadObject gets object's meta data from the local journal.
    HeadObject(id string) (*FileMeta, error)
    // GetObject gets an object from the local storage of the node.
    // Used for private API, when other nodes ask for an object.
    GetObject(id string) (io.ReadCloser, *FileMeta, error)
    // FindObject gets and object from any node, if not found then tries to acquire from
    // the remote storage, e.g. Amazon S3.
    FindObject(ctx context.Context, id string, fetch bool) (io.ReadCloser, *FileMeta, error)
    // FetchObject retrieves an object from the remote storage, e.g. Amazon S3.
    // This should be called only on a total cache miss, when file is not found
    // on any node of the cluster. If supplied ID is not a valid ULID, resulting meta will have a new ID.
    FetchObject(ctx context.Context, id string) (io.ReadCloser, *FileMeta, error)
    // PutObject writes object to the local storage, emits cluster announcements, optionally
    // writes object to remote storage, e.g. Amazon S3. Returns amount of bytes written.
    PutObject(r io.ReadCloser, meta *FileMeta) (int64, error)
    // DeleteObject marks object as deleted in journals and deletes it from the local storage.
    // This operation does not delete object from remote storage.
    DeleteObject(id string) (*FileMeta, error)
    // Diff finds the difference between serialized exernal journal represented as list,
    // and journals currently available on this local node.
    Diff(list FileMetaList) (added, deleted FileMetaList, err error)
}

func NewStore Uses

func NewStore(nodeID string,
    localStorage storage.LocalStorage,
    remoteStorage storage.RemoteStorage,
    journals journal.JournalManager,
    cluster cluster.ClusterManager,
) (Store, error)

Directories

PathSynopsis
api
cluster
journalPackage journal is responsible for maintaining the inner state of the OBJSTORE, journals represent managed event logs that can be diffed, joined and stored as in-memory B-tree or in a BoltDB bucket.
storage

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