Documentation ¶
Index ¶
- Variables
- type Message
- type PubMessageInner
- func (*PubMessageInner) Descriptor() ([]byte, []int)
- func (m *PubMessageInner) GetChannel() string
- func (m *PubMessageInner) GetData() []byte
- func (m *PubMessageInner) GetTimestamp() *timestamp.Timestamp
- func (*PubMessageInner) ProtoMessage()
- func (m *PubMessageInner) Reset()
- func (m *PubMessageInner) String() string
- func (i *PubMessageInner) Validate() error
- func (m *PubMessageInner) XXX_DiscardUnknown()
- func (m *PubMessageInner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PubMessageInner) XXX_Merge(src proto.Message)
- func (m *PubMessageInner) XXX_Size() int
- func (m *PubMessageInner) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidChannelID is returned for an invalid inner channel ID. ErrInvalidChannelID = errors.New("invalid or empty channel id on pubmessage") )
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
Message fulfills the Message type with a PubMessageInner.
func NewMessage ¶
func NewMessage(peerID peer.ID, pktInner *PubMessageInner) *Message
NewMessage constructs a new Message object
func (*Message) GetAuthenticated ¶
GetAuthenticated indicates if the signature is valid.
type PubMessageInner ¶
type PubMessageInner struct { // Data is the message data. Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` // Channel is the channel. Channel string `protobuf:"bytes,2,opt,name=channel,proto3" json:"channel,omitempty"` // Timestamp is the message timestamp. Timestamp *timestamp.Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
PubMessageInner is the signed inner portion of the message.
func ExtractAndVerify ¶
ExtractAndVerify extracts the inner message from a signed message.
func NewPubMessage ¶
func NewPubMessage( channelID string, privKey crypto.PrivKey, hashType hash.HashType, data []byte, ) (*peer.SignedMsg, *PubMessageInner, error)
NewPubMessage constructs/signs/encodes a new pub-message and inner message.
Uses time.Now() for the timestamp: not deterministic.
func (*PubMessageInner) Descriptor ¶
func (*PubMessageInner) Descriptor() ([]byte, []int)
func (*PubMessageInner) GetChannel ¶
func (m *PubMessageInner) GetChannel() string
func (*PubMessageInner) GetData ¶
func (m *PubMessageInner) GetData() []byte
func (*PubMessageInner) GetTimestamp ¶
func (m *PubMessageInner) GetTimestamp() *timestamp.Timestamp
func (*PubMessageInner) ProtoMessage ¶
func (*PubMessageInner) ProtoMessage()
func (*PubMessageInner) Reset ¶
func (m *PubMessageInner) Reset()
func (*PubMessageInner) String ¶
func (m *PubMessageInner) String() string
func (*PubMessageInner) Validate ¶
func (i *PubMessageInner) Validate() error
Validate checks the inner data.
func (*PubMessageInner) XXX_DiscardUnknown ¶
func (m *PubMessageInner) XXX_DiscardUnknown()
func (*PubMessageInner) XXX_Marshal ¶
func (m *PubMessageInner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PubMessageInner) XXX_Merge ¶
func (m *PubMessageInner) XXX_Merge(src proto.Message)
func (*PubMessageInner) XXX_Size ¶
func (m *PubMessageInner) XXX_Size() int
func (*PubMessageInner) XXX_Unmarshal ¶
func (m *PubMessageInner) XXX_Unmarshal(b []byte) error
Click to show internal directories.
Click to hide internal directories.