playbook

package
v0.7.6 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2024 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPlaybookEntry

func AddPlaybookEntry(ctx context.Context, entry *PlaybookEntry) error

func RemovePlaybookEntry

func RemovePlaybookEntry(ctx context.Context, playbookId string, entryId string) error

Types

type PlaybookEntry

type PlaybookEntry struct {
	PlaybookId  string `json:"playbookid"`
	EntryId     string `json:"entryid"`
	Alias       string `json:"alias"`
	CmdStr      string `json:"cmdstr"`
	UpdatedTs   int64  `json:"updatedts"`
	CreatedTs   int64  `json:"createdts"`
	Description string `json:"description"`
	Remove      bool   `json:"remove,omitempty"`
}

type PlaybookType

type PlaybookType struct {
	PlaybookId   string   `json:"playbookid"`
	PlaybookName string   `json:"playbookname"`
	Description  string   `json:"description"`
	EntryIds     []string `json:"entryids"`

	// this is not persisted to DB, just for transport to FE
	Entries []*PlaybookEntry `json:"entries"`
}

func CreatePlaybook

func CreatePlaybook(ctx context.Context, name string) (*PlaybookType, error)

func GetPlaybookById

func GetPlaybookById(ctx context.Context, playbookId string) (*PlaybookType, error)

func (*PlaybookType) FromMap

func (p *PlaybookType) FromMap(m map[string]interface{}) bool

func (*PlaybookType) OrderEntries

func (p *PlaybookType) OrderEntries()

reorders p.Entries to match p.EntryIds

func (*PlaybookType) RemoveEntry

func (p *PlaybookType) RemoveEntry(entryIdToRemove string)

removes from p.EntryIds (not from p.Entries)

func (*PlaybookType) ToMap

func (p *PlaybookType) ToMap() map[string]interface{}

Jump to

Keyboard shortcuts

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