topicsugar

package
v3.66.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONUnmarshal

func JSONUnmarshal(msg *topicreader.Message, dst interface{}) error

JSONUnmarshal unmarshal json message content to dst must by pointer to struct

func ProtoUnmarshal

func ProtoUnmarshal(msg *topicreader.Message, dst proto.Message) error

ProtoUnmarshal unmarshal message content to protobuf struct

func ReadMessageDataWithCallback added in v3.32.0

func ReadMessageDataWithCallback(msg *topicreader.Message, f func(data []byte) error) error

ReadMessageDataWithCallback receive full content of message as data slice MUST not be used after return from f. if you need content after return from function - copy it with copy(dst, data) to another byte slice

func UnmarshalMessageWith

func UnmarshalMessageWith(msg *topicreader.Message, unmarshaler UnmarshalFunc, v interface{}) error

UnmarshalMessageWith call unmarshaller func with message content unmarshaller func must not use received byte slice after return.

Types

type UnmarshalFunc

type UnmarshalFunc func(data []byte, dst interface{}) error

UnmarshalFunc is func to unmarshal data to interface, for example json.Unmarshal from standard library

Jump to

Keyboard shortcuts

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