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: 0

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