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(m1 map[string]*commonpb.Payload, m2 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( m1 map[string]*commonpb.Payload, m2 map[string]*commonpb.Payload, ) map[string]*commonpb.Payload
MergeMapOfPayload returns a new map resulting from merging map m2 into m1. If a key in m2 already exists in m1, then the value in m2 replaces the value in m1. If the new payload have nil data or an empty slice data, then it deletes the key. For example:
m1 := map[string]*commonpb.Payload{ "key1": EncodeString("value1"), "key2": EncodeString("value2"), } m2 := map[string]*commonpb.Payload{ "key1": EncodeString("newValue1"), "key2": nilPayload, } m3 := MergeMapOfPayload(m1, m2)
The resulting map `m3` is:
m1 := map[string]*commonpb.Payload{ "key1": EncodeString("newValue1"), }
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.