Documentation ¶
Index ¶
- func Decode(p *commonpb.Payload, valuePtr interface{}) error
- func Encode(value interface{}) (*commonpb.Payload, error)
- func EncodeBytes(bytes []byte) *commonpb.Payload
- func EncodeString(str string) *commonpb.Payload
- func MergeMapOfPayload(dst map[string]*commonpb.Payload, src map[string]*commonpb.Payload) map[string]*commonpb.Payload
- func ToString(p *commonpb.Payload) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeBytes ¶
func EncodeString ¶
func MergeMapOfPayload ¶ added in v1.18.0
func MergeMapOfPayload( dst map[string]*commonpb.Payload, src map[string]*commonpb.Payload, ) map[string]*commonpb.Payload
MergeMapOfPayload returns a new map resulting from merging map `src` into `dst`. If a key in `src` already exists in `dst`, then the value in `src` replaces the value in `dst`. If a key in `src` has nil or empty slice payload value, then it deletes the key from `dst` if it exists. For example:
dst := map[string]*commonpb.Payload{ "key1": EncodeString("value1"), "key2": EncodeString("value2"), } src := map[string]*commonpb.Payload{ "key1": EncodeString("newValue1"), "key2": nilPayload, } res := MergeMapOfPayload(dst, src)
The resulting map `res` is:
map[string]*commonpb.Payload{ "key1": EncodeString("newValue1"), }
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.