temporalclient

package
v0.0.0-...-f9f20c5 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrMetadataIsNotSet is returned when metadata is not set.
	ErrMetadataIsNotSet = errors.New("metadata is not set")
	// ErrEncodingIsNotSet is returned when payload encoding metadata is not set.
	ErrEncodingIsNotSet = errors.New("payload encoding metadata is not set")
	// ErrEncodingIsNotSupported is returned when payload encoding is not supported.
	ErrEncodingIsNotSupported = errors.New("payload encoding is not supported")
	//ErrUnableToFindConverter is return when payload converter is not found
	ErrUnableToFindConverter = errors.New("payload converter is not found")
)

Functions

func NewEncryptDataConverterV1

func NewEncryptDataConverterV1(opts Options) (converter.DataConverter, error)

NewEncryptDataConverterV1 - Temporal provides a default unencrypted DataConverter however for some of our needs we need a DataConverter to encrypt maybe sensitive information into workflows. EncryptDataConverterV1 allows the ability to encrypt maybe sensitive workflows without compromising sensitive info we send to our temporal service.

Types

type AESEncryptionServiceV1

type AESEncryptionServiceV1 struct {
	Cipher cipher.AEAD
}

func (AESEncryptionServiceV1) Decrypt

func (a AESEncryptionServiceV1) Decrypt(encryptedBytes []byte) ([]byte, error)

Decrypt takes an encrypted base64 byte array then returns an unencrypted byte array if same key was used to encrypt it

func (AESEncryptionServiceV1) Encrypt

func (a AESEncryptionServiceV1) Encrypt(unencryptedBytes []byte) ([]byte, error)

Encrypt takes a byte array and returns an encrypted byte array as base64 encoded

type Client

type Client struct {
	TemporalClient client.Client
	// contains filtered or unexported fields
}

func NewClient

func NewClient(log logging.Logger) (*Client, error)

func (*Client) Close

func (c *Client) Close()

func (*Client) ExecuteWorkflow

func (c *Client) ExecuteWorkflow(
	ctx context.Context,
	options client.StartWorkflowOptions,
	workflowName string,
	args ...interface{},
) (client.WorkflowRun, error)

func (*Client) RegisterNamespace

func (c *Client) RegisterNamespace() error

type Configuration

type Configuration struct {
	TemporalServiceAddress  string `envconfig:"TEMPORAL_SERVICE_URL" default:"localhost:7233"`
	EncryptionKey           string `envconfig:"TEMPORAL_ENCRYPTIONKEY" default:"00000000~secretGoesHere~00000000"`
	Secure                  bool   `envconfig:"TEMPORAL_SECURE" default:"false"`
	NamespaceTasksRetention int    `envconfig:"TEMPORAL_NAMESPACE_TASKS_RETENTION" default:"3"`
	RetryCount              int    `envconfig:"TEMPORAL_RETRY_COUNT" default:"3"`
	RetryTimeout            int    `envconfig:"TEMPORAL_RETRY_TIMEOUT" default:"10"`
}

type Options

type Options struct {
	// EncryptionKey is the encryption key used to encrypt the payloads
	// this key must be 16, 24, 32 characters in length
	EncryptionKey []byte
}

Jump to

Keyboard shortcuts

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