mesh

package
v0.0.0-...-27cef4d Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2019 License: LGPL-3.0 Imports: 2 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventHandler

type EventHandler interface {
	OnConnected(p Peer)
	OnDisconnected(p Peer)
	OnRecv(p Peer, r io.Reader, t message.Type) error
}

EventHandler is a event handler of the mesh

type Mesh

type Mesh interface {
	Add(netAddr string, doForce bool)
	Remove(netAddr string)
	RemoveByID(ID string)
	Ban(netAddr string, Seconds uint32)
	BanByID(ID string, Seconds uint32)
	Unban(netAddr string)
	Peers() []Peer
}

Mesh manages peer network

type Peer

type Peer interface {
	message.Sender
	ID() string
	NetAddr() string
}

Peer is a connected node with this node

Jump to

Keyboard shortcuts

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