Documentation ¶
Index ¶
- Variables
- func Concat(v ...interface{}) string
- func GetInstance(messageType string) (interface{}, error)
- func GetMessageType(message proto.Message) string
- func ReadUint16(reader io.Reader) (uint16, error)
- func ToString(v interface{}) string
- func WriteUint16(writer io.Writer, value uint16) (int, error)
- func WriteUint64(writer io.Writer, value uint64) (int, error)
- type TypedMessage
- func (*TypedMessage) Descriptor() ([]byte, []int)deprecated
- func (v *TypedMessage) GetInstance() (proto.Message, error)
- func (x *TypedMessage) GetType() string
- func (x *TypedMessage) GetValue() []byte
- func (*TypedMessage) ProtoMessage()
- func (x *TypedMessage) ProtoReflect() protoreflect.Message
- func (x *TypedMessage) Reset()
- func (x *TypedMessage) String() string
Constants ¶
This section is empty.
Variables ¶
View Source
var File_common_serial_typed_message_proto protoreflect.FileDescriptor
Functions ¶
func Concat ¶
func Concat(v ...interface{}) string
Concat concatenates all input into a single string.
func GetInstance ¶
GetInstance creates a new instance of the message with messageType.
func GetMessageType ¶
GetMessageType returns the name of this proto Message.
func ReadUint16 ¶
ReadUint16 reads first two bytes from the reader, and then converts them to an uint16 value.
func ToString ¶
func ToString(v interface{}) string
ToString serializes an arbitrary value into string.
func WriteUint16 ¶
WriteUint16 writes an uint16 value into writer.
Types ¶
type TypedMessage ¶
type TypedMessage struct { // The name of the message type, retrieved from protobuf API. Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` // Serialized proto message. Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
TypedMessage is a serialized proto message along with its type name.
func ToTypedMessage ¶
func ToTypedMessage(message proto.Message) *TypedMessage
ToTypedMessage converts a proto Message into TypedMessage.
func (*TypedMessage) Descriptor
deprecated
func (*TypedMessage) Descriptor() ([]byte, []int)
Deprecated: Use TypedMessage.ProtoReflect.Descriptor instead.
func (*TypedMessage) GetInstance ¶
func (v *TypedMessage) GetInstance() (proto.Message, error)
GetInstance converts current TypedMessage into a proto Message.
func (*TypedMessage) GetType ¶
func (x *TypedMessage) GetType() string
func (*TypedMessage) GetValue ¶
func (x *TypedMessage) GetValue() []byte
func (*TypedMessage) ProtoMessage ¶
func (*TypedMessage) ProtoMessage()
func (*TypedMessage) ProtoReflect ¶
func (x *TypedMessage) ProtoReflect() protoreflect.Message
func (*TypedMessage) Reset ¶
func (x *TypedMessage) Reset()
func (*TypedMessage) String ¶
func (x *TypedMessage) String() string
Click to show internal directories.
Click to hide internal directories.