Documentation
¶
Index ¶
- Constants
- func GetDetailsMap() map[string]ApiOptions
- func GetNameMap() map[string]string
- func SyncList(triggers []ApiOptions)
- func TimeISO8601Z(t time.Time) string
- type ApiOptions
- func (a *ApiOptions) AppendEmail(email email.Recipient)
- func (a *ApiOptions) AppendSlack(slack slack.ApiChannel)
- func (a *ApiOptions) ConvertToCosOptions() CosOptions
- func (a *ApiOptions) GenEmailList() []string
- func (a *ApiOptions) GenMatchRule() string
- func (a *ApiOptions) GenSlackList() []string
- func (a *ApiOptions) GenTaskUpdate() ApiOptions
- func (a *ApiOptions) HasEmail(email string) bool
- func (a *ApiOptions) HasEmailRecipients() bool
- func (a *ApiOptions) HasSlack(channel string) bool
- func (a *ApiOptions) HasSlackChannels() bool
- func (a *ApiOptions) InitOkStatus()
- func (a *ApiOptions) InitUpdateStatus()
- func (a *ApiOptions) IsSame(trigger ApiOptions) bool
- func (a *ApiOptions) SetCompleted()
- func (a *ApiOptions) SetEmailDetails(email email.Recipient)
- func (a *ApiOptions) SetError()
- func (a *ApiOptions) SetSlackDetails(slack slack.ApiChannel)
- type Attribute
- type CosOptions
- 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" )
Variables ¶
This section is empty.
Functions ¶
func GetDetailsMap ¶
func GetDetailsMap() map[string]ApiOptions
func GetNameMap ¶
func SyncList ¶
func SyncList(triggers []ApiOptions)
func TimeISO8601Z ¶
Types ¶
type ApiOptions ¶
type ApiOptions 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"` ShouldReportToController bool `json:"-" yaml:"-"` }
func Get ¶
func Get(name string) (*ApiOptions, bool)
func GetList ¶
func GetList() []ApiOptions
func (*ApiOptions) AppendEmail ¶
func (a *ApiOptions) AppendEmail(email email.Recipient)
func (*ApiOptions) AppendSlack ¶
func (a *ApiOptions) AppendSlack(slack slack.ApiChannel)
func (*ApiOptions) ConvertToCosOptions ¶
func (a *ApiOptions) ConvertToCosOptions() CosOptions
func (*ApiOptions) GenEmailList ¶
func (a *ApiOptions) GenEmailList() []string
func (*ApiOptions) GenMatchRule ¶
func (a *ApiOptions) GenMatchRule() string
func (*ApiOptions) GenSlackList ¶
func (a *ApiOptions) GenSlackList() []string
func (*ApiOptions) GenTaskUpdate ¶
func (a *ApiOptions) GenTaskUpdate() ApiOptions
func (*ApiOptions) HasEmail ¶
func (a *ApiOptions) HasEmail(email string) bool
func (*ApiOptions) HasEmailRecipients ¶
func (a *ApiOptions) HasEmailRecipients() bool
func (*ApiOptions) HasSlack ¶
func (a *ApiOptions) HasSlack(channel string) bool
func (*ApiOptions) HasSlackChannels ¶
func (a *ApiOptions) HasSlackChannels() bool
func (*ApiOptions) InitOkStatus ¶
func (a *ApiOptions) InitOkStatus()
func (*ApiOptions) InitUpdateStatus ¶
func (a *ApiOptions) InitUpdateStatus()
func (*ApiOptions) IsSame ¶
func (a *ApiOptions) IsSame(trigger ApiOptions) bool
func (*ApiOptions) SetCompleted ¶
func (a *ApiOptions) SetCompleted()
func (*ApiOptions) SetEmailDetails ¶
func (a *ApiOptions) SetEmailDetails(email email.Recipient)
func (*ApiOptions) SetError ¶
func (a *ApiOptions) SetError()
func (*ApiOptions) SetSlackDetails ¶
func (a *ApiOptions) SetSlackDetails(slack slack.ApiChannel)
type CosOptions ¶
type CosOptions 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 (*CosOptions) Bytes ¶
func (c *CosOptions) Bytes() ([]byte, error)
func (*CosOptions) ConvertToApiAttributes ¶
func (c *CosOptions) ConvertToApiAttributes() []Attribute
func (*CosOptions) ConvertToApiEmails ¶
func (c *CosOptions) ConvertToApiEmails() []email.Recipient
func (*CosOptions) ConvertToApiOptions ¶
func (c *CosOptions) ConvertToApiOptions() ApiOptions
func (*CosOptions) ConvertToApiSlacks ¶
func (c *CosOptions) ConvertToApiSlacks() []slack.ApiChannel
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.