actions

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2025 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OSLinux   = "linux"
	OSWindows = "windows"
	OSMacOS   = "macos"
	OSDarwin  = "darwin"
)

OS constants

View Source
const (
	DBPostgres = "postgres"
	DBMySQL    = "mysql"
	DBSQLite   = "sqlite"
)

Database engine constants

View Source
const (
	RuntimeNode   = "node"
	RuntimePython = "python"
	RuntimeGo     = "go"
	RuntimeElixir = "elixir"
	RuntimeErlang = "erlang"
	RuntimeJava   = "java"
	RuntimeRust   = "rust"
	RuntimeDotnet = "dotnet"
)

Runtime name constants

View Source
const (
	PackageManagerAsdf  = "asdf"
	PackageManagerBrew  = "brew"
	PackageManagerApt   = "apt"
	PackageManagerChoco = "choco"
)

Package manager constants

View Source
const (
	HTTPClientCurl       = "curl"
	HTTPClientWget       = "wget"
	HTTPClientPowerShell = "powershell"
)

HTTP client constants

View Source
const (
	ServiceManagerBrew    = "brew-services"
	ServiceManagerSystemd = "systemd"
	ServiceManagerWindows = "windows-services"
)

Service manager constants

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action interface {
	Type() ActionType
	Render(ctx *ActionContext) ([]Command, error)
	Validate() error
}

type ActionContext

type ActionContext struct {
	OS              string
	Arch            string
	Env             map[string]string
	Secrets         map[string]string
	WorkingDir      string
	Shell           string
	Timeout         time.Duration
	ContinueOnError bool
}

type ActionError

type ActionError struct {
	Type    ActionType
	Message string
	Err     error
}

func NewActionError

func NewActionError(actionType ActionType, message string, err error) *ActionError

func (*ActionError) Error

func (e *ActionError) Error() string

func (*ActionError) Unwrap

func (e *ActionError) Unwrap() error

type ActionType

type ActionType string
const (
	ActionTypeRun                  ActionType = "run"
	ActionTypePrint                ActionType = "print"
	ActionTypeEnsurePackageManager ActionType = "ensure_package_manager"
	ActionTypeEnsureTool           ActionType = "ensure_tool"
	ActionTypeEnsureRuntime        ActionType = "ensure_runtime"
	ActionTypeEnsureDatabase       ActionType = "ensure_database"
	ActionTypeAssertCommand        ActionType = "assert_command"
	ActionTypeAssertHTTP           ActionType = "assert_http"
)

type AssertCommandAction

type AssertCommandAction struct {
	*BaseAction
	// contains filtered or unexported fields
}

func NewAssertCommandAction

func NewAssertCommandAction(command string) *AssertCommandAction

func (*AssertCommandAction) Execute

func (a *AssertCommandAction) Execute(ctx *ActionContext) error

func (*AssertCommandAction) Render

func (a *AssertCommandAction) Render(ctx *ActionContext) ([]Command, error)

func (*AssertCommandAction) Validate

func (a *AssertCommandAction) Validate() error

type AssertHTTPAction

type AssertHTTPAction struct {
	*BaseAction
	// contains filtered or unexported fields
}

func NewAssertHTTPAction

func NewAssertHTTPAction(url string, expectStatus int, retries *types.Retries) *AssertHTTPAction

func (*AssertHTTPAction) CheckHTTP

func (a *AssertHTTPAction) CheckHTTP(ctx *ActionContext) (bool, error)

CheckHTTP performs the actual HTTP check

func (*AssertHTTPAction) Render

func (a *AssertHTTPAction) Render(ctx *ActionContext) ([]Command, error)

func (*AssertHTTPAction) Validate

func (a *AssertHTTPAction) Validate() error

type BaseAction

type BaseAction struct {
	// contains filtered or unexported fields
}

func NewBaseAction

func NewBaseAction(actionType ActionType) *BaseAction

func (*BaseAction) Render

func (a *BaseAction) Render(ctx *ActionContext) ([]Command, error)

func (*BaseAction) Type

func (a *BaseAction) Type() ActionType

func (*BaseAction) Validate

func (a *BaseAction) Validate() error

type Command

type Command struct {
	Command     string
	Args        []string
	Env         map[string]string
	WorkingDir  string
	Timeout     time.Duration
	Description string
}

type DatabaseCommand

type DatabaseCommand struct {
	Command     string
	Args        []string
	Description string
}

type EnsureDatabaseAction

type EnsureDatabaseAction struct {
	*BaseAction
	// contains filtered or unexported fields
}

func NewEnsureDatabaseAction

