spin

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package spin provides utilities for orchestrating Spin CLI commands

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(ctx context.Context, options ...string) error

Build runs 'spin build'

func Deploy

func Deploy(ctx context.Context, options ...string) error

Deploy runs 'spin deploy'

func EnsureInstalled

func EnsureInstalled() error

EnsureInstalled ensures Spin is installed

func New

func New(ctx context.Context, template, name string, options ...string) error

New runs 'spin new'

func Registry

func Registry(ctx context.Context, subcommand string, options ...string) error

Registry runs 'spin registry' commands

func Up

func Up(ctx context.Context, options ...string) error

Up runs 'spin up'

func WaitForReady

func WaitForReady(ctx context.Context, address string, timeout time.Duration) error

WaitForReady waits for Spin to be ready on a given address

func Watch

func Watch(ctx context.Context, options ...string) error

Watch runs 'spin watch'

Types

type Executor

type Executor interface {
	Run(ctx context.Context, args ...string) error
	RunWithOutput(ctx context.Context, args ...string) (string, error)
	RunWithInput(ctx context.Context, input string, args ...string) error
	RunInteractive(ctx context.Context, args ...string) error
	IsInstalled() bool
	Version() (string, error)
}

Executor provides an interface for executing Spin commands

func NewExecutor

func NewExecutor(options ...Option) Executor

NewExecutor creates a new Spin executor

type Option

type Option func(*executor)

Option configures an executor

func WithBinary

func WithBinary(binary string) Option

WithBinary sets the Spin binary path

func WithDir

func WithDir(dir string) Option

WithDir sets the working directory

func WithEnv

func WithEnv(env []string) Option

WithEnv sets environment variables

func WithInput

func WithInput(stdin io.Reader) Option

WithInput sets custom input reader

func WithOutput

func WithOutput(stdout, stderr io.Writer) Option

WithOutput sets custom output writers

Jump to

Keyboard shortcuts

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