message

package
v1.8.0-rc.9 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(msg Message) ([]byte, error)

Types

type Handler

type Handler interface {
	HandleTx(nodeID ids.NodeID, requestID uint32, msg *Tx) error
}

type Message

type Message interface {
	// Handle this message with the correct message handler
	Handle(handler Handler, nodeID ids.NodeID, requestID uint32) error

	// Bytes returns the binary representation of this message
	//
	// Bytes should only be called after being initialized
	Bytes() []byte
	// contains filtered or unexported methods
}

func Parse

func Parse(bytes []byte) (Message, error)

type NoopHandler

type NoopHandler struct {
	Log logging.Logger
}

func (NoopHandler) HandleTx

func (h NoopHandler) HandleTx(nodeID ids.NodeID, requestID uint32, _ *Tx) error

type Tx

type Tx struct {
	Tx []byte `serialize:"true"`
	// contains filtered or unexported fields
}

func (*Tx) Bytes

func (m *Tx) Bytes() []byte

func (*Tx) Handle

func (msg *Tx) Handle(handler Handler, nodeID ids.NodeID, requestID uint32) error

Jump to

Keyboard shortcuts

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