Documentation
¶
Index ¶
- Constants
- func MarshalEmpty(msg proto.Message) []byte
- func MarshalError(err error) ([]byte, error)
- func MarshalMsg(msg proto.Message) ([]byte, error)
- func RegisterGenerator(genFn func() proto.Message)
- func UnmarshalResponse(data []byte) (msg proto.Message, msgErr error, err error)
- type FingerprintMsg
- type MsgPacker
- func (x *MsgPacker) MarshalMsg(msg proto.Message) ([]byte, error)
- func (x *MsgPacker) RegisterGenerator(genFn func() proto.Message)
- func (x *MsgPacker) UnmarshalMsg(data []byte) (msg proto.Message, err error)
- func (x *MsgPacker) UnmarshalResponse(data []byte) (msg proto.Message, msgErr error, err error)
Constants ¶
const ( // ErrMark error fingerprint ErrMark = 0 // EmptyMark emptypb.Empty fingerprint EmptyMark = 1 )
Variables ¶
This section is empty.
Functions ¶
func MarshalEmpty ¶ added in v0.9.6
MarshalEmpty tag an empty message
func MarshalError ¶
MarshalError err can marshal/unmarshal, it uses a specific tag "ErrMark"
func MarshalMsg ¶
MarshalMsg marshal a protobuf message support *emptypb.Empty(it uses a specific tag "EmptyMark") and other proto message which extends "Fingerprint() uint32"
func RegisterGenerator ¶
RegisterGenerator register a protobuf generator function with tag
Types ¶
type FingerprintMsg ¶ added in v0.9.3
FingerprintMsg extends "Fingerprint() uint32" to proto message
type MsgPacker ¶
type MsgPacker struct {
// contains filtered or unexported fields
}
MsgPacker pack/unpack a protobuf message with a header tag
func (*MsgPacker) MarshalMsg ¶
MarshalMsg marshal a protobuf message support *emptypb.Empty(it uses a specific tag "EmptyMark") and other proto message which extends "Fingerprint() uint32"
func (*MsgPacker) RegisterGenerator ¶
RegisterGenerator register a protobuf generator function with tag
func (*MsgPacker) UnmarshalMsg ¶
UnmarshalMsg unmarshal a proto message from bytes. msg -- return msg err -- unmarshal error