message

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

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 added in v1.0.3

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 added in v1.0.3

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

func (*PeerShard) Equal added in v1.0.3

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

func (*PeerShard) GetShardId added in v1.0.3

func (m *PeerShard) GetShardId() string

func (*PeerShard) GoString added in v1.0.3

func (this *PeerShard) GoString() string

func (*PeerShard) Marshal added in v1.0.3

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

func (*PeerShard) MarshalTo added in v1.0.3

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

func (*PeerShard) MarshalToSizedBuffer added in v1.0.3

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

func (*PeerShard) ProtoMessage added in v1.0.3

func (*PeerShard) ProtoMessage()

func (*PeerShard) Reset added in v1.0.3

func (m *PeerShard) Reset()

func (*PeerShard) Size added in v1.0.3

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

func (*PeerShard) String added in v1.0.3

func (this *PeerShard) String() string

func (*PeerShard) Unmarshal added in v1.0.3

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

func (*PeerShard) XXX_DiscardUnknown added in v1.0.3

func (m *PeerShard) XXX_DiscardUnknown()

func (*PeerShard) XXX_Marshal added in v1.0.3

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

func (*PeerShard) XXX_Merge added in v1.0.3

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

func (*PeerShard) XXX_Size added in v1.0.3

func (m *PeerShard) XXX_Size() int

func (*PeerShard) XXX_Unmarshal added in v1.0.3

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