runbooks

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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)

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"`
	Description *RunbookDescription
}

Jump to

Keyboard shortcuts

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