Documentation
¶
Index ¶
- Constants
- func CopyPaddedJSON(w io.Writer, buf *bytes.Buffer)
- func GenerateCAFSFile(src string, fs Fs, destDir string) error
- func GenerateFile(tgt string, size int, leafSize uint32) error
- func IsRootKey(fs storage.Store, key Key, leafSize uint32) bool
- type BadKeySize
- type Fs
- type HasOption
- type Key
- func GenerateCAFSChunks(src string, fs Fs) (*Key, error)
- func KeyFromString(kv string) (Key, error)
- func LeafKeys(verify Key, data []byte, leafSize uint32) ([]Key, error)
- func LeafsForHash(blobs storage.Store, hash Key, leafSize uint32, prefix string) ([]Key, error)
- func MustNewKey(data []byte) Key
- func NewKey(data []byte) (Key, error)
- func RootHash(leaves []Key, leafSize uint32) (Key, error)
- type Option
- type PutRes
- type Reader
- type ReaderOption
- type Writer
Constants ¶
View Source
const ( DefaultLeafSize = 2 * 1024 * 1024 MaxLeafSize = 5 * 1024 * 1024 )
View Source
const ( // KeySize for blake2b algo KeySize = 64 // KeySizeHex for hex representation of a key KeySizeHex = 66 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BadKeySize ¶
type BadKeySize struct {
Key []byte
}
BadKeySize is an error that's returned when the key to create has an invalid size.
func (*BadKeySize) Error ¶
func (b *BadKeySize) Error() string
type Fs ¶
type Fs interface { Get(context.Context, Key) (io.ReadCloser, error) GetAt(context.Context, Key) (io.ReaderAt, error) Put(context.Context, io.Reader) (PutRes, error) Delete(context.Context, Key) error Clear(context.Context) error Keys(context.Context) ([]Key, error) RootKeys(context.Context) ([]Key, error) Has(context.Context, Key, ...HasOption) (bool, []Key, error) }
Fs implementations provide content-addressable filesystem operations
type HasOption ¶
type HasOption func(*hasOpts)
func HasGatherIncomplete ¶
func HasGatherIncomplete() HasOption
func HasOnlyRoots ¶
func HasOnlyRoots() HasOption
type Key ¶
Key type for CAFS keys
func KeyFromString ¶
func LeafsForHash ¶
func MustNewKey ¶
MustNewKey creates a new key from data but panics if there is an error
func (Key) StringWithPrefix ¶
type Option ¶
type Option func(*defaultFs)
Option to configure content addressable FS components
func ConcurrentFlushes ¶
func LeafTruncation ¶
type ReaderOption ¶
type ReaderOption func(reader *chunkReader)
func ConcurrentChunkWrites ¶
func ConcurrentChunkWrites(concurrentChunkWrites int) ReaderOption
func Keys ¶
func Keys(keys []Key) ReaderOption
func SetCache ¶
func SetCache(lru *lru.Cache) ReaderOption
func SetLeafPool ¶
func SetLeafPool(leafPool *leafFreelist) ReaderOption
func TruncateLeaf ¶
func TruncateLeaf(t bool) ReaderOption
func VerifyHash ¶
func VerifyHash(t bool) ReaderOption
Click to show internal directories.
Click to hide internal directories.