cas

package
v0.0.0-...-03333d7 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidHash is returned when an write fails for hash mismatch
	ErrInvalidHash error = errors.New("invalid hash")
)

Functions

This section is empty.

Types

type Store

type Store interface {
	Exists(key, extension string) (bool, error)
	Read(key, extension string) ([]byte, error)
	ReadStream(key, extension string) (io.ReadCloser, error)
	Write(key, extension string, data []byte) error
	WriteStream(key, extension string, reader io.Reader) error
}

Store is a read-write interface for a CAS store

func New

func New(store kvs.Store, hasher hasher.Hasher) Store

New returns a new CAS store using kvs.Store storage

type StoreReader

type StoreReader interface {
	Read(key, extension string) ([]byte, error)
	ReadStream(key, extension string) (io.ReadCloser, error)
	Exists(key, extension string) (bool, error)
}

StoreReader is a read-only interface for a CAS Store

Jump to

Keyboard shortcuts

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