node

package
v0.0.0-...-7efe5ce Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2019 License: GPL-3.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ILocalNode

type ILocalNode interface {
	Interface
	GetPrivateKey() *ecdsa.PrivateKey
	GetLaunchTime() time.Time
}

type Interface

type Interface interface {
	GetIDBytes() []byte
	GetID() string
	GetPublicKey() string
	GetIP() net.IP
	GetPort() int
	RefreshNode(ip string, port int)
}

type LocalNode

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

func NewLocalNode

func NewLocalNode() *LocalNode

func (*LocalNode) DiscoverNAT

func (n *LocalNode) DiscoverNAT()

func (*LocalNode) GetLaunchTime

func (ln *LocalNode) GetLaunchTime() time.Time

func (*LocalNode) GetPrivateKey

func (ln *LocalNode) GetPrivateKey() *ecdsa.PrivateKey

func (*LocalNode) SetRemoteIPPort

func (n *LocalNode) SetRemoteIPPort(ip string, port int)

type Node

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

func (*Node) GetID

func (n *Node) GetID() string

func (*Node) GetIDBytes

func (n *Node) GetIDBytes() []byte

func (*Node) GetLocalIP

func (n *Node) GetLocalIP() net.IP

func (*Node) GetLocalPort

func (n *Node) GetLocalPort() int

func (*Node) GetNetwork

func (n *Node) GetNetwork() string

func (*Node) GetPublicKey

func (n *Node) GetPublicKey() string

func (*Node) GetRemoteIP

func (n *Node) GetRemoteIP() net.IP

func (*Node) GetRemotePort

func (n *Node) GetRemotePort() int

type RemoteNode

type RemoteNode struct {
	Node
	Distance       int
	Latency        int
	LastActiveTime time.Time
}

func NewRemoteNode

func NewRemoteNode(id []byte, localIP net.IP, localPort int, remoteIP net.IP, remotePort int) *RemoteNode

func (*RemoteNode) GetSendIPWithPort

func (r *RemoteNode) GetSendIPWithPort(local *LocalNode) (net.IP, int)

func (*RemoteNode) RefreshNode

func (r *RemoteNode) RefreshNode(localIP string, localPort int, remoteIP string, remotePort int, latency int)

func (*RemoteNode) SetPublicKey

func (r *RemoteNode) SetPublicKey(keyStr string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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