peer

package
v0.0.36 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2019 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Peer

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

func NewPeer

func NewPeer(id identity.Identity, onLost func(mesh.PeerName), onUnicast func([]byte)) *Peer

func (*Peer) Gossip

func (p *Peer) Gossip() (complete mesh.GossipData)

func (*Peer) Join

func (p *Peer) Join(hosts []string)

func (*Peer) Members

func (p *Peer) Members() []mesh.PeerName

func (*Peer) Name

func (p *Peer) Name() mesh.PeerName

func (*Peer) OnGossip

func (p *Peer) OnGossip(buf []byte) (delta mesh.GossipData, err error)

func (*Peer) OnGossipBroadcast

func (p *Peer) OnGossipBroadcast(src mesh.PeerName, buf []byte) (received mesh.GossipData, err error)

func (*Peer) OnGossipUnicast

func (p *Peer) OnGossipUnicast(src mesh.PeerName, buf []byte) error

func (*Peer) Router

func (p *Peer) Router() *mesh.Router

func (*Peer) Send

func (p *Peer) Send(recipient mesh.PeerName, payload []byte)

func (*Peer) Start added in v0.0.21

func (p *Peer) Start()

Jump to

Keyboard shortcuts

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