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

tenantctx

package
v1.39.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const ContextFile = "context.yaml"

ContextFile is the filename for the local registry manifest.

Variables

View Source
var CLIVersion = "development"

Set by the root command; importing cmd/version here would create a cycle.

Functions

func ClearContext added in v1.38.0

func ClearContext() error

ClearContext forces the next command to refetch the user context.

func EnsureContext

func EnsureContext(ctx context.Context, creds *credentials.Credentials, envSet *environments.EnvironmentSet, log *zerolog.Logger) error

EnsureContext guarantees a fresh registry manifest exists for the current environment. API key users always fetch; bearer users reuse the cache until it is stale.

func FetchAndWriteContext

func FetchAndWriteContext(ctx context.Context, gqlClient *graphqlclient.Client, envName string, log *zerolog.Logger) error

FetchAndWriteContext fetches the user context from the service and writes the registry manifest to the CLI config directory.

Types

type EnvironmentContext

type EnvironmentContext struct {
	TenantID             string           `yaml:"tenant_id"`
	DefaultDonFamily     string           `yaml:"default_don_family"`
	VaultGatewayURL      string           `yaml:"vault_gateway_url"`
	CapabilitiesRegistry *OnChainContract `yaml:"capabilities_registry,omitempty"`
	Registries           []*Registry      `yaml:"registries"`
	Forwarders           []Forwarder      `yaml:"forwarders,omitempty"`
	FetchedAt            time.Time        `yaml:"fetched_at,omitempty"`
	CLIVersion           string           `yaml:"cli_version,omitempty"`
}

EnvironmentContext holds user context for a single CLI environment.

func LoadContext

func LoadContext(envName string) (*EnvironmentContext, error)

LoadContext reads the registry manifest from the CLI config directory and returns the EnvironmentContext for the given environment name.

func LoadContextFromPath

func LoadContextFromPath(path string, envName string) (*EnvironmentContext, error)

LoadContextFromPath reads the registry manifest at the given path and returns the EnvironmentContext for the given environment name.

type Forwarder added in v1.15.0

type Forwarder struct {
	ChainSelector uint64 `yaml:"chain_selector" json:"chainSelector"`
	Address       string `yaml:"address" json:"address"`
}

Forwarder is a chain selector and mock forwarder contract address for the tenant.

type OnChainContract added in v1.18.0

type OnChainContract struct {
	ChainSelector uint64 `yaml:"chain_selector" json:"chainSelector"`
	Address       string `yaml:"address" json:"address"`
}

OnChainContract is a chain selector and contract address pair.

type Registry

type Registry struct {
	ID            string  `yaml:"id" json:"id"`
	Label         string  `yaml:"label" json:"label"`
	Type          string  `yaml:"type" json:"type"`
	ChainSelector *string `yaml:"chain_selector,omitempty" json:"chainSelector,omitempty"`
	Address       *string `yaml:"address,omitempty" json:"address,omitempty"`
}

Registry represents a single available workflow registry.

Jump to

Keyboard shortcuts

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