retrieval

package
v0.4.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2019 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoPeerFound = errors.New("no peer found")
)

Functions

This section is empty.

Types

type ChunkDelivery

type ChunkDelivery struct {
	Addr  storage.Address
	SData []byte // the stored chunk Data (incl size)
}

ChunkDelivery is the protocol msg for delivering a solicited chunk to a peer

type Peer

type Peer struct {
	*network.BzzPeer
	// contains filtered or unexported fields
}

Peer wraps BzzPeer with a contextual logger for this peer

func NewPeer

func NewPeer(peer *network.BzzPeer) *Peer

NewPeer is the constructor for Peer

type Retrieval

type Retrieval struct {
	// contains filtered or unexported fields
}

Retrieval holds state and handles protocol messages for the `bzz-retrieve` protocol

func New

func New(kad *network.Kademlia, ns *storage.NetStore) *Retrieval

NewRetrieval returns a new instance of the retrieval protocol handler

func (*Retrieval) APIs

func (r *Retrieval) APIs() []rpc.API

func (*Retrieval) Protocols

func (r *Retrieval) Protocols() []p2p.Protocol

func (*Retrieval) RequestFromPeers

func (r *Retrieval) RequestFromPeers(ctx context.Context, req *storage.Request, localID enode.ID) (*enode.ID, error)

RequestFromPeers sends a chunk retrieve request to the next found peer

func (*Retrieval) Run

func (r *Retrieval) Run(p *p2p.Peer, rw p2p.MsgReadWriter) error

Run protocol function

func (*Retrieval) Start

func (r *Retrieval) Start(server *p2p.Server) error

func (*Retrieval) Stop

func (r *Retrieval) Stop() error

type RetrieveRequest

type RetrieveRequest struct {
	Addr storage.Address
}

RetrieveRequestMsg is the protocol msg for chunk retrieve requests

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL