message_content

package
v0.0.0-...-58ee6da Latest Latest
Warning

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

Go to latest
Published: May 23, 2020 License: Unlicense Imports: 8 Imported by: 0

Documentation

Overview

TODO: the Java version sends V1 join messages during the startup process, but V2s in some other contexts. Clarify whether this is really needed, or whether we can just live with V2 everywhere.

TODO: the Java version sends V1 join messages during the startup process, but V2s in some other contexts. Clarify whether this is really needed, or whether we can just live with V2 everywhere.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockRequest

type BlockRequest struct {
	StartHeight        int64
	EndHeight          int64
	IncludeBalanceList bool
}

func NewBlockRequest

func NewBlockRequest(startHeight, endHeight int64, includeBalanceList bool) *BlockRequest

func (*BlockRequest) GetSerializedLength

func (c *BlockRequest) GetSerializedLength() int

Serializable interface: data length when serialized

func (*BlockRequest) Read

func (c *BlockRequest) Read(r io.Reader) error

Serializable interface: convert from bytes.

func (*BlockRequest) ToBytes

func (c *BlockRequest) ToBytes() []byte

Serializable interface: convert to bytes.

type BlockResponse

type BlockResponse struct {
	BalanceList *blockchain_data.BalanceList
	Blocks      []*blockchain_data.Block
}

func NewBlockResponse

func NewBlockResponse(balanceList *blockchain_data.BalanceList, blocks []*blockchain_data.Block) *BlockResponse

func (*BlockResponse) GetSerializedLength

func (c *BlockResponse) GetSerializedLength() int

Serializable interface: data length when serialized

func (*BlockResponse) Read

func (c *BlockResponse) Read(r io.Reader) error

Serializable interface: convert from bytes.

func (*BlockResponse) ToBytes

func (c *BlockResponse) ToBytes() []byte

Serializable interface: convert to bytes.

type BlockWithVotesRequest

type BlockWithVotesRequest struct {
	Height int64
}

func NewBlockWithVotesRequest

func NewBlockWithVotesRequest(height int64) *BlockWithVotesRequest

func (*BlockWithVotesRequest) GetSerializedLength

func (c *BlockWithVotesRequest) GetSerializedLength() int

Serializable interface: data length when serialized

func (*BlockWithVotesRequest) Read

func (c *BlockWithVotesRequest) Read(r io.Reader) error

Serializable interface: convert from bytes.

func (*BlockWithVotesRequest) ToBytes

func (c *BlockWithVotesRequest) ToBytes() []byte

Serializable interface: convert to bytes.

type BlockWithVotesResponse

type BlockWithVotesResponse struct {
	Block *blockchain_data.Block
	Votes []*blockchain_data.BlockVote
}

func (*BlockWithVotesResponse) GetSerializedLength

func (r *BlockWithVotesResponse) GetSerializedLength() int

Serializable interface: data length when serialized

func (*BlockWithVotesResponse) Read

func (r *BlockWithVotesResponse) Read(re io.Reader) error

Serializable interface: convert from bytes.

func (*BlockWithVotesResponse) ToBytes

func (r *BlockWithVotesResponse) ToBytes() []byte

Serializable interface: convert to bytes.

type BooleanResponse

type BooleanResponse struct {
	Success bool
	Message string
}

func NewBooleanResponse

func NewBooleanResponse(success bool, message string) *BooleanResponse

func (*BooleanResponse) GetSerializedLength

func (c *BooleanResponse) GetSerializedLength() int

Serializable interface: data length when serialized

func (*BooleanResponse) Read

func (c *BooleanResponse) Read(r io.Reader) error

Serializable interface: convert from bytes.

func (*BooleanResponse) ToBytes

func (c *BooleanResponse) ToBytes() []byte

Serializable interface: convert to bytes.

type BootstrapRequest

type BootstrapRequest struct {
	Port int32
}

func NewBootstrapRequest

func NewBootstrapRequest(port int32) *BootstrapRequest

func (*BootstrapRequest) GetSerializedLength

func (c *BootstrapRequest) GetSerializedLength() int

Serializable interface: data length when serialized

func (*BootstrapRequest) Read

func (c *BootstrapRequest) Read(r io.Reader) error

Serializable interface: convert from bytes.

func (*BootstrapRequest) ToBytes

func (c *BootstrapRequest) ToBytes() []byte

Serializable interface: convert to bytes.

type BootstrapResponse

type BootstrapResponse struct {
	FrozenEdgeHeight int64
	FrozenEdgeHash   []byte
	CycleVerifiers   [][]byte
}

func NewBootstrapRespone

func NewBootstrapRespone(frozenEdgeHeight int64, frozenEdgeHash []byte, cycleVerifiers [][]byte) *BootstrapResponse

func (*BootstrapResponse) GetSerializedLength

func (c *BootstrapResponse) GetSerializedLength() int

Serializable interface: data length when serialized

func (*BootstrapResponse) Read

func (c *BootstrapResponse) Read(r io.Reader) error

Serializable interface: convert from bytes.

func (*BootstrapResponse) ToBytes

func (c *BootstrapResponse) ToBytes() []byte

Serializable interface: convert to bytes.

type Default

type Default struct {
	Content []byte
}

default message content if we don't know how to serialize/deserialize it

func (*Default) GetSerializedLength

func (c *Default) GetSerializedLength() int

Serializable interface: data length when serialized.

func (*Default) Read

func (c *Default) Read(r io.Reader) error

Serializable interface: from data bytes.

func (*Default) ToBytes

func (c *Default) ToBytes() []byte

Serializable interface: to data bytes.

type IpAddress

type IpAddress struct {
	Address []byte
}

func NewIpAddress

func NewIpAddress(address []byte) *IpAddress

func (*IpAddress) GetSerializedLength

func (c *IpAddress) GetSerializedLength() int

Serializable interface: data length when serialized

func (*IpAddress) Read

func (c *IpAddress) Read(r io.Reader) error

Serializable interface: convert from bytes.

func (*IpAddress) ToBytes

func (c *IpAddress) ToBytes() []byte

Serializable interface: convert to bytes.

type MeshResponse

type MeshResponse struct {
	Nodes []*node.Node
}

func NewMeshResponse

func NewMeshResponse(nodes []*node.Node) *MeshResponse

Create a new mesh response message with the given nodes.

func (*MeshResponse) GetSerializedLength

func (c *MeshResponse) GetSerializedLength() int

Serializable interface: data length when serialized.

func (*MeshResponse) Read

func (c *MeshResponse) Read(r io.Reader) error

Serializable interface: read nodes from data bytes.

func (*MeshResponse) ToBytes

func (c *MeshResponse) ToBytes() []byte

Serializable interface: write notes to data bytes.

type MissingBlockRequest

type MissingBlockRequest struct {
	Height int64
	Hash   []byte
}

func NewMissingBlockRequest

func NewMissingBlockRequest(height int64, hash []byte) *MissingBlockRequest

func (*MissingBlockRequest) GetSerializedLength

func (c *MissingBlockRequest) GetSerializedLength() int

Serializable interface: data length when serialized

func (*MissingBlockRequest) Read

func (c *MissingBlockRequest) Read(r io.Reader) error

Serializable interface: convert from bytes.

func (*MissingBlockRequest) ToBytes

func (c *MissingBlockRequest) ToBytes() []byte

Serializable interface: convert to bytes.

type MissingBlockVoteRequest

type MissingBlockVoteRequest struct {
	Height int64
}

func NewMissingBlockVoteRequest

func NewMissingBlockVoteRequest(height int64) *MissingBlockVoteRequest

func (*MissingBlockVoteRequest) GetSerializedLength

func (c *MissingBlockVoteRequest) GetSerializedLength() int

Serializable interface: data length when serialized

func (*MissingBlockVoteRequest) Read

Serializable interface: convert from bytes.

func (*MissingBlockVoteRequest) ToBytes

func (c *MissingBlockVoteRequest) ToBytes() []byte

Serializable interface: convert to bytes.

type NewVerifierVote

type NewVerifierVote struct {
	Identifier []byte
}

