context

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const Prefix = "aapi-"

Variables

This section is empty.

Functions

func IfSet

func IfSet(ctx context.Context, key Key, f func(value any))

IfSet executes the function if the key is set in the context

Types

type Key

type Key string

Key is the type of the keys used in the context

const (
	// Module is the name of the module this data is coming from.
	// When coming from a generated client, it is `asyncapi`
	KeyIsModule Key = Prefix + "module"
	// Provider is the name of the provider this data is coming from.
	// When coming from generated code, it is `app`, `client` or `broker`
	KeyIsProvider Key = Prefix + "provider"
	// Action is the name of the action this data is coming from.
	// When coming from generated code, it is the name of the channel
	KeyIsAction Key = Prefix + "action"
	// Operation is the name of the operation this data is coming from.
	// When coming from generated code, it is `subscribe`, `publish`, `wait-for`, etc
	KeyIsOperation Key = Prefix + "operation"
	// Message is the message that has been sent or received
	KeyIsMessage Key = Prefix + "message"
	// CorrelationID is the correlation ID of the message
	KeyIsCorrelationID Key = Prefix + "correlationID"
)

Jump to

Keyboard shortcuts

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