meta

package
v0.6.55 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 2 Imported by: 0

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