messages

package
v0.0.0-...-7c2dc49 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterDecoder

func RegisterDecoder(version string, msgType string, decoder func([]byte) (Message, error))

RegisterDecoder registers a decoder for given version and given message type.

Types

type Message

type Message interface {
	// ToBytes is used for serialization.
	ToBytes() []byte

	// FromBytes is used for de-serialization.
	FromBytes(data []byte) (Message, error)
}

Message is an interface for all the intra relayer messages in the system. Every message must implement -

ToBytes: Serialization function.
FromBytes: De-serialization function.

func DecodeMessage

func DecodeMessage(version string, msgType string, data []byte) (Message, error)

DecodeMessage is used to decode message based on version and message type.

Jump to

Keyboard shortcuts

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