Documentation ¶
Index ¶
- Variables
- type DerivationFunc
- type Loader
- type LoaderFunc
- type Propagator
- type Provider
- type Saver
- type Store
- func (s *Store[T, K]) Derive(ctx ValueContainer, derive DerivationFunc[T]) (T, error)
- func (s *Store[T, K]) Load(ctx ValueContainer) (r T, err error)
- func (s *Store[T, K]) LoadOrDefault(ctx ValueContainer, defaultValue T) (r T, err error)
- func (s *Store[T, K]) LoadOrDefaultFunc(ctx ValueContainer, defaultValueFunc func() (T, error)) (r T, err error)
- func (s *Store[T, K]) Save(ctx context.Context, v T) context.Context
- func (s *Store[T, K]) SaveToWorkflow(ctx workflow.Context, v T) workflow.Context
- type ValueContainer
- type WorkflowPropagator
- func (p *WorkflowPropagator[T]) Extract(ctx context.Context, reader workflow.HeaderReader) (context.Context, error)
- func (p *WorkflowPropagator[T]) ExtractToWorkflow(ctx workflow.Context, reader workflow.HeaderReader) (workflow.Context, error)
- func (p *WorkflowPropagator[T]) Inject(ctx context.Context, writer workflow.HeaderWriter) (err error)
- func (p *WorkflowPropagator[T]) InjectFromWorkflow(ctx workflow.Context, writer workflow.HeaderWriter) (err error)
- type WorkflowSaver
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFoundInContext = errors.New("not found in context")
Functions ¶
This section is empty.
Types ¶
type DerivationFunc ¶
type Loader ¶
type Loader[T any] interface { Load(ctx ValueContainer) (T, error) }
type LoaderFunc ¶
type LoaderFunc[T any] func(ctx ValueContainer) (T, error)
type Propagator ¶
type Propagator[T any] interface { workflow.ContextPropagator }
type Store ¶
func (*Store[T, K]) Derive ¶
func (s *Store[T, K]) Derive(ctx ValueContainer, derive DerivationFunc[T]) (T, error)
func (*Store[T, K]) Load ¶
func (s *Store[T, K]) Load(ctx ValueContainer) (r T, err error)
func (*Store[T, K]) LoadOrDefault ¶
func (s *Store[T, K]) LoadOrDefault(ctx ValueContainer, defaultValue T) (r T, err error)
func (*Store[T, K]) LoadOrDefaultFunc ¶
func (s *Store[T, K]) LoadOrDefaultFunc(ctx ValueContainer, defaultValueFunc func() (T, error)) (r T, err error)
type ValueContainer ¶
type WorkflowPropagator ¶
type WorkflowPropagator[T any] struct { // contains filtered or unexported fields }
func NewPropagator ¶
func NewPropagator[T any](key string, provider Provider[T]) *WorkflowPropagator[T]
func (*WorkflowPropagator[T]) Extract ¶
func (p *WorkflowPropagator[T]) Extract(ctx context.Context, reader workflow.HeaderReader) (context.Context, error)
Extract extracts context information from headers and returns a context
func (*WorkflowPropagator[T]) ExtractToWorkflow ¶
func (p *WorkflowPropagator[T]) ExtractToWorkflow(ctx workflow.Context, reader workflow.HeaderReader) (workflow.Context, error)
ExtractToWorkflow extracts context information from headers and returns a workflow context
func (*WorkflowPropagator[T]) Inject ¶
func (p *WorkflowPropagator[T]) Inject(ctx context.Context, writer workflow.HeaderWriter) (err error)
Inject injects information from a Go Context into headers
func (*WorkflowPropagator[T]) InjectFromWorkflow ¶
func (p *WorkflowPropagator[T]) InjectFromWorkflow(ctx workflow.Context, writer workflow.HeaderWriter) (err error)
InjectFromWorkflow injects information from workflow context into headers
Click to show internal directories.
Click to hide internal directories.