func NewNewVerifierVote

func NewNewVerifierVote(identifier []byte) *NewVerifierVote

func (*NewVerifierVote) GetSerializedLength

func (c *NewVerifierVote) GetSerializedLength() int

Serializable interface: data length when serialized

func (*NewVerifierVote) Read

func (c *NewVerifierVote) Read(r io.Reader) error

Serializable interface: convert from bytes.

func (*NewVerifierVote) ToBytes

func (c *NewVerifierVote) ToBytes() []byte

Serializable interface: convert to bytes.

type NodeJoin

type NodeJoin struct {
	PortTcp  int32
	PortUdp  int32
	Nickname string
}

func NewNodeJoin

func NewNodeJoin(portTcp, portUdp int32, nickname string) *NodeJoin

func (*NodeJoin) GetSerializedLength

func (c *NodeJoin) GetSerializedLength() int

Serializable interface: data length when serialized

func (*NodeJoin) Read

func (c *NodeJoin) Read(r io.Reader) error

Serializable interface: convert from bytes.

func (*NodeJoin) ToBytes

func (c *NodeJoin) ToBytes() []byte

Serializable interface: convert to bytes.

type NodeJoinLegacy

type NodeJoinLegacy struct {
	Port     int32
	Nickname string
}

func NewNodeJoinLegacy

func NewNodeJoinLegacy(port int32, nickname string) *NodeJoinLegacy

func (*NodeJoinLegacy) GetSerializedLength

func (c *NodeJoinLegacy) GetSerializedLength() int

Serializable interface: data length when serialized

func (*NodeJoinLegacy) Read

func (c *NodeJoinLegacy) Read(r io.Reader) error

Serializable interface: convert from bytes.

func (*NodeJoinLegacy) ToBytes

func (c *NodeJoinLegacy) ToBytes() []byte

Serializable interface: convert to bytes.

type NodeJoinResponse

type NodeJoinResponse struct {
	Nickname string
	PortTcp  int32
	PortUdp  int32
}

func NewNodeJoinResponse

func NewNodeJoinResponse(nickname string, portTcp, portUdp int32) *NodeJoinResponse

func (*NodeJoinResponse) GetSerializedLength

func (c *NodeJoinResponse) GetSerializedLength() int

Serializable interface: data length when serialized

func (*NodeJoinResponse) Read

func (c *NodeJoinResponse) Read(r io.Reader) error

Serializable interface: convert from bytes.

func (*NodeJoinResponse) ToBytes

func (c *NodeJoinResponse) ToBytes() []byte

Serializable interface: convert to bytes.

type NodeJoinResponseLegacy

type NodeJoinResponseLegacy struct {
	Nickname        string
	Port            int32
	NewVerifierVote NewVerifierVote
}

func NewNodeJoinResponseLegacy

func NewNodeJoinResponseLegacy(nickname string, port int32, newVerifierVote NewVerifierVote) *NodeJoinResponseLegacy

func (*NodeJoinResponseLegacy) GetSerializedLength

func (c *NodeJoinResponseLegacy) GetSerializedLength() int

Serializable interface: data length when serialized

func (*NodeJoinResponseLegacy) Read

Serializable interface: convert from bytes.

func (*NodeJoinResponseLegacy) ToBytes

func (c *NodeJoinResponseLegacy) ToBytes() []byte

Serializable interface: convert to bytes.

type StatusResponse

type StatusResponse struct {
	Lines []string
}

func NewStatusResponse

func NewStatusResponse(lines []string) *StatusResponse

func (*StatusResponse) GetSerializedLength

func (c *StatusResponse) GetSerializedLength() int

Serializable interface: data length when serialized

func (*StatusResponse) Read

func (c *StatusResponse) Read(r io.Reader) error

Serializable interface: convert from bytes.

func (*StatusResponse) ToBytes

func (c *StatusResponse) ToBytes() []byte

Serializable interface: convert to bytes.

Directories

Path Synopsis
Byte level message field sizes Byte level message field serialization.
Byte level message field sizes Byte level message field serialization.

Jump to

Keyboard shortcuts

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