message

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	FromField      []byte
	DataField      []byte
	PayloadField   []byte
	SeqNoField     []byte
	TopicsField    []string
	SignatureField []byte
	KeyField       []byte
	PeerField      core.PeerID
	TimestampField int64
}

Message is a data holder struct

func (*Message) Data

func (m *Message) Data() []byte

Data returns the useful message that was actually sent

func (*Message) From

func (m *Message) From() []byte

From returns the message originator's peer ID

func (*Message) IsInterfaceNil

func (m *Message) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*Message) Key

func (m *Message) Key() []byte

Key returns the message public key (if it can not be recovered from From field)

func (*Message) Payload

func (m *Message) Payload() []byte

Payload returns the encapsulated message along with meta data such as timestamp

func (*Message) Peer

func (m *Message) Peer() core.PeerID

Peer returns the peer that originated the message

func (*Message) SeqNo

func (m *Message) SeqNo() []byte

SeqNo returns the message sequence number

func (*Message) Signature

func (m *Message) Signature() []byte

Signature returns the message signature

func (*Message) Timestamp

func (m *Message) Timestamp() int64

Timestamp returns the message timestamp to prevent endless re-processing of the same message

func (*Message) Topics

func (m *Message) Topics() []string

Topics returns the topic on which the message was sent

Jump to

Keyboard shortcuts

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