tenantctx

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package tenantctx stores tenant and host-side execution state in context.Context.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Detach

func Detach(ctx context.Context) context.Context

Detach returns a context without tenant or host state and without parent cancellation.

func FromContext

func FromContext(ctx context.Context) (types.Tenant, bool)

FromContext returns the tenant stored in ctx.

func IsHost

func IsHost(ctx context.Context) bool

IsHost reports whether ctx is explicitly marked as host-side.

func Switch

func Switch(ctx context.Context, tenant types.Tenant) context.Context

Switch returns a child context scoped to tenant, leaving ctx unchanged.

func WithHost

func WithHost(ctx context.Context) context.Context

WithHost returns a child context explicitly marked as host-side.

func WithTenant

func WithTenant(ctx context.Context, tenant types.Tenant) context.Context

WithTenant returns a child context scoped to tenant.

Types

This section is empty.

Jump to

Keyboard shortcuts

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