payload

package
v0.5.1-warp-rc.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2023 License: GPL-3.0, LGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressedPayload

type AddressedPayload struct {
	SourceAddress      ids.ID `serialize:"true"`
	DestinationAddress ids.ID `serialize:"true"`
	Payload            []byte `serialize:"true"`
	// contains filtered or unexported fields
}

AddressedPayload defines an optional format for the bytes payload of a Warp message.

func NewAddressedPayload

func NewAddressedPayload(sourceAddress ids.ID, destinationAddress ids.ID, payload []byte) (*AddressedPayload, error)

NewAddressedPayload creates a new *AddressedPayload and initializes it.

func ParseAddressedPayload

func ParseAddressedPayload(b []byte) (*AddressedPayload, error)

ParseAddressedPayload converts a slice of bytes into an initialized *AddressedPayload.

func (*AddressedPayload) Bytes

func (a *AddressedPayload) Bytes() []byte

Bytes returns the binary representation of this payload. It assumes that the payload is initialized from either NewAddressedPayload, ParseAddressedPayload, or an explicit call to Initialize.

func (*AddressedPayload) Initialize

func (a *AddressedPayload) Initialize() error

Initialize recalculates the result of Bytes().

Jump to

Keyboard shortcuts

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