message

package
v1.0.18 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: GPL-3.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
}

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 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