cadence_go

package module
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2023 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCadenceVersion

func GetCadenceVersion() string

func POCChildWorkflow1 added in v0.1.5

func POCChildWorkflow1(ctx workflow.Context, input string) (string, error)

func POCChildWorkflow2 added in v0.1.5

func POCChildWorkflow2(ctx workflow.Context, input string) (string, error)

func POCChildWorkflow3 added in v0.1.10

func POCChildWorkflow3(ctx workflow.Context, input string) (string, error)

func POCDemoActivity1 added in v0.1.2

func POCDemoActivity1(ctx context.Context, input string) (string, error)

func POCDemoActivity2 added in v0.1.3

func POCDemoActivity2(ctx context.Context, input string) (string, error)

func POCDemoActivity3 added in v0.1.10

func POCDemoActivity3(ctx context.Context, input string) (string, error)

Types

type CadenceHelper

type CadenceHelper struct {
	Service            workflowserviceclient.Interface
	WorkerMetricScope  tally.Scope
	ServiceMetricScope tally.Scope
	Logger             *zap.Logger
	Config             Configuration
	Builder            *WorkflowClientBuilder
	DataConverter      encoded.DataConverter
	CtxPropagators     []workflow.ContextPropagator

	Tracer opentracing.Tracer
	// contains filtered or unexported fields
}

CadenceHelper class for workflow sample helper.

func (*CadenceHelper) CancelWorkflow

func (h *CadenceHelper) CancelWorkflow(workflowID string)

func (*CadenceHelper) ConsistentQueryWorkflow

func (h *CadenceHelper) ConsistentQueryWorkflow(
	valuePtr interface{},
	workflowID, runID, queryType string,
	args ...interface{},
) error

func (*CadenceHelper) QueryWorkflow

func (h *CadenceHelper) QueryWorkflow(workflowID, runID, queryType string, args ...interface{})

func (*CadenceHelper) RegisterActivity

func (h *CadenceHelper) RegisterActivity(activity interface{})

func (*CadenceHelper) RegisterActivityWithAlias

func (h *CadenceHelper) RegisterActivityWithAlias(activity interface{}, alias string)

func (*CadenceHelper) RegisterWorkflow

func (h *CadenceHelper) RegisterWorkflow(workflow interface{})

func (*CadenceHelper) RegisterWorkflowWithAlias

func (h *CadenceHelper) RegisterWorkflowWithAlias(workflow interface{}, alias string)

func (*CadenceHelper) SetConfigFile

func (h *CadenceHelper) SetConfigFile(configFile string)

SetConfigFile sets the config file path

func (*CadenceHelper) SetupServiceConfig

func (h *CadenceHelper) SetupServiceConfig()

SetupServiceConfig setup the config for the sample code run

func (*CadenceHelper) SignalWithStartWorkflowWithCtx

func (h *CadenceHelper) SignalWithStartWorkflowWithCtx(ctx context.Context, workflowID string, signalName string, signalArg interface{},
	options client.StartWorkflowOptions, workflow interface{}, workflowArgs ...interface{}) *workflow.Execution

SignalWithStartWorkflowWithCtx signals workflow and starts it if it's not yet started

func (*CadenceHelper) SignalWorkflow

func (h *CadenceHelper) SignalWorkflow(workflowID, signal string, data interface{})

func (*CadenceHelper) StartWorkers

func (h *CadenceHelper) StartWorkers(domainName string, groupName string, options worker.Options)

StartWorkers starts workflow worker and activity worker based on configured options.

func (*CadenceHelper) StartWorkflow

func (h *CadenceHelper) StartWorkflow(
	options client.StartWorkflowOptions,
	workflow interface{},
	args ...interface{},
) *workflow.Execution

StartWorkflow starts a workflow

func (*CadenceHelper) StartWorkflowWithCtx

func (h *CadenceHelper) StartWorkflowWithCtx(
	ctx context.Context,
	options client.StartWorkflowOptions,
	workflow interface{},
	args ...interface{},
) *workflow.Execution

StartWorkflowWithCtx starts a workflow with the provided context

type Configuration

type Configuration struct {
	DomainName      string                    `yaml:"CAD_DOMAINNAME"`
	ServiceName     string                    `yaml:"CAD_SERVICENAME"`
	HostNameAndPort string                    `yaml:"CAD_HOSTANDPORT"`
	Prometheus      *prometheus.Configuration `yaml:"CAD_PROMETHEUS"`
}

Configuration for running samples.

type POCDemoWorkflowResult added in v0.1.2

type POCDemoWorkflowResult struct {
	Output string
}

func POCWorkflow added in v0.1.9

func POCWorkflow(ctx workflow.Context) (*POCDemoWorkflowResult, error)

type WorkflowClientBuilder

type WorkflowClientBuilder struct {
	Logger *zap.Logger
	// contains filtered or unexported fields
}

WorkflowClientBuilder build client to cadence service

func NewBuilder

func NewBuilder(logger *zap.Logger) *WorkflowClientBuilder

NewBuilder creates a new WorkflowClientBuilder

func (*WorkflowClientBuilder) BuildCadenceClient

func (b *WorkflowClientBuilder) BuildCadenceClient() (client.Client, error)

BuildCadenceClient builds a client to cadence service

func (*WorkflowClientBuilder) BuildCadenceDomainClient

func (b *WorkflowClientBuilder) BuildCadenceDomainClient() (client.DomainClient, error)

BuildCadenceDomainClient builds a domain client to cadence service

func (*WorkflowClientBuilder) BuildServiceClient

func (b *WorkflowClientBuilder) BuildServiceClient() (workflowserviceclient.Interface, error)

BuildServiceClient builds a rpc service client to cadence service

func (*WorkflowClientBuilder) SetClientIdentity

func (b *WorkflowClientBuilder) SetClientIdentity(identity string) *WorkflowClientBuilder

SetClientIdentity sets the identity for the builder

func (*WorkflowClientBuilder) SetContextPropagators

func (b *WorkflowClientBuilder) SetContextPropagators(ctxProps []workflow.ContextPropagator) *WorkflowClientBuilder

SetContextPropagators sets the context propagators for the builder

func (*WorkflowClientBuilder) SetDataConverter

func (b *WorkflowClientBuilder) SetDataConverter(dataConverter encoded.DataConverter) *WorkflowClientBuilder

SetDataConverter sets the data converter for the builder

func (*WorkflowClientBuilder) SetDispatcher

func (b *WorkflowClientBuilder) SetDispatcher(dispatcher *yarpc.Dispatcher) *WorkflowClientBuilder

SetDispatcher sets the dispatcher for the builder

func (*WorkflowClientBuilder) SetDomain

func (b *WorkflowClientBuilder) SetDomain(domain string) *WorkflowClientBuilder

SetDomain sets the domain for the builder

func (*WorkflowClientBuilder) SetHostPort

func (b *WorkflowClientBuilder) SetHostPort(hostport string) *WorkflowClientBuilder

SetHostPort sets the hostport for the builder

func (*WorkflowClientBuilder) SetMetricsScope

func (b *WorkflowClientBuilder) SetMetricsScope(metricsScope tally.Scope) *WorkflowClientBuilder

SetMetricsScope sets the metrics scope for the builder

func (*WorkflowClientBuilder) SetTracer

func (b *WorkflowClientBuilder) SetTracer(tracer opentracing.Tracer) *WorkflowClientBuilder

SetTracer sets the tracer for the builder

Jump to

Keyboard shortcuts

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