Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddPlaybookEntry ¶
func AddPlaybookEntry(ctx context.Context, entry *PlaybookEntry) 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{}
Click to show internal directories.
Click to hide internal directories.