header

package
v1.1.1139 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const NatsCompatHeader = "Shar-Compat"

NatsCompatHeader is the name of the header used to pass the compatible version of SHAR.

View Source
const NatsVersionHeader = "Shar-Version"

NatsVersionHeader is the name of the header used to pass the SHAR client version.

View Source
const SharNamespace = "Shar-Namespace"

SharNamespace is the name of the header used to pass the client's declared namespace.

Variables

View Source
var ContextKey contextKey = "SHARHeader"

ContextKey is the key for SHAR header values in the context.

Functions

func Copy added in v1.0.400

func Copy(source context.Context, target context.Context) context.Context

Copy copies SHAR values from one context to another.

func FromCtxToMsgHeader added in v1.0.400

func FromCtxToMsgHeader(ctx context.Context, header *nats.Header) error

FromCtxToMsgHeader attaches context information to a NATS message header.

func FromMsgHeaderToCtx added in v1.0.400

func FromMsgHeaderToCtx(ctx context.Context, header nats.Header) (context.Context, error)

FromMsgHeaderToCtx attaches NATS message header values to the context.

func Get added in v1.0.400

func Get(ctx context.Context, key string) string

Get gets a context header value.

func Set added in v1.0.400

func Set(ctx context.Context, key string, value string) context.Context

Set sets a context header value.

Types

type Values

type Values map[string]string

Values is a container for SHAR header values

Jump to

Keyboard shortcuts

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