Back to godoc.org
a4.io/blobstash / pkg / client

Package client

v0.0.0-...-b3026eb
Latest Go to latest

The highest tagged major version is .

Published: May 14, 2020 | License: MIT | Module: a4.io/blobstash

Index

Variables

var ErrBlobNotFound = errors.New("blob not found")

ErrBlobNotFound is returned from a get/stat request if the blob does not exist.

var ErrKeyNotFound = errors.New("key doest not exist")

func NextKey

func NextKey(key string) string

NextKey returns the next key for lexigraphical (key = NextKey(lastkey))

type Blob

type Blob struct {
	Hash string
	Blob string
}

type BlobStore

type BlobStore struct {
	ServerAddr string
	// contains filtered or unexported fields
}

func NewBlobStore

func NewBlobStore(serverAddr string) *BlobStore

func (*BlobStore) Enumerate

func (bs *BlobStore) Enumerate(blobs chan<- string, start, end string, limit int) error

func (*BlobStore) Get

func (bs *BlobStore) Get(hash string) ([]byte, error)

Get fetch the given blob.

func (*BlobStore) ProcessBlobs

func (bs *BlobStore) ProcessBlobs()

func (*BlobStore) Put

func (bs *BlobStore) Put(hash string, blob []byte) error

func (*BlobStore) SetAPIKey

func (bs *BlobStore) SetAPIKey(apiKey string)

func (*BlobStore) Stat

func (bs *BlobStore) Stat(hash string) (bool, error)

Stat checks wether a blob exists or not.

func (*BlobStore) WaitBlobs

func (bs *BlobStore) WaitBlobs()

type BlobsBuffer

type BlobsBuffer struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewBlobsBuffer

func NewBlobsBuffer(bs *BlobStore) *BlobsBuffer

func (*BlobsBuffer) AddBlob

func (bb *BlobsBuffer) AddBlob(hash string, blob []byte) error

func (*BlobsBuffer) Close

func (bb *BlobsBuffer) Close()

func (*BlobsBuffer) Upload

func (bb *BlobsBuffer) Upload() error

type BlobsResp

type BlobsResp struct {
	Blobs []string `json:"blobs"`
}

type KvStore

type KvStore struct {
	ServerAddr string
	// contains filtered or unexported fields
}

func NewKvStore

func NewKvStore(serverAddr string) *KvStore

func (*KvStore) Get

func (kvs *KvStore) Get(key string, version int) (*response.KeyValue, error)

func (*KvStore) Keys

func (kvs *KvStore) Keys(start, end string, limit int) ([]*response.KeyValue, error)

func (*KvStore) Put

func (kvs *KvStore) Put(key, value string, version int) (*response.KeyValue, error)

func (*KvStore) Versions

func (kvs *KvStore) Versions(key string, start, end, limit int) (*response.KeyValueVersions, error)

type MultipartWriter

type MultipartWriter struct {
	Buffer *bytes.Buffer
	Writer *multipart.Writer
	Blobs  int
}

func NewMultipartWriter

func NewMultipartWriter() *MultipartWriter

func (*MultipartWriter) AddBlob

func (mpw *MultipartWriter) AddBlob(hash string, blob []byte) error

func (*MultipartWriter) Close

func (mpw *MultipartWriter) Close() error

func (*MultipartWriter) FormDataContentType

func (mpw *MultipartWriter) FormDataContentType() string

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier