Documentation
¶
Index ¶
- func ParsePlaybook(entryFile string, readFile ReadFile, book *Playbook) error
- type Action
- type ActionArgs
- type ActionLog
- type ActionRecord
- type ActionResult
- type ActionRunRequest
- type ActionRunResponse
- type Alert
- type AlertMetaData
- type AlertPolicyResult
- type AlertRecord
- type ArgOption
- type ArgParser
- type ArgumentRecord
- type Attribute
- type AttributeRecord
- type Attributes
- type Clock
- type Commit
- type Event
- type NextRecord
- type PlayLog
- type Playbook
- type PubSubMessage
- type PubSubRequest
- type Query
- type ReadFile
- type Reference
- type ReferenceRecord
- type References
- type Scenario
- type ScenarioLog
- type WorkflowRecord
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Action ¶
type Action struct {
ID types.ActionID `json:"id"`
Name string `json:"name"`
Uses types.ActionName `json:"uses"`
Args ActionArgs `json:"args"`
Force bool `json:"force"`
Abort bool `json:"abort"`
Commit []Commit `json:"commit"`
}
type ActionArgs ¶
func (ActionArgs) Parse ¶
func (x ActionArgs) Parse(psr ...ArgParser) error
type ActionRecord ¶
type ActionRecord struct {
ID string `json:"id"`
Seq int `json:"seq"`
Uses string `json:"uses"`
Args []*ArgumentRecord `json:"args"`
Result *string `json:"result,omitempty"`
Next []*NextRecord `json:"next"`
Error *string `json:"error,omitempty"`
StartedAt time.Time `json:"startedAt"`
FinishedAt time.Time `json:"finishedAt"`
}
type ActionResult ¶
type ActionResult struct {
Action
Result any `json:"result,omitempty"`
Attrs Attributes
}
type ActionRunRequest ¶
type ActionRunRequest struct {
Alert Alert `json:"alert"`
EnvVars types.EnvVars `json:"env" masq:"secret"`
Seq int `json:"seq"`
Called []ActionResult `json:"called"`
}
type ActionRunResponse ¶
type ActionRunResponse struct {
Runs []Action `json:"run"`
}
type Alert ¶
type Alert struct {
AlertMetaData
ID types.AlertID `json:"id"`
Schema types.Schema `json:"schema"`
Data any `json:"data,omitempty"`
CreatedAt time.Time `json:"created_at"`
// Raw is a JSON string of Data. The field will be redacted by masq because of verbosity.
Raw string `json:"raw,omitempty" masq:"quiet"`
}
type AlertMetaData ¶
type AlertMetaData struct {
Title string `json:"title"`
Description string `json:"description"`
Source string `json:"source"`
Namespace types.Namespace `json:"namespace"`
Attrs Attributes `json:"attrs"`
Refs References `json:"refs"`
}
func (AlertMetaData) Copy ¶
func (x AlertMetaData) Copy() AlertMetaData
type AlertPolicyResult ¶
type AlertPolicyResult struct {
Alerts []AlertMetaData `json:"alert"`
}
type AlertRecord ¶
type AlertRecord struct {
ID types.AlertID `json:"id"`
Schema string `json:"schema"`
Data string `json:"data"`
CreatedAt time.Time `json:"createdAt"`
Title string `json:"title"`
Description string `json:"description"`
Source string `json:"source"`
Namespace *string `json:"namespace,omitempty"`
InitAttrs []*AttributeRecord `json:"initAttrs"`
LastAttrs []*AttributeRecord `json:"lastAttrs"`
Refs []*ReferenceRecord `json:"refs"`
}
type ArgOption ¶
type ArgOption func(*argParserOption)
func ArgOptional ¶
func ArgOptional() ArgOption
type ArgParser ¶
type ArgParser func(args ActionArgs) error
type ArgumentRecord ¶
type Attribute ¶
type Attribute struct {
ID types.AttrID `json:"id" firestore:"id"`
Key types.AttrKey `json:"key" firestore:"key"`
Value types.AttrValue `json:"value" firestore:"value"`
Type types.AttrType `json:"type" firestore:"type"`
Persist bool `json:"persist" firestore:"persist"`
TTL int `json:"ttl" firestore:"ttl"`
}
type AttributeRecord ¶
type Attributes ¶
type Attributes []Attribute
func (Attributes) Copy ¶
func (x Attributes) Copy() Attributes
func (Attributes) Tidy ¶
func (x Attributes) Tidy() Attributes
type Event ¶
type NextRecord ¶
type NextRecord struct {
Abort bool `json:"abort"`
Attrs []*AttributeRecord `json:"attrs"`
}
type PubSubMessage ¶
type PubSubRequest ¶
type PubSubRequest struct {
DeliveryAttempt int64 `json:"deliveryAttempt"`
Message PubSubMessage `json:"message"`
Subscription string `json:"subscription"`
}
type ReferenceRecord ¶
type References ¶
type References []Reference
func (References) Copy ¶
func (refs References) Copy() References
type Scenario ¶
type Scenario struct {
ID types.ScenarioID `json:"id"`
Title types.ScenarioTitle `json:"title"`
Events []Event `json:"events"`
Env types.EnvVars `json:"env"`
}
func (*Scenario) ToLog ¶
func (x *Scenario) ToLog() ScenarioLog
type ScenarioLog ¶
type ScenarioLog struct {
ID types.ScenarioID `json:"id"`
Title types.ScenarioTitle `json:"title"`
Results []*PlayLog `json:"results,omitempty"`
Error string `json:"error,omitempty"`
}
type WorkflowRecord ¶
type WorkflowRecord struct {
ID types.WorkflowID `json:"id"`
CreatedAt time.Time `json:"createdAt"`
Alert *AlertRecord `json:"alert"`
Actions []*ActionRecord `json:"actions"`
}
Click to show internal directories.
Click to hide internal directories.