node

package
v0.0.0-...-6348706 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

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

func NewNode

func NewNode(log *logger.Logger, ip string, newAddrCh chan []string) *Node

func (*Node) Connect

func (n *Node) Connect(ctx context.Context, resCh chan *Node) error

returning error here will consider the node as dead

func (*Node) Disconnect

func (n *Node) Disconnect() bool

func (*Node) Endpoint

func (n *Node) Endpoint() string

func (*Node) EndpointSafe

func (n *Node) EndpointSafe() string

wrapper with brackets for ipv6 needed for net.Dial

func (*Node) IsConnected

func (n *Node) IsConnected() bool

func (*Node) IsConnecting

func (n *Node) IsConnecting() bool

func (*Node) IsDead

func (n *Node) IsDead() bool

func (*Node) IsNew

func (n *Node) IsNew() bool

func (*Node) UpdatePingNonce

func (n *Node) UpdatePingNonce()

type Result

type Result struct {
	Node  *Node
	Error error
}

Jump to

Keyboard shortcuts

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