wisshes

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: MIT Imports: 13 Imported by: 0

README

wisshes

wisshes Is SSH + Extra Steps

wisshes mascot

What

Pure GO answer to Infrastructure as Code tools like Ansible

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WishDir = ".wisshes"

Functions

func ArtifactsDir

func ArtifactsDir() string

func CtxSSHClient

func CtxSSHClient(ctx context.Context) *goph.Client

func CtxWithInventory

func CtxWithInventory(ctx context.Context, inv *Inventory) context.Context

func CtxWithPreviousStep

func CtxWithPreviousStep(ctx context.Context, step StepStatus) context.Context

func CtxWithSSHClient

func CtxWithSSHClient(ctx context.Context, client *goph.Client) context.Context

func Run

func Run(ctx context.Context, steps ...Step) error

func RunFn

func RunFn(client *goph.Client, format string, args ...any) (string, error)

func TempDir

func TempDir() string

Types

type AptitudeStatus

type AptitudeStatus string
const (
	AptitudeStatusUninstalled AptitudeStatus = "uninstalled"
	AptitudeStatusInstalled   AptitudeStatus = "installed"
)

type CtxKey

type CtxKey string

type Inventory

type Inventory struct {
	Hosts     []*goph.Client
	HostNames []string
}

func CtxInventory

func CtxInventory(ctx context.Context) *Inventory

func NewInventory

func NewInventory(rootPassword string, namesAndIPs ...string) (inv *Inventory, err error)

func (*Inventory) Close

func (inv *Inventory) Close()

func (*Inventory) Run

func (inv *Inventory) Run(ctx context.Context, steps ...Step) (StepStatus, error)

type Step

type Step func(ctx context.Context) (revisedCtx context.Context, name string, status StepStatus, err error)

func Aptitude

func Aptitude(desiredStatus AptitudeStatus, packageNames ...string) Step

func Commands

func Commands(cmds ...string) Step

func FileRemote

func FileRemote(remotePath string, contents []byte) Step

func IfCond

func IfCond(cond bool, steps ...Step) Step

func IfPreviousChanged

func IfPreviousChanged(steps ...Step) Step

func RunAll

func RunAll(steps ...Step) Step

func Ternary

func Ternary(cond bool, ifTrue, ifFalse Step) Step

type StepStatus

type StepStatus string
const (
	StepStatusUnchanged StepStatus = "unchanged"
	StepStatusChanged   StepStatus = "changed"
	StepStatusFailed    StepStatus = "failed"
)

func CtxPreviousStep

func CtxPreviousStep(ctx context.Context) StepStatus

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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