Versions in this module Expand all Collapse all v0 v0.4.2 Jun 28, 2019 v0.4.1 Jun 13, 2019 Changes in this version + const AddressLength + const DefaultSize + const MaxPO + var ErrChunkInvalid = errors.New("invalid chunk") + var ErrChunkNotFound = errors.New("chunk not found") + var ZeroAddr = Address(common.Hash{}.Bytes()) + func Proximity(one, other []byte) (ret int) + type Address []byte + func (a *Address) UnmarshalJSON(value []byte) error + func (a Address) Hex() string + func (a Address) Log() string + func (a Address) MarshalJSON() (out []byte, err error) + func (a Address) String() string + type Chunk interface + Address func() Address + Data func() []byte + func NewChunk(addr Address, data []byte) Chunk + type Descriptor struct + Address Address + BinID uint64 + func (d *Descriptor) String() string + type ModeGet int + const ModeGetLookup + const ModeGetRequest + const ModeGetSync + func (m ModeGet) String() string + type ModePut int + const ModePutRequest + const ModePutSync + const ModePutUpload + func (m ModePut) String() string + type ModeSet int + const ModeSetAccess + const ModeSetRemove + const ModeSetSync + func (m ModeSet) String() string + type State = uint32 + const StateSeen + const StateSent + const StateSplit + const StateStored + const StateSynced + type Store interface + Close func() (err error) + Get func(ctx context.Context, mode ModeGet, addr Address) (ch Chunk, err error) + Has func(ctx context.Context, addr Address) (yes bool, err error) + LastPullSubscriptionBinID func(bin uint8) (id uint64, err error) + Put func(ctx context.Context, mode ModePut, ch Chunk) (exists bool, err error) + Set func(ctx context.Context, mode ModeSet, addr Address) (err error) + SubscribePull func(ctx context.Context, bin uint8, since, until uint64) (c <-chan Descriptor, stop func()) + type Tag struct + Address Address + Name string + Uid uint32 + func NewTag(uid uint32, s string, total int64) *Tag + func (t *Tag) DoneSplit(address Address) int64 + func (t *Tag) ETA(state State) (time.Time, error) + func (t *Tag) Get(state State) int64 + func (t *Tag) Inc(state State) + func (t *Tag) Status(state State) (int64, int64, error) + func (t *Tag) Total() int64 + func (tag *Tag) MarshalBinary() (data []byte, err error) + func (tag *Tag) UnmarshalBinary(buffer []byte) error + type Tags struct + func NewTags() *Tags + func (ts *Tags) All() (t []*Tag) + func (ts *Tags) Delete(k interface{}) + func (ts *Tags) Get(uid uint32) (*Tag, error) + func (ts *Tags) GetFromContext(ctx context.Context) (*Tag, error) + func (ts *Tags) New(s string, total int64) (*Tag, error) + func (ts *Tags) Range(fn func(k, v interface{}) bool) + type Validator interface + Validate func(ch Chunk) bool + type ValidatorStore struct + func NewValidatorStore(store Store, validators ...Validator) (s *ValidatorStore) + func (s *ValidatorStore) Put(ctx context.Context, mode ModePut, ch Chunk) (exists bool, err error)