encoded

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2018 License: MIT Imports: 0 Imported by: 40

Documentation

Overview

Package encoded contains wrappers that are used for binary payloads deserialization.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataConverter added in v0.7.0

type DataConverter interface {
	// ToData implements conversion of a list of values.
	ToData(value ...interface{}) ([]byte, error)
	// FromData implements conversion of an array of values of different types.
	// Useful for deserializing arguments of function invocations.
	FromData(input []byte, valuePtr ...interface{}) error
}

DataConverter is used by the framework to serialize/deserialize input and output of activity/workflow that need to be sent over the wire. To encode/decode workflow arguments, one should set DataConverter in two places:

  1. Workflow worker, through worker.Options
  2. Client, through client.Options

To encode/decode Activity/ChildWorkflow arguments, one should set DataConverter in two places:

  1. Inside workflow code, use workflow.WithDataConverter to create new Context,

and pass that context to ExecuteActivity/ExecuteChildWorkflow calls. Cadence support using different DataConverters for different activity/childWorkflow in same workflow.

  1. Activity/Workflow worker that run these activity/childWorkflow, through worker.Options.

type Value

type Value interface {
	// HasValue return whether there is value encoded.
	HasValue() bool
	// Get extract the encoded value into strong typed value pointer.
	Get(valuePtr interface{}) error
}

Value is used to encapsulate/extract encoded value from workflow/activity.

type Values

type Values interface {
	// HasValues return whether there are values encoded.
	HasValues() bool
	// Get extract the encoded values into strong typed value pointers.
	Get(valuePtr ...interface{}) error
}

Values is used to encapsulate/extract encoded one or more values from workflow/activity.

Jump to

Keyboard shortcuts

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