network

package
v1.5.15 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IHandlerF

type IHandlerF func(INode, conn.IConn, []byte)

type INode

type INode interface {
	types.ICommand

	GetSettings() ISettings
	GetConnections() map[string]conn.IConn

	AddConnection(string) error
	DelConnection(string) error

	HandleFunc(uint64, IHandlerF) INode
	BroadcastPayload(payload.IPayload) error
}

func NewNode

func NewNode(pSett ISettings) INode

Creating a node object managed by connections with multiple nodes. Saves hashes of received messages to a buffer to prevent network cycling. Redirects messages to handle routers by keys.

type ISettings

type ISettings interface {
	GetAddress() string
	GetCapacity() uint64
	GetMaxConnects() uint64
	GetWriteTimeout() time.Duration
	GetConnSettings() conn.ISettings
}

func NewSettings

func NewSettings(pSett *SSettings) ISettings

type SSettings

type SSettings sSettings

Directories

Path Synopsis
_examples

Jump to

Keyboard shortcuts

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