runbooks

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddOtherEmbeddedRunbooks added in v0.11.0

func AddOtherEmbeddedRunbooks(fs embed.FS)

func AddRunbookFromYaml

func AddRunbookFromYaml(yaml string) error

func CreateMapForRunbookArgumentPointers

func CreateMapForRunbookArgumentPointers(runbookAction *RunbookAction) map[string]*string

func GetRunbookNames

func GetRunbookNames() []string

func GetRunbooks

func GetRunbooks() map[string]Runbook

func InitializeBuiltInRunbooks

func InitializeBuiltInRunbooks()

func LoadBuiltInRunbooks

func LoadBuiltInRunbooks(fs embed.FS)

func LoadRunbooksFromDirectory

func LoadRunbooksFromDirectory(dir string) uint32

func RenderTemplates

func RenderTemplates(templateName string, rawCmd string, stringVars map[string]*string, variableDefinitions map[string]Variable) ([]string, error)

func Reset added in v0.11.0

func Reset()

func ValidateRunbook added in v0.11.0

func ValidateRunbook(runbook *Runbook) error

Types

type Runbook

type Runbook struct {

	// The name of the runbook
	Name string `yaml:"name"`

	Description *RunbookDescription `yaml:"description"`

	// The location of relevant documentation
	Docs string `yaml:"docs"`

	RunbookActions map[string]*RunbookAction `yaml:"actions"`
}

type RunbookAction

type RunbookAction struct {
	Name         string
	Description  *RunbookDescription
	RawCommands  []string `yaml:"commands"`
	IgnoreErrors bool     `yaml:"ignore_errors"`

	Variables map[string]Variable `yaml:"variables"`
}

type RunbookDescription

type RunbookDescription struct {
	Long  string `yaml:"long"`
	Short string `yaml:"short"`
}

type Variable

type Variable struct {
	Name        string
	Type        string `yaml:"type"`
	Default     string `yaml:"default"`
	Required    bool   `yaml:"required"`
	Description *RunbookDescription
}

Jump to

Keyboard shortcuts

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