bucketstore

package
v0.0.0-...-aaf6028 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Backends = make(map[string]Loader)
View Source
var EBadRequest = errors.New("Bad Request")
View Source
var EDiskFailure = errors.New("Disk Failure")
View Source
var EExists = errors.New("Object exists")
View Source
var ENoBucket = errors.New("No such bucket")
View Source
var EOutOfStorage = errors.New("Out of Storage")
View Source
var ETemporaryFailure = errors.New("Temporary Failure")

Functions

This section is empty.

Types

type Bucket

type Bucket struct {
	Store BucketStore
	Uuid  string
}

func OpenStore

func OpenStore(kind, path string, cfg *Config) (*Bucket, error)

type BucketStore

type BucketStore interface {
	Put(id, overv, head, body []byte, expire time.Time) error
	Get(id []byte, overv, head, body *bufferex.Binary) (ok bool, e error)
	Expire(expire time.Time) error
	FreeStorage() (int64, error)
}

type Config

type Config struct {
	MaxSpace int64 // Max. Storage consuption in bytes.
	MaxFiles int   // Max. number of file descriptors
}

type Loader

type Loader func(path string, cfg *Config) (BucketStore, error)

type OverStore

type OverStore interface {
	Submit(id, overv, head, body []byte, expire time.Time) (bucket bufferex.Binary, err error)
	OverPut(bucket []byte, id, overv, head, body []byte, expire time.Time) error
	OverGet(bucket []byte, id []byte, overv, head, body *bufferex.Binary) (ok bool, e error)
	OverExpire(bucket []byte, expire time.Time) error
	OverFreeStorage(bucket []byte) (int64, error)
}

Directories

Path Synopsis
A Resource damaged-state implementation for the remote interface.
A Resource damaged-state implementation for the remote interface.
Nail-House Allocation Method.
Nail-House Allocation Method.

Jump to

Keyboard shortcuts

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