common

package
v1.26.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: MIT Imports: 10 Imported by: 0

README

temporalcommonv1

This package contains payload_json.go which is copied to ../../common/v1 after proto generation. The code is kept here separately to keep the delete-entire-directory cleanup before code generation simple.

This code adds "shorthand" formatting support to payloads by implementing MaybeMarshalProtoJSON and MaybeUnmarshalProtoJSON on both Payloads and Payload. Tests for this code are in ../../proxy/marshal_test.go.

Documentation

Index

Constants

View Source
const EnablePayloadShorthandMetadataKey = "__temporal_enable_payload_shorthand"

Key on the marshaler metadata specifying whether shorthand is enabled.

WARNING: This is internal API and should not be called externally.

Variables

This section is empty.

Functions

This section is empty.

Types

type Payload

type Payload struct {
	Metadata map[string][]byte
	Data     []byte
}

func (*Payload) MaybeMarshalProtoJSON added in v1.26.1

func (p *Payload) MaybeMarshalProtoJSON(meta map[string]interface{}, enc *json.Encoder) (handled bool, err error)

MaybeMarshalProtoJSON implements go.temporal.io/api/internal/temporaljsonpb.ProtoJSONMaybeMarshaler.MaybeMarshalProtoJSON.

WARNING: This is internal API and should not be called externally.

func (*Payload) MaybeUnmarshalProtoJSON added in v1.26.1

func (p *Payload) MaybeUnmarshalProtoJSON(meta map[string]interface{}, dec *json.Decoder) (handled bool, err error)

MaybeUnmarshalProtoJSON implements go.temporal.io/api/internal/temporaljsonpb.ProtoJSONMaybeUnmarshaler.MaybeUnmarshalProtoJSON.

WARNING: This is internal API and should not be called externally.

func (*Payload) ProtoMessage

func (*Payload) ProtoMessage()

func (*Payload) Reset

func (*Payload) Reset()

func (*Payload) String

func (*Payload) String() string

type Payloads

type Payloads struct {
	Payloads []*Payload
}

func (*Payloads) MaybeMarshalProtoJSON added in v1.26.1

func (p *Payloads) MaybeMarshalProtoJSON(meta map[string]interface{}, enc *json.Encoder) (handled bool, err error)

MaybeMarshalProtoJSON implements go.temporal.io/api/internal/temporaljsonpb.ProtoJSONMaybeMarshaler.MaybeMarshalProtoJSON.

WARNING: This is internal API and should not be called externally.

func (*Payloads) MaybeUnmarshalProtoJSON added in v1.26.1

func (p *Payloads) MaybeUnmarshalProtoJSON(meta map[string]interface{}, dec *json.Decoder) (handled bool, err error)

MaybeUnmarshalProtoJSON implements go.temporal.io/api/internal/temporaljsonpb.ProtoJSONMaybeUnmarshaler.MaybeUnmarshalProtoJSON.

WARNING: This is internal API and should not be called externally.

Jump to

Keyboard shortcuts

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