network

package
v0.0.0-...-0852319 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const NetworkID = 0xf00b47

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

type Metrics struct {
	BytesDown    uint64
	BytesUp      uint64
	MessagesDown uint64
	MessagesUp   uint64
}

func (Metrics) BytesDownF

func (m Metrics) BytesDownF() string

func (Metrics) BytesUpF

func (m Metrics) BytesUpF() string

type Network

type Network interface {
	Init(name, port, seed string, bcast int) (func(), error)
	Name() string
	Peers() []string
	Metrics() Metrics
	DeliverMessage(string, []byte)
	ReadMessage() (string, []byte)
	Start()
	FullBroadcastFlag() string
	BroadcastFlag() string
	RandomFlag() string
}

func NewV10

func NewV10(version int) Network

func NewV9

func NewV9() Network

type V10

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

func (*V10) BroadcastFlag

func (v10 *V10) BroadcastFlag() string

func (*V10) DeliverMessage

func (v10 *V10) DeliverMessage(target string, payload []byte)

func (*V10) FullBroadcastFlag

func (v10 *V10) FullBroadcastFlag() string

func (*V10) Init

func (v10 *V10) Init(name, port, seed string, bcast int) (func(), error)

func (*V10) Metrics

func (v10 *V10) Metrics() Metrics

func (*V10) Name

func (v10 *V10) Name() string

func (*V10) Peers

func (v10 *V10) Peers() []string

func (*V10) RandomFlag

func (v10 *V10) RandomFlag() string

func (*V10) ReadMessage

func (v10 *V10) ReadMessage() (string, []byte)

func (*V10) Start

func (v10 *V10) Start()

type V9

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

func (*V9) BroadcastFlag

func (v9 *V9) BroadcastFlag() string

func (*V9) DeliverMessage

func (v9 *V9) DeliverMessage(target string, payload []byte)

func (*V9) FullBroadcastFlag

func (v9 *V9) FullBroadcastFlag() string

func (*V9) Init

func (v9 *V9) Init(name, port, seed string, bcast int) (func(), error)

func (*V9) Metrics

func (v9 *V9) Metrics() Metrics

func (*V9) Name

func (v9 *V9) Name() string

func (*V9) Peers

func (v9 *V9) Peers() []string

func (*V9) RandomFlag

func (v9 *V9) RandomFlag() string

func (*V9) ReadMessage

func (v9 *V9) ReadMessage() (string, []byte)

func (*V9) Start

func (v9 *V9) Start()

Jump to

Keyboard shortcuts

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