nodepoolmanage

package
v0.0.0-...-6ee0886 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2021 License: LGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIsBanAddress       = errors.New("is ban address")
	ErrIsAlreadyConnected = errors.New("is already connected")
)

router error list

View Source
var (
	ErrNotFoundPeer = errors.New("not found peer")
)

peer errors

Functions

This section is empty.

Types

type BanAlways

type BanAlways struct {
	Map map[string]bool
}

BanAlways implements sort.Interface for []BanPeerInfo on the Timeout field.

func NewBanAlways

func NewBanAlways() *BanAlways

func (*BanAlways) Add

func (a *BanAlways) Add(Hash string)

func (*BanAlways) Delete

func (a *BanAlways) Delete(Hash string)

func (*BanAlways) IsBan

func (a *BanAlways) IsBan(hash string) bool

type Manager

type Manager interface {
	NewNode(addr string, hash string, ping time.Duration) error
	AddPeerList(ips []string, hashs []string)
	GetPeerList() (ips []string, hashs []string)
	RemovePeer(hash string)
	Ban(hash string)
	Unban(Hash string)
}

Manager manages peer-connected networks.

func NewNodePoolManage

func NewNodePoolManage(StorePath string, nodeMesh nodeMesh, pubhash common.PublicHash) (Manager, error)

NewNodePoolManage is the peerManager creator. Apply messages necessary for peer management.

Jump to

Keyboard shortcuts

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