Documentation
¶
Index ¶
- Constants
- type Action
- type ActionContext
- type ActionError
- type ActionType
- type AptInstall
- type AssertCommandAction
- type AssertHTTPAction
- type BaseAction
- type BrewInstall
- type ChocoInstall
- type Command
- type DatabaseCommand
- type EnsureDatabaseAction
- type EnsurePackageManagerAction
- type EnsureRuntimeAction
- type EnsureToolAction
- type PackageManagerCommand
- type PrintAction
- type RunAction
- type RuntimeCommand
- type RuntimeManager
- type ToolCommand
- type ToolInstallConfig
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 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 AptInstall ¶
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 BrewInstall ¶
type BrewInstall struct {
Formula string `yaml:"formula" json:"formula"`
}
type ChocoInstall ¶
type ChocoInstall struct {
Packages []string `yaml:"packages" json:"packages"`
}
type DatabaseCommand ¶
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)
IsInstalled checks if the package manager is already installed
func (*EnsurePackageManagerAction) Render ¶
func (a *EnsurePackageManagerAction) Render(ctx *ActionContext) ([]Command, error)
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) 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 *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 PackageManagerCommand ¶
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 ¶
type RuntimeCommand ¶
type RuntimeManager ¶
type RuntimeManager struct {
Asdf bool `yaml:"asdf,omitempty" json:"asdf,omitempty"`
}
type ToolCommand ¶
type ToolInstallConfig ¶
type ToolInstallConfig struct {
Brew *BrewInstall `yaml:"brew,omitempty" json:"brew,omitempty"`
Apt *AptInstall `yaml:"apt,omitempty" json:"apt,omitempty"`
Choco *ChocoInstall `yaml:"choco,omitempty" json:"choco,omitempty"`
FallbackURL string `yaml:"fallback_url,omitempty" json:"fallback_url,omitempty"`
Checksum string `yaml:"checksum,omitempty" json:"checksum,omitempty"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.