capability

package
v0.96.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2021 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 Serializable interface.

func (*Capabilities) EncodeBinary

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

EncodeBinary implements Serializable interface.

type Capability

type Capability struct {
	Type Type
	Data io.Serializable
}

Capability describes network service available for node.

func (*Capability) DecodeBinary

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

DecodeBinary implements Serializable interface.

func (*Capability) EncodeBinary

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

EncodeBinary implements Serializable interface.

type Node

type Node struct {
	StartHeight uint32
}

Node represents full node capability with start height.

func (*Node) DecodeBinary

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

DecodeBinary implements Serializable interface.

func (*Node) EncodeBinary

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

EncodeBinary implements Serializable interface.

type Server

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

Server represents TCP or WS server capability with port.

func (*Server) DecodeBinary

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

DecodeBinary implements Serializable interface.

func (*Server) EncodeBinary

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

EncodeBinary implements Serializable interface.

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