cre

package
v0.93.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCLIRunner

func NewCLIRunner(binaryPath string, apiKey string) *cliRunner

NewCLIRunner returns a [cliRunner] for the given binary path and API key. An empty binaryPath defaults to "cre" (resolved via PATH).

Types

type CLIRunner

type CLIRunner interface {
	Run(ctx context.Context, args ...string) (*CallResult, error)
}

CLIRunner is the interface for running the CRE binary as a subprocess (v1 / CLI access). The default implementation is created by NewCLIRunner.

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 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