plugins

package
v0.3.13 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: MIT Imports: 13 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bootstrap

type Bootstrap struct {
	*libp2p.Plugin
	Addrs []string
}

Bootstrap bootstrap plugin

func (*Bootstrap) Startup

func (d *Bootstrap) Startup(net libp2p.Network)

Startup is called only once when the plugin is loaded

type Broadcast

type Broadcast struct {
	*libp2p.Plugin

	Limit int
	// contains filtered or unexported fields
}

Broadcast broadcast message to all connection

func (*Broadcast) Broadcast

func (b *Broadcast) Broadcast(msg interface{})

Broadcast Broadcast message

func (*Broadcast) PeerConnect

func (b *Broadcast) PeerConnect(s libp2p.Session)

PeerConnect is called every time a Session is initialized and connected

func (*Broadcast) PeerDisconnect

func (b *Broadcast) PeerDisconnect(s libp2p.Session)

PeerDisconnect is called every time a Session connection is closed

func (*Broadcast) RandSend

func (b *Broadcast) RandSend(msg interface{}) error

RandSend send message to one connection

func (*Broadcast) RecInternalMsg

func (b *Broadcast) RecInternalMsg(msg libp2p.InterMsg) error

RecInternalMsg internal msg

func (*Broadcast) Startup added in v0.2.13

func (b *Broadcast) Startup(net libp2p.Network)

Startup Startup

type DiscoveryPlugin

type DiscoveryPlugin struct {
	*libp2p.Plugin
	// contains filtered or unexported fields
}

DiscoveryPlugin discovery plugin of dht

func (*DiscoveryPlugin) PeerConnect

func (d *DiscoveryPlugin) PeerConnect(s libp2p.Session)

PeerConnect is called every time a PeerSession is initialized and connected

func (*DiscoveryPlugin) PeerDisconnect

func (d *DiscoveryPlugin) PeerDisconnect(s libp2p.Session)

PeerDisconnect is called every time a PeerSession connection is closed

func (*DiscoveryPlugin) Receive

func (d *DiscoveryPlugin) Receive(e libp2p.Event) error

Receive is called every time when messages are received

func (*DiscoveryPlugin) Startup

func (d *DiscoveryPlugin) Startup(net libp2p.Network)

Startup is called only once when the plugin is loaded

type Find

type Find struct {
	Key []byte
}

Find find other nodes

type NatTraversal

type NatTraversal struct {
	FromAddr string
	ToAddr   string
}

NatTraversal try nat traversal by proxy node

type Nodes

type Nodes struct {
	Addresses []string
}

Nodes nodes

type Ping

type Ping struct {
	IsServer bool
}

Ping dht ping

type Pong

type Pong struct {
	FromAddr string
	IsServer bool
	ToAddr   string
}

Pong dht pong

type SingleConn added in v0.2.10

type SingleConn struct {
	*libp2p.Plugin
	// contains filtered or unexported fields
}

SingleConn limit one connection pre user

func (*SingleConn) PeerConnect added in v0.2.10

func (p *SingleConn) PeerConnect(s libp2p.Session)

PeerConnect PeerConnect

func (*SingleConn) PeerDisconnect added in v0.2.10

func (p *SingleConn) PeerDisconnect(s libp2p.Session)

PeerDisconnect PeerDisconnect

func (*SingleConn) Startup added in v0.2.10

func (p *SingleConn) Startup(net libp2p.Network)

Startup Startup

Jump to

Keyboard shortcuts

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