Documentation
¶
Overview ¶
Package tenantctx stores tenant and host-side execution state in context.Context.
包 tenantctx 在 context.Context 中存储租户和主控端执行状态。
Index ¶
- func DeploymentFromContext(ctx context.Context) (types.DeploymentUnit, bool)
- func Detach(ctx context.Context) context.Context
- func FromContext(ctx context.Context) (types.Tenant, bool)
- func IsHost(ctx context.Context) bool
- func Switch(ctx context.Context, tenant types.Tenant) context.Context
- func WithHost(ctx context.Context) context.Context
- func WithTenant(ctx context.Context, tenant types.Tenant) context.Context
- func WithTenantDeployment(ctx context.Context, tenant types.Tenant, deployment types.DeploymentUnit) context.Context
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 ¶
Detach returns a context without tenant or host state and without parent cancellation.
func FromContext ¶
FromContext returns the tenant stored in ctx.
func WithTenant ¶
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.
Click to show internal directories.
Click to hide internal directories.