common

package
v1.24.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: MIT Imports: 4 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 MaybeMarshalJSONPB and MaybeUnmarshalJSONPB on both Payloads and Payload. Tests for this code are in ../../proxy/marshal_test.go.

Documentation

Index

Constants

View Source
const DisablePayloadShorthandMetadataKey = "__temporal_disable_payload_shorthand"

Key on the marshaler metadata specifying whether shorthand is disabled.

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) MaybeMarshalJSONPB

func (p *Payload) MaybeMarshalJSONPB(m *jsonpb.Marshaler, currIndent string) (handled bool, b []byte, err error)

MaybeMarshalJSONPB implements go.temporal.io/api/internal/temporaljsonpb.JSONPBMaybeMarshaler.MaybeMarshalJSONPB.

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

func (*Payload) MaybeUnmarshalJSONPB

func (p *Payload) MaybeUnmarshalJSONPB(u *jsonpb.Unmarshaler, b []byte) (handled bool, err error)

MaybeUnmarshalJSONPB implements go.temporal.io/api/internal/temporaljsonpb.JSONPBMaybeUnmarshaler.MaybeUnmarshalJSONPB.

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) MaybeMarshalJSONPB

func (p *Payloads) MaybeMarshalJSONPB(m *jsonpb.Marshaler, currIndent string) (handled bool, b []byte, err error)

MaybeMarshalJSONPB implements go.temporal.io/api/internal/temporaljsonpb.JSONPBMaybeMarshaler.MaybeMarshalJSONPB.

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

func (*Payloads) MaybeUnmarshalJSONPB

func (p *Payloads) MaybeUnmarshalJSONPB(u *jsonpb.Unmarshaler, b []byte) (handled bool, err error)

MaybeUnmarshalJSONPB implements go.temporal.io/api/internal/temporaljsonpb.JSONPBMaybeUnmarshaler.MaybeUnmarshalJSONPB.

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