message

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: GPL-3.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthPeerShardMessage        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowPeerShardMessage          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupPeerShardMessage = fmt.Errorf("proto: unexpected end of group")
)

Functions

This section is empty.

Types

type Message

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

Message is a data holder struct

func (*Message) BroadcastMethod

func (m *Message) BroadcastMethod() p2p.BroadcastMethod

BroadcastMethod returns the broadcast method of the message

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 the From field)

func (*Message) Payload

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

Payload returns the encapsulated message along with metadata 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) Topic

func (m *Message) Topic() string

Topic returns the topic on which the message was sent

type PeerShard

type PeerShard struct {
	ShardId string `protobuf:"bytes,1,opt,name=ShardId,proto3" json:"shardId"`
}

PeerShard represents the data regarding a peer's shard

func (*PeerShard) Descriptor

func (*PeerShard) Descriptor() ([]byte, []int)

func (*PeerShard) Equal

func (this *PeerShard) Equal(that interface{}) bool

func (*PeerShard) GetShardId

func (m *PeerShard) GetShardId() string

func (*PeerShard) GoString

func (this *PeerShard) GoString() string

func (*PeerShard) Marshal

func (m *PeerShard) Marshal() (dAtA []byte, err error)

func (*PeerShard) MarshalTo

func (m *PeerShard) MarshalTo(dAtA []byte) (int, error)

func (*PeerShard) MarshalToSizedBuffer

func (m *PeerShard) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PeerShard) ProtoMessage

func (*PeerShard) ProtoMessage()

func (*PeerShard) Reset

func (m *PeerShard) Reset()

func (*PeerShard) Size

func (m *PeerShard) Size() (n int)

func (*PeerShard) String

func (this *PeerShard) String() string

func (*PeerShard) Unmarshal

func (m *PeerShard) Unmarshal(dAtA []byte) error

func (*PeerShard) XXX_DiscardUnknown

func (m *PeerShard) XXX_DiscardUnknown()

func (*PeerShard) XXX_Marshal

func (m *PeerShard) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PeerShard) XXX_Merge

func (m *PeerShard) XXX_Merge(src proto.Message)

func (*PeerShard) XXX_Size

func (m *PeerShard) XXX_Size() int

func (*PeerShard) XXX_Unmarshal

func (m *PeerShard) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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