func NewEnsureDatabaseAction(
	engine, version, serviceName string,
	ensureRunning bool,
	createDB []string,
) *EnsureDatabaseAction

func (*EnsureDatabaseAction) IsInstalled

func (a *EnsureDatabaseAction) IsInstalled(ctx *ActionContext) (bool, error)

IsInstalled checks if the database is already installed

func (*EnsureDatabaseAction) IsRunning

func (a *EnsureDatabaseAction) IsRunning(ctx *ActionContext) (bool, error)

IsRunning checks if the database service is running

func (*EnsureDatabaseAction) Render

func (a *EnsureDatabaseAction) Render(ctx *ActionContext) ([]Command, error)

func (*EnsureDatabaseAction) Validate

func (a *EnsureDatabaseAction) Validate() error

type EnsurePackageManagerAction

type EnsurePackageManagerAction struct {
	*BaseAction
	// contains filtered or unexported fields
}

func NewEnsurePackageManagerAction

func NewEnsurePackageManagerAction(packageManagerType string) *EnsurePackageManagerAction

func (*EnsurePackageManagerAction) IsInstalled

func (a *EnsurePackageManagerAction) IsInstalled(ctx *ActionContext) (bool, error)

func (*EnsurePackageManagerAction) Render

func (*EnsurePackageManagerAction) Validate

func (a *EnsurePackageManagerAction) Validate() error

type EnsureRuntimeAction

type EnsureRuntimeAction struct {
	*BaseAction
	// contains filtered or unexported fields
}

func NewEnsureRuntimeAction

func NewEnsureRuntimeAction(
	runtimeName, version string,
	manager *RuntimeManager,
) *EnsureRuntimeAction

func (*EnsureRuntimeAction) IsInstalled added in v0.7.1

func (a *EnsureRuntimeAction) IsInstalled(ctx *ActionContext) (bool, error)

IsInstalled checks if the runtime is already installed

func (*EnsureRuntimeAction) Render

func (a *EnsureRuntimeAction) Render(ctx *ActionContext) ([]Command, error)

func (*EnsureRuntimeAction) Validate

func (a *EnsureRuntimeAction) Validate() error

type EnsureToolAction

type EnsureToolAction struct {
	*BaseAction
	// contains filtered or unexported fields
}

func NewEnsureToolAction

func NewEnsureToolAction(toolName, version string, installConfig *types.ToolInstallConfig) *EnsureToolAction

func (*EnsureToolAction) IsInstalled

func (a *EnsureToolAction) IsInstalled(ctx *ActionContext) (bool, error)

IsInstalled checks if the tool is already installed

func (*EnsureToolAction) Render

func (a *EnsureToolAction) Render(ctx *ActionContext) ([]Command, error)

func (*EnsureToolAction) Validate

func (a *EnsureToolAction) Validate() error

type PrintAction

type PrintAction struct {
	*BaseAction
	// contains filtered or unexported fields
}

func NewPrintAction

func NewPrintAction(message string) *PrintAction

func (*PrintAction) Render

func (a *PrintAction) Render(ctx *ActionContext) ([]Command, error)

func (*PrintAction) Validate

func (a *PrintAction) Validate() error

type RunAction

type RunAction struct {
	*BaseAction
	// contains filtered or unexported fields
}

func NewRunAction

func NewRunAction(command string) *RunAction

func (*RunAction) Render

func (a *RunAction) Render(ctx *ActionContext) ([]Command, error)

func (*RunAction) Validate

func (a *RunAction) Validate() error

type RuntimeCommand

type RuntimeCommand struct {
	Command     string
	Args        []string
	Description string
}

func (RuntimeCommand) GetArgs added in v0.7.1

func (r RuntimeCommand) GetArgs() []string

func (RuntimeCommand) GetCommand added in v0.7.1

func (r RuntimeCommand) GetCommand() string

func (RuntimeCommand) GetDescription added in v0.7.1

func (r RuntimeCommand) GetDescription() string

type RuntimeManager

type RuntimeManager struct {
	Asdf bool `yaml:"asdf,omitempty" json:"asdf,omitempty"`
}

type ToolCommand

type ToolCommand struct {
	Command     string
	Args        []string
	Description string
}

func (ToolCommand) GetArgs added in v0.7.1

func (t ToolCommand) GetArgs() []string

func (ToolCommand) GetCommand added in v0.7.1

func (t ToolCommand) GetCommand() string

func (ToolCommand) GetDescription added in v0.7.1

func (t ToolCommand) GetDescription() string

Directories

Path Synopsis
strategies

Jump to

Keyboard shortcuts

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