serial

package
v0.1.22 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_serial_typed_message_proto protoreflect.FileDescriptor

Functions

func Concat

func Concat(v ...interface{}) string

Concat concatenates all input into a single string.

func Decode

func Decode(v *TypedMessage) (proto.Message, error)

func GetInstance

func GetInstance(messageType string) (proto.Message, error)

func GetMessageType

func GetMessageType(message proto.Message) string

func ReadUint16

func ReadUint16(reader io.Reader) (uint16, error)

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

func WriteUint16(writer io.Writer, value uint16) (int, error)

WriteUint16 writes an uint16 value into writer.

func WriteUint64

func WriteUint64(writer io.Writer, value uint64) (int, error)

WriteUint64 writes an uint64 value into writer.

Types

type TypedMessage

type TypedMessage struct {
	Type  string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func Encode

func Encode(message proto.Message) *TypedMessage

func (*TypedMessage) Decode

func (v *TypedMessage) Decode() (proto.Message, error)

Decode converts current TypedMessage into a proto Message.

func (*TypedMessage) Descriptor deprecated

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

Deprecated: Use TypedMessage.ProtoReflect.Descriptor instead.

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

Jump to

Keyboard shortcuts

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