Documentation
¶
Index ¶
- Constants
- func GetDetailsMap() map[string]ApiSchema
- func GetNameMap() map[string]string
- func SyncList(triggers []ApiSchema)
- func TimeISO8601Z(t time.Time) string
- type ApiSchema
- func (a *ApiSchema) AppendEmail(email email.Recipient)
- func (a *ApiSchema) AppendSlack(slack slack.ApiChannel)
- func (a *ApiSchema) GenEmailList() []string
- func (a *ApiSchema) GenMatchRule() string
- func (a *ApiSchema) GenSlackList() []string
- func (a *ApiSchema) GenTaskUpdate() ApiSchema
- func (a *ApiSchema) HasEmail(email string) bool
- func (a *ApiSchema) HasEmailRecipients() bool
- func (a *ApiSchema) HasSlack(channel string) bool
- func (a *ApiSchema) HasSlackChannels() bool
- func (a *ApiSchema) IsSame(trigger ApiSchema) bool
- func (a *ApiSchema) SetCompleted()
- func (a *ApiSchema) SetEmailDetails(email email.Recipient)
- func (a *ApiSchema) SetError()
- func (a *ApiSchema) SetOk()
- func (a *ApiSchema) SetSlackDetails(slack slack.ApiChannel)
- func (a *ApiSchema) SetUpdating()
- func (a *ApiSchema) ToCosSchema() CosSchema
- type Attribute
- type CosSchema
- type Execs
- type Response
- type Toggle
- type WriteResponses
Constants ¶
View Source
const ( Triggers = "triggers" DB = "triggers" Collection = "triggers" ReqCollection = "requests" ReqTTL = 3600 ResponsePolicyV2 = "/etc/policies/alert_resp/alert_resp2_0.yml" ISO8601Z = "2006-01-02T15:04:05+00:00" )
View Source
const (
Module = "triggers"
)
Variables ¶
This section is empty.
Functions ¶
func GetDetailsMap ¶
func GetNameMap ¶
func TimeISO8601Z ¶
Types ¶
type ApiSchema ¶
type ApiSchema struct {
Name string `json:"name" yaml:"name" bson:"name"`
Description string `json:"description" yaml:"description" bson:"description"`
Match string `json:"-" yaml:"match"`
Attributes []Attribute `json:"attributes" bson:"attributes" yaml:"-"`
Response `json:"response" yaml:"response" bson:"response"`
Enabled bool `json:"enabled" yaml:"enabled" bson:"enabled"`
Status *status.Trigger `json:"status" yaml:"-" bson:"status"`
IsReportRequired bool `json:"-" yaml:"-"`
}
func (*ApiSchema) AppendEmail ¶
func (*ApiSchema) AppendSlack ¶
func (a *ApiSchema) AppendSlack(slack slack.ApiChannel)
func (*ApiSchema) GenEmailList ¶
func (*ApiSchema) GenMatchRule ¶
func (*ApiSchema) GenSlackList ¶
func (*ApiSchema) GenTaskUpdate ¶
func (*ApiSchema) HasEmailRecipients ¶
func (*ApiSchema) HasSlackChannels ¶
func (*ApiSchema) SetCompleted ¶
func (a *ApiSchema) SetCompleted()
func (*ApiSchema) SetEmailDetails ¶
func (*ApiSchema) SetSlackDetails ¶
func (a *ApiSchema) SetSlackDetails(slack slack.ApiChannel)
func (*ApiSchema) SetUpdating ¶
func (a *ApiSchema) SetUpdating()
func (*ApiSchema) ToCosSchema ¶
type CosSchema ¶
type CosSchema struct {
Name string `json:"name"`
Enabled bool `json:"enabled"`
Topic string `json:"topic"`
Match string `json:"match"`
Description string `json:"description"`
Emails []email.Recipient `json:"emails"`
Slacks []slack.CosChannel `json:"slacks"`
WriteResponses `json:"responses"`
Execs `json:"execs"`
}
func (*CosSchema) ConvertToApiAttributes ¶
func (*CosSchema) ConvertToApiEmails ¶
func (*CosSchema) ConvertToApiSlacks ¶
func (c *CosSchema) ConvertToApiSlacks() []slack.ApiChannel
func (*CosSchema) ToApiSchema ¶
type Response ¶
type Response struct {
Types []string `json:"types" yaml:"-" bson:"types"`
Slacks []slack.ApiChannel `json:"slacks" yaml:"slacks" bson:"slacks"`
Emails []email.Recipient `json:"emails" yaml:"emails" bson:"emails"`
}
type WriteResponses ¶
Click to show internal directories.
Click to hide internal directories.