cre

package
v0.94.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RegistryTypeOnChain  = "on-chain"
	RegistryTypeOffChain = "off-chain"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CLIRunner

type CLIRunner interface {
	// Run executes the CLI with optional per-invocation env vars.
	// Sensitive values should be passed via env and never written to disk.
	Run(ctx context.Context, env map[string]string, args ...string) (*CallResult, error)
	// ContextRegistries returns workflow registries defined from domain.yaml.
	ContextRegistries() []ContextRegistryEntry
}

CLIRunner is the interface for running the CRE binary as a subprocess (v1 / CLI access).

type CallResult

type CallResult struct {
	Stdout   []byte
	Stderr   []byte
	ExitCode int
}

CallResult holds stdout, stderr, and exit code from a completed CRE call.

type Client added in v0.93.0

type Client interface{}

Client is a placeholder for the future CRE v2 Go client. No methods yet—the real API will be added when the CRE Go library is integrated. TODO: Add methods (e.g. DeployWorkflow) and supporting config types once the library contract is clear. TODO: Revisit layout: consider moving Client and concrete clients to a dedicated file or subpackage when the surface grows.

type ContextRegistryEntry added in v0.94.0

type ContextRegistryEntry struct {
	ID               string   `json:"id" mapstructure:"id" yaml:"id"`
	Label            string   `json:"label" mapstructure:"label" yaml:"label"`
	Type             string   `json:"type" mapstructure:"type" yaml:"type"` // "on-chain" or "off-chain"
	Address          string   `json:"address,omitempty" mapstructure:"address,omitempty" yaml:"address,omitempty"`
	ChainName        string   `json:"chainName,omitempty" mapstructure:"chain_name,omitempty" yaml:"chain_name,omitempty"`
	SecretsAuthFlows []string `json:"secretsAuthFlows,omitempty" mapstructure:"secrets_auth_flows,omitempty" yaml:"secrets_auth_flows,omitempty"`
}

ContextRegistryEntry is one registry in context.yaml.

func (ContextRegistryEntry) Validate added in v0.94.0

func (r ContextRegistryEntry) Validate() error

Validate checks that required fields (id, label, type) are non-empty.

type ExitError

type ExitError struct {
	ExitCode int
	Stdout   []byte
	Stderr   []byte
}

ExitError is returned when the CRE process ran and exited with a non-zero code. Use errors.As to inspect ExitCode, Stdout, and Stderr. Result is still returned from Run (CLIRunner.Run) so callers can log or inspect output.

func (*ExitError) Error

func (e *ExitError) Error() string

type Runner

type Runner interface {
	CLI() CLIRunner
	Client() Client
}

Runner groups CLI and Go API access to CRE (v1 subprocess + v2 client).

func NewRunner added in v0.93.0

func NewRunner(opts ...RunnerOption) Runner

NewRunner returns a Runner with the given options applied.

type RunnerOption added in v0.93.0

type RunnerOption func(*runner)

RunnerOption configures a [runner] instance for NewRunner.

func WithCLI added in v0.93.0

func WithCLI(cli CLIRunner) RunnerOption

WithCLI sets the CLI CLIRunner.

func WithClient added in v0.93.0

func WithClient(client Client) RunnerOption

WithClient sets the Go API Client.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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