node

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPort = 8333
)

Variables

This section is empty.

Functions

func GetLocalhost

func GetLocalhost() net.IP

Types

type Group

type Group struct {
	Nodes      map[string]*Server
	Looping    bool
	LastPeerId []byte
	StartTime  time.Time
}

func NewGroup

func NewGroup() *Group

func (*Group) AddDefaultNode

func (g *Group) AddDefaultNode()

func (*Group) AddNextNode

func (g *Group) AddNextNode() error

func (*Group) AddNode

func (g *Group) AddNode(ip []byte, port uint16)

func (Group) HasActive

func (g Group) HasActive() bool

type Server

type Server struct {
	Peer *peer.Peer
	Ip   []byte
	Port uint16
}

func NewServer

func NewServer(ip []byte, port uint16) *Server

func (*Server) Disconnect

func (s *Server) Disconnect()

func (*Server) GetAddr

func (s *Server) GetAddr() error

func (*Server) Run

func (s *Server) Run() error

func (*Server) SaveConnectionResult

func (s *Server) SaveConnectionResult(success bool) error

Directories

Path Synopsis
act
obj
get
run

Jump to

Keyboard shortcuts

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