Help us shape the future of Go! Take the 2026 Go Developer Survey

scope

package
v1.9.3 Latest Latest
Warning

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

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

Documentation

Overview

Package scope provides helpers to capture and restore multi-tenant execution context (app and org identity) from/to context.Context.

When the forge framework is available, scope is carried via forge.WithScope / forge.ScopeFrom. These helpers bridge between the Job entity's ScopeAppID/ScopeOrgID fields and the context.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Capture

func Capture(ctx context.Context) (appID, orgID string)

Capture extracts the app and org identifiers from the context. Returns empty strings if no scope is present.

func Restore

func Restore(ctx context.Context, appID, orgID string) context.Context

Restore attaches a scope to the context using the given app and org IDs. If both are empty, the context is returned unchanged (no-op).

Types

This section is empty.

Jump to

Keyboard shortcuts

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