Documentation ¶
Index ¶
- func DecompressAndUnmarshall[T proto.Message](buf []byte, msg T, decompressor compress.Decompressor) (T, error)
- func MarshallAndCompress(msg proto.Message, compressor compress.Compressor) ([]byte, error)
- func MustDecompressAndUnmarshall[T proto.Message](buf []byte, msg T, decompressor compress.Decompressor) T
- func MustMarshall(msg proto.Message) []byte
- func MustMarshallAndCompress(msg proto.Message, compressor compress.Compressor) []byte
- func MustUnmarshall[T proto.Message](buf []byte, msg T) T
- func Unmarshall[T proto.Message](buf []byte, msg T) (T, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecompressAndUnmarshall ¶
func DecompressAndUnmarshall[T proto.Message](buf []byte, msg T, decompressor compress.Decompressor) (T, error)
DecompressAndUnmarshall first decompressed the message and then unmarshalls
func MarshallAndCompress ¶
MarshallAndCompress first marshalls the supplied proto message and then compresses it.
func MustDecompressAndUnmarshall ¶
func MustDecompressAndUnmarshall[T proto.Message](buf []byte, msg T, decompressor compress.Decompressor) T
MustDecompressAndUnmarshall first decompressed the message and then unmarshalls. If either of these steps fail then it will panic. The main use case here is for unit tests. Think carefully if you intend to use this elsewhere
func MustMarshall ¶
MustMarshall marshalls a proto message and panics if the unmarshall fails. The main use case here is for unit tests. Think carefully if you intend to use this elsewhere
func MustMarshallAndCompress ¶
func MustMarshallAndCompress(msg proto.Message, compressor compress.Compressor) []byte
MustMarshallAndCompress first marshalls the supplied proto message and then compresses it. If either of these steps fail then it will panic. The main use case here is for unit tests. Think carefully if you intend to use this elsewhere
func MustUnmarshall ¶
MustUnmarshall unmarshalls a proto message and panics if the unmarshall fails. The main use case here is for unit tests. Think carefully if you intend to use this elsewhere
Types ¶
This section is empty.