peer

package
v0.0.0-...-300ac43 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2020 License: Apache-2.0 Imports: 50 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ReprovideInterval = 12 * time.Hour
)

Functions

func NewDatastore

func NewDatastore(path string) (datastore.Batching, error)

func NewLibp2pPeer

func NewLibp2pPeer(ctx context.Context, port int, pdef metadata.PeerDefinition, reporter metrics.Reporter) (host.Host, routing.ContentRouting, error)

func NewMuxerOption

func NewMuxerOption(muxerType string) (libp2p.Option, error)

func NewRoutingOption

func NewRoutingOption(ctx context.Context, routingType string) (libp2p.Option, routing.ContentRouting, error)

func NewSecurityOption

func NewSecurityOption(securityType string) (libp2p.Option, error)

func NewTransportOption

func NewTransportOption(transportType string, port int) (libp2p.Option, string, error)

Types

type Peer

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

func New

func New(ctx context.Context, root string, port int, pdef metadata.PeerDefinition) (*Peer, error)

func (*Peer) Add

func (p *Peer) Add(ctx context.Context, r io.Reader, opts ...p2plab.AddOption) (ipld.Node, error)

func (*Peer) Connect

func (p *Peer) Connect(ctx context.Context, infos []libp2ppeer.AddrInfo) error

func (*Peer) DAGService

func (p *Peer) DAGService() ipld.DAGService

func (*Peer) Disconnect

func (p *Peer) Disconnect(ctx context.Context, infos []libp2ppeer.AddrInfo) error

func (*Peer) FetchGraph

func (p *Peer) FetchGraph(ctx context.Context, c cid.Cid) error

func (*Peer) Get

func (p *Peer) Get(ctx context.Context, c cid.Cid) (files.Node, error)

func (*Peer) Host

func (p *Peer) Host() host.Host

func (*Peer) Report

func (p *Peer) Report(ctx context.Context) (metadata.ReportNode, error)

Jump to

Keyboard shortcuts

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