capability

package
v0.99.2-pre Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const MaxCapabilities = 32

MaxCapabilities is the maximum number of capabilities per payload.

Variables

This section is empty.

Functions

This section is empty.

Types

type Capabilities

type Capabilities []Capability

Capabilities is a list of Capability.

func (*Capabilities) DecodeBinary

func (cs *Capabilities) DecodeBinary(br *io.BinReader)

DecodeBinary implements io.Serializable.

func (*Capabilities) EncodeBinary

func (cs *Capabilities) EncodeBinary(br *io.BinWriter)

EncodeBinary implements io.Serializable.

type Capability

type Capability struct {
	Type Type
	Data io.Serializable
}

Capability describes a network service available for the node.

func (*Capability) DecodeBinary

func (c *Capability) DecodeBinary(br *io.BinReader)

DecodeBinary implements io.Serializable.

func (*Capability) EncodeBinary

func (c *Capability) EncodeBinary(bw *io.BinWriter)

EncodeBinary implements io.Serializable.

type Node

type Node struct {
	StartHeight uint32
}

Node represents full node capability with a start height.

func (*Node) DecodeBinary

func (n *Node) DecodeBinary(br *io.BinReader)

DecodeBinary implements io.Serializable.

func (*Node) EncodeBinary

func (n *Node) EncodeBinary(bw *io.BinWriter)

EncodeBinary implements io.Serializable.

type Server

type Server struct {
	// Port is the port this server is listening on.
	Port uint16
}

Server represents TCP or WS server capability with a port.

func (*Server) DecodeBinary

func (s *Server) DecodeBinary(br *io.BinReader)

DecodeBinary implements io.Serializable.

func (*Server) EncodeBinary

func (s *Server) EncodeBinary(bw *io.BinWriter)

EncodeBinary implements io.Serializable.

type Type

type Type byte

Type represents node capability type.

const (
	// TCPServer represents TCP node capability type.
	TCPServer Type = 0x01
	// WSServer represents WebSocket node capability type.
	WSServer Type = 0x02
	// FullNode represents full node capability type.
	FullNode Type = 0x10
)

Jump to

Keyboard shortcuts

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