Documentation ¶
Index ¶
- Constants
- Variables
- 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
- type ChunkDeliveryMsg
- type Client
- type Delivery
- type Handover
- type HandoverProof
- type OfferedHashesMsg
- type Peer
- func (p *Peer) Deliver(ctx context.Context, chunk *storage.Chunk, priority uint8) error
- func (p *Peer) HandleMsg(ctx context.Context, msg interface{}) error
- func (p *Peer) SendOfferedHashes(s *server, f, t uint64) error
- func (p *Peer) SendPriority(ctx context.Context, msg interface{}, priority uint8) error
- type QuitMsg
- type Range
- type 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(ctx context.Context, 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
- type RequestSubscriptionMsg
- type RetrieveRequestMsg
- type Server
- type Stream
- type SubscribeErrorMsg
- type SubscribeMsg
- type SwarmChunkServer
- type SwarmSyncerClient
- func (s *SwarmSyncerClient) BatchDone(stream Stream, from uint64, hashes []byte, root []byte) func() (*TakeoverProof, error)
- func (s *SwarmSyncerClient) Close()
- func (s *SwarmSyncerClient) NeedData(ctx context.Context, key []byte) (wait func())
- func (s *SwarmSyncerClient) TakeoverProof(stream Stream, from uint64, hashes []byte, root storage.Address) (*TakeoverProof, error)
- type SwarmSyncerServer
- type Takeover
- type TakeoverProof
- type TakeoverProofMsg
- type UnsubscribeMsg
- type WantedHashesMsg
- type WrappedPriorityMsg
Constants ¶
View Source
const ( Low uint8 = iota Mid High Top PriorityQueue // PriorityQueueCap = 32 // HashSize = 32 )
View Source
const (
//
BatchSize = 128
)
Variables ¶
View Source
var Spec = &protocols.Spec{ Name: "stream", Version: 5, MaxMsgSize: 10 * 1024 * 1024, Messages: []interface{}{ UnsubscribeMsg{}, OfferedHashesMsg{}, WantedHashesMsg{}, TakeoverProofMsg{}, SubscribeMsg{}, RetrieveRequestMsg{}, ChunkDeliveryMsg{}, SubscribeErrorMsg{}, RequestSubscriptionMsg{}, QuitMsg{}, }, }
Functions ¶
func FormatSyncBinKey ¶
func ParseSyncBinKey ¶
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func (*API) SubscribeStream ¶
type ChunkDeliveryMsg ¶
type HandoverProof ¶
type OfferedHashesMsg ¶
type OfferedHashesMsg struct { Stream Stream // From, To uint64 // Hashes []byte // *HandoverProof // }
func (OfferedHashesMsg) String ¶
func (m OfferedHashesMsg) String() string
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func (*Registry) GetClientFunc ¶
func (*Registry) GetServerFunc ¶
func (*Registry) RegisterClientFunc ¶
func (*Registry) RegisterServerFunc ¶
func (*Registry) RequestSubscription ¶
type RegistryOptions ¶
type RequestSubscriptionMsg ¶
type RetrieveRequestMsg ¶
type SubscribeErrorMsg ¶
type SubscribeErrorMsg struct {
Error string
}
type SubscribeMsg ¶
type SwarmChunkServer ¶
type SwarmChunkServer struct {
// contains filtered or unexported fields
}
func NewSwarmChunkServer ¶
func NewSwarmChunkServer(db *storage.DBAPI) *SwarmChunkServer
func (*SwarmChunkServer) Close ¶
func (s *SwarmChunkServer) Close()
func (*SwarmChunkServer) SetNextBatch ¶
func (s *SwarmChunkServer) SetNextBatch(_, _ uint64) (hashes []byte, from uint64, to uint64, proof *HandoverProof, err error)
type SwarmSyncerClient ¶
type SwarmSyncerClient struct {
// contains filtered or unexported fields
}
func NewSwarmSyncerClient ¶
func (*SwarmSyncerClient) BatchDone ¶
func (s *SwarmSyncerClient) BatchDone(stream Stream, from uint64, hashes []byte, root []byte) func() (*TakeoverProof, error)
func (*SwarmSyncerClient) Close ¶
func (s *SwarmSyncerClient) Close()
func (*SwarmSyncerClient) NeedData ¶
func (s *SwarmSyncerClient) NeedData(ctx context.Context, key []byte) (wait func())
func (*SwarmSyncerClient) TakeoverProof ¶
func (s *SwarmSyncerClient) TakeoverProof(stream Stream, from uint64, hashes []byte, root storage.Address) (*TakeoverProof, error)
type SwarmSyncerServer ¶
type SwarmSyncerServer struct {
// contains filtered or unexported fields
}
func NewSwarmSyncerServer ¶
func (*SwarmSyncerServer) Close ¶
func (s *SwarmSyncerServer) Close()
func (*SwarmSyncerServer) SetNextBatch ¶
func (s *SwarmSyncerServer) SetNextBatch(from, to uint64) ([]byte, uint64, uint64, *HandoverProof, error)
type TakeoverProof ¶
type TakeoverProofMsg ¶
type TakeoverProofMsg TakeoverProof
func (TakeoverProofMsg) String ¶
func (m TakeoverProofMsg) String() string
type UnsubscribeMsg ¶
type UnsubscribeMsg struct {
Stream Stream
}
type WantedHashesMsg ¶
func (WantedHashesMsg) String ¶
func (m WantedHashesMsg) String() string
type WrappedPriorityMsg ¶
Click to show internal directories.
Click to hide internal directories.