package topicsugar
import "github.com/ydb-platform/ydb-go-sdk/v3/topic/topicsugar"
Index ¶
- func JSONUnmarshal(msg *topicreader.Message, dst interface{}) error
- func ProtoUnmarshal(msg *topicreader.Message, dst proto.Message) error
- func ReadMessageDataWithCallback(msg *topicreader.Message, f func(data []byte) error) error
- func UnmarshalMessageWith(msg *topicreader.Message, unmarshaler UnmarshalFunc, v interface{}) error
- type UnmarshalFunc
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 ¶
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 ¶
UnmarshalFunc is func to unmarshal data to interface, for example json.Unmarshal from standard library
Source Files ¶
- Version
- v3.72.0
- Published
- Jun 6, 2024
- Platform
- darwin/amd64
- Imports
- 3 packages
- Last checked
- 5 seconds ago –
Tools for package owners.