package topicsugar
import "github.com/ydb-platform/ydb-go-sdk/v3/topic/topicsugar"
Index ¶
- func ConsumeWithCallback(f func(data []byte) error) topicreader.MessageContentUnmarshaler
- func JSONUnmarshal(msg *topicreader.Message, dst interface{}) error
- func ProtoUnmarshal(msg *topicreader.Message, dst proto.Message) error
- func UnmarshalMessageWith(unmarshaler UnmarshalFunc, v interface{}) topicreader.MessageContentUnmarshaler
- type UnmarshalFunc
Functions ¶
func ConsumeWithCallback ¶
func ConsumeWithCallback(f func(data []byte) error) topicreader.MessageContentUnmarshaler
ConsumeWithCallback receive full content of message as data 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
Experimental
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func JSONUnmarshal ¶
func JSONUnmarshal(msg *topicreader.Message, dst interface{}) error
JSONUnmarshal unmarshal json message content to dst dst must by pointer to struct
Experimental
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func ProtoUnmarshal ¶
func ProtoUnmarshal(msg *topicreader.Message, dst proto.Message) error
ProtoUnmarshal unmarshal message content to protobuf struct
Experimental
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func UnmarshalMessageWith ¶
func UnmarshalMessageWith(unmarshaler UnmarshalFunc, v interface{}) topicreader.MessageContentUnmarshaler
UnmarshalMessageWith call unmarshaller func with message content unmarshaller func must not use received byte slice after return.
Experimental
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
Types ¶
type UnmarshalFunc ¶
UnmarshalFunc is func to unmarshal data to interface, for example json.Unmarshal from standard library
Experimental
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
Source Files ¶
- Version
- v3.31.0-rc0
- Published
- Aug 1, 2022
- Platform
- windows/amd64
- Imports
- 3 packages
- Last checked
- 11 minutes ago –
Tools for package owners.