tenantctx

package
v0.3.2 Latest Latest
Warning

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

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

Documentation

Overview

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

包 tenantctx 在 context.Context 中存储租户和主控端执行状态。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeploymentFromContext added in v0.3.1

func DeploymentFromContext(ctx context.Context) (types.DeploymentUnit, bool)

DeploymentFromContext returns the deployment unit stored in a tenant context.

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.

func WithTenantDeployment added in v0.3.1

func WithTenantDeployment(ctx context.Context, tenant types.Tenant, deployment types.DeploymentUnit) context.Context

WithTenantDeployment returns a child context scoped to tenant and its current host-managed deployment unit.

Types

This section is empty.

Jump to

Keyboard shortcuts

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