Versions in this module Expand all Collapse all v1 v1.0.0 May 3, 2020 Changes in this version + const BMTHash + const ChunkProcessors + const DataChunk + const DefaultBranches + const SHA3Hash + const TreeChunk + var ZeroKey = Key(common.Hash{}.Bytes()) + func BytesToU64(data []byte) uint64 + func IsZeroKey(key Key) bool + func NewDpaChunkStore(localStore, netStore ChunkStore) *dpaChunkStore + func U64ToBytes(val uint64) []byte + type Chunk struct + C chan bool + Key Key + Req *RequestStatus + SData []byte + Size int64 + Source Peer + func NewChunk(key Key, rs *RequestStatus) *Chunk + func (self *Chunk) String() string + type ChunkStore interface + Close func() + Get func(Key) (*Chunk, error) + Put func(*Chunk) + type Chunker interface + type ChunkerParams struct + Branches int64 + Hash string + func NewChunkerParams() *ChunkerParams + type CloudStore interface + Deliver func(*Chunk) + Retrieve func(*Chunk) + Store func(*Chunk) + type DPA struct + Chunker Chunker + func NewDPA(store ChunkStore, params *ChunkerParams) *DPA + func NewLocalDPA(datadir string) (*DPA, error) + func (self *DPA) Retrieve(key Key) LazySectionReader + func (self *DPA) Start() + func (self *DPA) Stop() + func (self *DPA) Store(data io.Reader, size int64, swg *sync.WaitGroup, wwg *sync.WaitGroup) (key Key, err error) + type DbStore struct + func NewDbStore(path string, hash SwarmHasher, capacity uint64, radius int) (s *DbStore, err error) + func (s *DbStore) Cleanup() + func (s *DbStore) Close() + func (s *DbStore) Counter() uint64 + func (s *DbStore) Export(out io.Writer) (int64, error) + func (s *DbStore) Get(key Key) (chunk *Chunk, err error) + func (s *DbStore) Import(in io.Reader) (int64, error) + func (s *DbStore) Put(chunk *Chunk) + func (self *DbStore) NewSyncIterator(state DbSyncState) (si *dbSyncIterator, err error) + type DbSyncState struct + First uint64 + Last uint64 + Start Key + Stop Key + type HashWithLength struct + func (self *HashWithLength) ResetWithLength(length []byte) + type Hasher func() hash.Hash + type Joiner interface + Join func(key Key, chunkC chan *Chunk) LazySectionReader + type Key []byte + func (key *Key) UnmarshalJSON(value []byte) error + func (key Key) Hex() string + func (key Key) Log() string + func (key Key) MarshalJSON() (out []byte, err error) + func (key Key) String() string + func (x Key) Size() uint + type LDBDatabase struct + func NewLDBDatabase(file string) (*LDBDatabase, error) + func (self *LDBDatabase) Close() + func (self *LDBDatabase) Delete(key []byte) error + func (self *LDBDatabase) Get(key []byte) ([]byte, error) + func (self *LDBDatabase) LastKnownTD() []byte + func (self *LDBDatabase) NewIterator() iterator.Iterator + func (self *LDBDatabase) Put(key []byte, value []byte) + func (self *LDBDatabase) Write(batch *leveldb.Batch) error + type LazyChunkReader struct + func (s *LazyChunkReader) Seek(offset int64, whence int) (int64, error) + func (self *LazyChunkReader) Read(b []byte) (read int, err error) + func (self *LazyChunkReader) ReadAt(b []byte, off int64) (read int, err error) + func (self *LazyChunkReader) Size(quitC chan bool) (n int64, err error) + type LazySectionReader interface + Size func(chan bool) (int64, error) + type LazyTestSectionReader struct + func (self *LazyTestSectionReader) Size(chan bool) (int64, error) + type LocalStore struct + DbStore ChunkStore + func NewLocalStore(hash SwarmHasher, params *StoreParams) (*LocalStore, error) + func (self *LocalStore) CacheCounter() uint64 + func (self *LocalStore) Close() + func (self *LocalStore) DbCounter() uint64 + func (self *LocalStore) Get(key Key) (chunk *Chunk, err error) + func (self *LocalStore) Put(chunk *Chunk) + type MemStore struct + func NewMemStore(d *DbStore, capacity uint) (m *MemStore) + func (s *MemStore) Close() + func (s *MemStore) Counter() uint + func (s *MemStore) Get(hash Key) (chunk *Chunk, err error) + func (s *MemStore) Put(entry *Chunk) + type NetStore struct + func NewNetStore(hash SwarmHasher, lstore *LocalStore, cloud CloudStore, params *StoreParams) *NetStore + func (self *NetStore) Close() + func (self *NetStore) Get(key Key) (*Chunk, error) + func (self *NetStore) Put(entry *Chunk) + type Peer interface + type PyramidChunker struct + func NewPyramidChunker(params *ChunkerParams) (self *PyramidChunker) + func (self *PyramidChunker) Append(key Key, data io.Reader, chunkC chan *Chunk, ...) (Key, error) + func (self *PyramidChunker) Join(key Key, chunkC chan *Chunk) LazySectionReader + func (self *PyramidChunker) Split(data io.Reader, size int64, chunkC chan *Chunk, ...) (Key, error) + type RequestStatus struct + C chan bool + Key Key + Requesters map[uint64][]interface{} + Source Peer + type Splitter interface + Append func(Key, io.Reader, chan *Chunk, *sync.WaitGroup, *sync.WaitGroup) (Key, error) + Split func(io.Reader, int64, chan *Chunk, *sync.WaitGroup, *sync.WaitGroup) (Key, error) + type StoreParams struct + CacheCapacity uint + ChunkDbPath string + DbCapacity uint64 + Radius int + func NewDefaultStoreParams() (self *StoreParams) + func (self *StoreParams) Init(path string) + type SwarmHash interface + ResetWithLength func([]byte) + type SwarmHasher func() SwarmHash + func MakeHashFunc(hash string) SwarmHasher + type TreeChunker struct + func NewTreeChunker(params *ChunkerParams) (self *TreeChunker) + func (self *TreeChunker) Append(key Key, data io.Reader, chunkC chan *Chunk, swg, wwg *sync.WaitGroup) (Key, error) + func (self *TreeChunker) Join(key Key, chunkC chan *Chunk) LazySectionReader + func (self *TreeChunker) Split(data io.Reader, size int64, chunkC chan *Chunk, swg, wwg *sync.WaitGroup) (Key, error) + type TreeEntry struct + func NewTreeEntry(pyramid *PyramidChunker) *TreeEntry