Versions in this module Expand all Collapse all v1 v1.8.12 Jul 4, 2018 Changes in this version + const BatchSize + const HashSize + const High + const Low + const Mid + const PriorityQueue + const PriorityQueueCap + const Top + var Spec = &protocols.Spec + func FormatSyncBinKey(bin uint8) string + func ParseSyncBinKey(s string) (uint8, error) + func RegisterSwarmSyncerClient(streamer *Registry, db *storage.DBAPI) + func RegisterSwarmSyncerServer(streamer *Registry, db *storage.DBAPI) + type API struct + func NewAPI(r *Registry) *API + func (api *API) SubscribeStream(peerId discover.NodeID, s Stream, history *Range, priority uint8) error + func (api *API) UnsubscribeStream(peerId discover.NodeID, s Stream) error + type ChunkDeliveryMsg struct + Addr storage.Address + SData []byte + type Client interface + BatchDone func(Stream, uint64, []byte, []byte) func() (*TakeoverProof, error) + Close func() + NeedData func([]byte) func() + type Delivery struct + func NewDelivery(overlay network.Overlay, db *storage.DBAPI) *Delivery + func (d *Delivery) RequestFromPeers(hash []byte, skipCheck bool, peersToSkip ...discover.NodeID) error + type Handover struct + End uint64 + Root []byte + Start uint64 + Stream Stream + type HandoverProof struct + Sig []byte + type OfferedHashesMsg struct + From uint64 + Hashes []byte + Stream Stream + To uint64 + func (m OfferedHashesMsg) String() string + type Peer struct + func NewPeer(peer *protocols.Peer, streamer *Registry) *Peer + func (p *Peer) Deliver(chunk *storage.Chunk, priority uint8) error + func (p *Peer) HandleMsg(msg interface{}) error + func (p *Peer) SendOfferedHashes(s *server, f, t uint64) error + func (p *Peer) SendPriority(msg interface{}, priority uint8) error + type QuitMsg struct + Stream Stream + type Range struct + From uint64 + To uint64 + func NewRange(from, to uint64) *Range + func (r *Range) String() string + type Registry struct + func NewRegistry(addr *network.BzzAddr, delivery *Delivery, db *storage.DBAPI, ...) *Registry + func (r *Registry) APIs() []rpc.API + func (r *Registry) Close() error + func (r *Registry) GetClientFunc(stream string) (func(*Peer, string, bool) (Client, error), error) + func (r *Registry) GetServerFunc(stream string) (func(*Peer, string, bool) (Server, error), error) + func (r *Registry) NodeInfo() interface{} + func (r *Registry) PeerInfo(id discover.NodeID) interface{} + func (r *Registry) Protocols() []p2p.Protocol + func (r *Registry) Quit(peerId discover.NodeID, s Stream) error + func (r *Registry) RegisterClientFunc(stream string, f func(*Peer, string, bool) (Client, error)) + func (r *Registry) RegisterServerFunc(stream string, f func(*Peer, string, bool) (Server, error)) + func (r *Registry) RequestSubscription(peerId discover.NodeID, s Stream, h *Range, prio uint8) error + func (r *Registry) Retrieve(chunk *storage.Chunk) error + func (r *Registry) Run(p *network.BzzPeer) error + func (r *Registry) Start(server *p2p.Server) error + func (r *Registry) Stop() error + func (r *Registry) Subscribe(peerId discover.NodeID, s Stream, h *Range, priority uint8) error + func (r *Registry) Unsubscribe(peerId discover.NodeID, s Stream) error + type RegistryOptions struct + DoRetrieve bool + DoSync bool + SkipCheck bool + SyncUpdateDelay time.Duration + type RequestSubscriptionMsg struct + History *Range + Priority uint8 + Stream Stream + type RetrieveRequestMsg struct + Addr storage.Address + SkipCheck bool + type Server interface + Close func() + GetData func([]byte) ([]byte, error) + SetNextBatch func(uint64, uint64) (hashes []byte, from uint64, to uint64, proof *HandoverProof, err error) + type Stream struct + Key string + Live bool + Name string + func NewStream(name string, key string, live bool) Stream + func (s Stream) String() string + type SubscribeErrorMsg struct + Error string + type SubscribeMsg struct + History *Range + Priority uint8 + Stream Stream + type SwarmChunkServer struct + func NewSwarmChunkServer(db *storage.DBAPI) *SwarmChunkServer + func (s *SwarmChunkServer) Close() + func (s *SwarmChunkServer) GetData(key []byte) ([]byte, error) + func (s *SwarmChunkServer) SetNextBatch(_, _ uint64) (hashes []byte, from uint64, to uint64, proof *HandoverProof, err error) + type SwarmSyncerClient struct + func NewSwarmSyncerClient(p *Peer, db *storage.DBAPI, ignoreExistingRequest bool, stream Stream) (*SwarmSyncerClient, error) + func (s *SwarmSyncerClient) BatchDone(stream Stream, from uint64, hashes []byte, root []byte) func() (*TakeoverProof, error) + func (s *SwarmSyncerClient) Close() + func (s *SwarmSyncerClient) NeedData(key []byte) (wait func()) + func (s *SwarmSyncerClient) TakeoverProof(stream Stream, from uint64, hashes []byte, root storage.Address) (*TakeoverProof, error) + type SwarmSyncerServer struct + func NewSwarmSyncerServer(live bool, po uint8, db *storage.DBAPI) (*SwarmSyncerServer, error) + func (s *SwarmSyncerServer) Close() + func (s *SwarmSyncerServer) GetData(key []byte) ([]byte, error) + func (s *SwarmSyncerServer) SetNextBatch(from, to uint64) ([]byte, uint64, uint64, *HandoverProof, error) + type Takeover Handover + type TakeoverProof struct + Sig []byte + type TakeoverProofMsg TakeoverProof + func (m TakeoverProofMsg) String() string + type UnsubscribeMsg struct + Stream Stream + type WantedHashesMsg struct + From uint64 + Stream Stream + To uint64 + Want []byte + func (m WantedHashesMsg) String() string