meta

package
v0.6.125 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package meta is a call's metadata: string pairs the product attaches to a hook call that travel with it — through the binding's run to every activity the run calls, on either runtime and either transport. An activity handler reads them from its context, and a hook it calls in turn carries them on. What they mean is the product's: a user, a tenant, a locale. Backplane does not read them.

ctx = meta.With(ctx, "user", userID, "tenant", tenant)
out, err := ref.Call(ctx, in)

// in an activity handler
user := meta.Get(ctx, "user")

They are as trustworthy as the service that set them: backplane takes a hook call only from a service holding the internal secret and calls activities with it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func From

func From(ctx context.Context) map[string]string

From is a copy of ctx's metadata; nil when it has none.

func Get

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

Get is one value of ctx's metadata; "" when absent.

func Merge

func Merge(ctx context.Context, values map[string]string) context.Context

Merge adds values to ctx's metadata; their keys take the new values.

func Replace

func Replace(ctx context.Context, md map[string]string) context.Context

Replace makes md ctx's metadata, whatever it had: what an incoming call brought.

func With

func With(ctx context.Context, kv ...string) context.Context

With adds the pairs (key, value, key, value, ...) to ctx's metadata; a key already there takes the new value. An odd count panics.

Types

This section is empty.

Jump to

Keyboard shortcuts

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