meta

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package meta defines the internal contract for what the gateway learns about a request once and every later stage reads: the Target on the context, and the namespace stamped on outgoing metadata for the per-upstream proxy. It depends on no other internal packages.

Index

Constants

View Source
const NamespaceHeader = "x-temporal-proxy-namespace"

NamespaceHeader is the outgoing metadata key that carries the local (pre- translation) namespace from the router to the upstream proxy.

Variables

This section is empty.

Functions

func NamespaceFrom

func NamespaceFrom(ctx context.Context) string

NamespaceFrom returns the namespace carried on ctx's outgoing metadata, or "" when absent. When multiple values are present the last (most recently added) wins.

func WithNamespace

func WithNamespace(ctx context.Context, namespace string) context.Context

WithNamespace returns ctx with namespace set on its outgoing gRPC metadata, replacing any value already present for NamespaceHeader (so a client cannot influence routing by sending the header itself).

func WithTarget added in v0.5.0

func WithTarget(ctx context.Context, target Target) context.Context

WithTarget returns ctx carrying target. It travels as a context value rather than as metadata because a caller must not be able to forge it: the gateway derives a Target from the stream it accepted, and authentication decides on it.

Types

type Target added in v0.5.0

type Target struct {
	FullName  string
	Namespace string
}

Target is what a request is addressing: the gRPC full method and the Temporal namespace named in its first message. Namespace is "" when the request names none, when its payload could not be read, or when the gateway does not forward the method's service and so never read one.

func TargetFrom added in v0.5.0

func TargetFrom(ctx context.Context) Target

TargetFrom returns the Target carried on ctx, or the zero Target when absent. A zero Target is the honest answer for a request the gateway has not inspected, so callers weighing one must treat empty fields as "unknown" rather than as values to match on.

Jump to

Keyboard shortcuts

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