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

tenantctx

package
v1.32.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 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

This section is empty.

Functions

func EnsureContext

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

EnsureContext guarantees the registry manifest exists for the current environment. API key users always fetch fresh; bearer token users use the cached file from login.

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"`
}

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