Documentation ¶
Index ¶
- Constants
- func ErrorAddressNotFound(address []byte) error
- func MakeAddresser(hashProvider func() hash.Hash) func(data []byte) []byte
- func NewAddressEncoding(encodeToString func([]byte) string, decodeString func(string) ([]byte, error)) *addressEncoding
- func NewFileSystemStore(rootDirectory string, addressEncoding AddressEncoding) (*fileSystemStore, error)
- func NewLoggingStore(store NamedStore, logger log.Logger) *loggingStore
- func NewMemoryStore() *memoryStore
- func NewS3Store(s3Bucket, s3Prefix string, addressEncoding AddressEncoding, ...) (*s3Store, error)
- func NewSyncStore(store NamedStore) *syncStore
- func Session(awsConfig *aws.Config) (*session.Session, error)
- type AddressEncoding
- type ContentAddressedStore
- type Locator
- type NamedStore
- type ReadStore
- type StatInfo
- type Store
- type WriteStore
Constants ¶
View Source
const ( Base64EncodingName = "base64" Base32EncodingName = "base32" HexEncodingName = "hex" )
View Source
const NotFoundCode = "NotFound"
Variables ¶
This section is empty.
Functions ¶
func ErrorAddressNotFound ¶
func MakeAddresser ¶ added in v1.1.0
Close in hasher
func NewAddressEncoding ¶
func NewFileSystemStore ¶
func NewFileSystemStore(rootDirectory string, addressEncoding AddressEncoding) (*fileSystemStore, error)
func NewLoggingStore ¶
func NewLoggingStore(store NamedStore, logger log.Logger) *loggingStore
Decorates a Store with some simple logging of method/address pairs
func NewMemoryStore ¶
func NewMemoryStore() *memoryStore
func NewS3Store ¶
func NewSyncStore ¶
func NewSyncStore(store NamedStore) *syncStore
Wrap a Store to synchronise it with respect to address access. For each address exactly one writer can enter the Put method of the underlying store or multiple readers can enter the Get and Stat methods, but no simultaneous readers (Getters, Statters) and writers (Putters) are allowed. Concurrent reads and writes to different addresses are permitted so the underlying store must be goroutine-safe across addresses.
Types ¶
type AddressEncoding ¶
type AddressEncoding interface { EncodeToString(address []byte) (addressString string) DecodeString(addressString string) (address []byte, err error) }
func GetAddressEncoding ¶
func GetAddressEncoding(name string) (AddressEncoding, error)
type ContentAddressedStore ¶
type ContentAddressedStore interface { ReadStore Locator // Put the data at its address Put(data []byte) (address []byte, err error) // Get the address of some data without putting it at that address Address(data []byte) (address []byte) }
func NewContentAddressedStore ¶
func NewContentAddressedStore(addresser func([]byte) []byte, store Store) ContentAddressedStore
type NamedStore ¶ added in v1.1.0
type Store ¶
type Store interface { ReadStore WriteStore Locator }
type WriteStore ¶
Click to show internal directories.
Click to hide internal directories.