Documentation ¶
Index ¶
- func ByteToHexString(value byte) string
- func BytesToHexString(value []byte) string
- func BytesToInt(value []byte) int
- func BytesToInt64(value []byte) int64
- func BytesToUint16(value []byte) uint16
- func BytesToUint32(value []byte) uint32
- func Concat(v ...interface{}) string
- func GetInstance(messageType string) (interface{}, error)
- func GetMessageType(message proto.Message) string
- func Int64ToBytes(value int64, b []byte) []byte
- func Int64ToString(value int64) string
- func IntToBytes(value int, b []byte) []byte
- func IntToString(value int) string
- func ReadUint16(reader io.Reader) (uint16, error)
- func ToString(v interface{}) string
- func Uint16ToBytes(value uint16, b []byte) []byte
- func Uint16ToString(value uint16) string
- func Uint32ToBytes(value uint32, b []byte) []byte
- func Uint32ToString(value uint32) string
- func WriteHash(h hash.Hash) func(b []byte) (int, error)
- func WriteString(s string) func([]byte) (int, error)
- func WriteUint16(value uint16) func([]byte) (int, error)
- func WriteUint32(value uint32) func([]byte) (int, error)
- type TypedMessage
- func (*TypedMessage) Descriptor() ([]byte, []int)
- func (v *TypedMessage) GetInstance() (proto.Message, error)
- func (m *TypedMessage) GetType() string
- func (m *TypedMessage) GetValue() []byte
- func (*TypedMessage) ProtoMessage()
- func (m *TypedMessage) Reset()
- func (m *TypedMessage) String() string
- func (m *TypedMessage) XXX_DiscardUnknown()
- func (m *TypedMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *TypedMessage) XXX_Merge(src proto.Message)
- func (m *TypedMessage) XXX_Size() int
- func (m *TypedMessage) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByteToHexString ¶
ByteToHexString converts a byte into hex string.
func BytesToHexString ¶
BytesToHexString converts a byte array into hex string.
func BytesToInt ¶
BytesToInt deserializes a bytes array (of at leat 4 bytes) to an int in big endian order.
func BytesToInt64 ¶
BytesToInt64 deserializes a byte array to an int64 in big endian order. The byte array must have at least 8 elements.
func BytesToUint16 ¶
BytesToUint16 deserializes a byte array to a uint16 in big endian order. The byte array must have at least 2 elements.
func BytesToUint32 ¶
BytesToUint32 deserializes a byte array to a uint32 in big endian order. The byte array must have at least 4 elements.
func GetInstance ¶
func GetMessageType ¶
func Int64ToBytes ¶
func Int64ToString ¶
func IntToBytes ¶
func IntToString ¶
func ToString ¶
func ToString(v interface{}) string
ToString serialize an abitrary value into string.
func Uint16ToBytes ¶
Uint16ToBytes serializes a uint16 into bytes in big endian order.
func Uint16ToString ¶
func Uint32ToBytes ¶
func Uint32ToString ¶
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"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
TypedMessage is a serialized proto message along with its type name.
func ToTypedMessage ¶
func ToTypedMessage(message proto.Message) *TypedMessage
func (*TypedMessage) Descriptor ¶
func (*TypedMessage) Descriptor() ([]byte, []int)
func (*TypedMessage) GetInstance ¶
func (v *TypedMessage) GetInstance() (proto.Message, error)
func (*TypedMessage) GetType ¶
func (m *TypedMessage) GetType() string
func (*TypedMessage) GetValue ¶
func (m *TypedMessage) GetValue() []byte
func (*TypedMessage) ProtoMessage ¶
func (*TypedMessage) ProtoMessage()
func (*TypedMessage) Reset ¶
func (m *TypedMessage) Reset()
func (*TypedMessage) String ¶
func (m *TypedMessage) String() string
func (*TypedMessage) XXX_DiscardUnknown ¶
func (m *TypedMessage) XXX_DiscardUnknown()
func (*TypedMessage) XXX_Marshal ¶
func (m *TypedMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*TypedMessage) XXX_Merge ¶
func (dst *TypedMessage) XXX_Merge(src proto.Message)
func (*TypedMessage) XXX_Size ¶
func (m *TypedMessage) XXX_Size() int
func (*TypedMessage) XXX_Unmarshal ¶
func (m *TypedMessage) XXX_Unmarshal(b []byte) error