client

package
v0.0.0-...-b178995 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

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

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

Functions

func NextKey

func NextKey(key string) string

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

Types

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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