Documentation ¶
Index ¶
Constants ¶
View Source
const ( KB = 1024 WINDOW_SIZE = 2 * KB MIN = 128 * KB AVG = 256 * KB MAX = 512 * KB )
View Source
const (
DefaultMaxFetchConns uint64 = 4
)
Variables ¶
View Source
var (
ErrWrongHash = errors.New("wrong hash")
)
Functions ¶
func NewBadgerStore ¶
func NewBadgerStore(badgerOpts badger.Options) *badgerStore
Types ¶
type Chunker ¶
type Chunker struct {
// contains filtered or unexported fields
}
func NewChunker ¶
func NewChunker(reader io.ReadCloser) *Chunker
type ManifestChunk ¶
type ManifestChunk = pb.ManifestChunk
type Store ¶
type Store interface { Start() error Close() MaxFetchConns() (uint64, error) SetMaxFetchConns(maxFetchConns uint64) error BlobReader(blobID ID, rng *types.Range) (io.ReadCloser, int64, error) HaveBlob(id ID) (bool, error) StoreBlob(reader io.ReadCloser) (sha1Hash types.Hash, sha3Hash types.Hash, err error) VerifyBlobOrPrune(blobID ID) error Manifest(id ID) (Manifest, error) HaveManifest(blobID ID) (bool, error) StoreManifest(blobID ID, manifest Manifest) error Chunk(sha3 types.Hash) ([]byte, error) HaveChunk(sha3 types.Hash) (bool, error) StoreChunkIfHashMatches(expectedSHA3 types.Hash, chunkBytes []byte) error // BlobIDs() *IDIterator BlobIDs() (sha1s, sha3s []ID, _ error) BlobsNeeded() ([]ID, error) MarkBlobsAsNeeded(refs []ID) error OnBlobsNeeded(fn func(refs []ID)) OnBlobsSaved(fn func()) Contents() (map[types.Hash]map[types.Hash]bool, error) DebugPrint() }
Click to show internal directories.
Click to hide internal directories.