message

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2022 License: BSD-3-Clause Imports: 9 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.ShortID, requestID uint32, msg *Tx) error
}

type Message

type Message interface {
	// Handle this message with the correct message handler
	Handle(handler Handler, nodeID ids.ShortID, 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.ShortID, 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.ShortID, requestID uint32) error

Jump to

Keyboard shortcuts

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