interceptor

package
v0.0.0-...-94a9b73 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

README

Interceptor Sample

This sample shows how to make a worker interceptor that intercepts workflow and activity GetLogger calls to customize the logger.

Steps to run this sample:
  1. You need a Temporal service running. See details in README.md
  2. Run the following command to start the worker
go run ./interceptor/worker
  1. Run the following command to start the example
go run ./interceptor/starter

Notice the log output has the WorkflowStartTime/ActivityStartTime tags on the logs.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Activity

func Activity(ctx context.Context, name string) (string, error)

func NewWorkerInterceptor

func NewWorkerInterceptor(options InterceptorOptions) interceptor.WorkerInterceptor

func Workflow

func Workflow(ctx workflow.Context, name string) (string, error)

Types

type InterceptorOptions

type InterceptorOptions struct {
	GetExtraLogTagsForWorkflow func(workflow.Context) []interface{}
	GetExtraLogTagsForActivity func(context.Context) []interface{}
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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