Documentation ¶
Index ¶
- func UnmarshalJSON(b []byte) (influxdb.NotificationRule, error)
- type Base
- func (b *Base) ClearPrivateData()
- func (b Base) GetCRUDLog() influxdb.CRUDLog
- func (b *Base) GetDescription() string
- func (b Base) GetEndpointID() platform.ID
- func (b Base) GetID() platform.ID
- func (b *Base) GetLimit() *influxdb.Limit
- func (b *Base) GetName() string
- func (b Base) GetOrgID() platform.ID
- func (b Base) GetOwnerID() platform.ID
- func (b Base) GetTaskID() platform.ID
- func (b *Base) MatchesTags(tags []influxdb.Tag) bool
- func (b *Base) SetDescription(description string)
- func (b *Base) SetID(id platform.ID)
- func (b *Base) SetName(name string)
- func (b *Base) SetOrgID(id platform.ID)
- func (b *Base) SetOwnerID(id platform.ID)
- func (b *Base) SetTaskID(id platform.ID)
- type HTTP
- type PagerDuty
- type Slack
- type Telegram
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UnmarshalJSON ¶
UnmarshalJSON will convert
Types ¶
type Base ¶
type Base struct { ID platform.ID `json:"id,omitempty"` Name string `json:"name"` Description string `json:"description,omitempty"` EndpointID platform.ID `json:"endpointID,omitempty"` OrgID platform.ID `json:"orgID,omitempty"` OwnerID platform.ID `json:"ownerID,omitempty"` TaskID platform.ID `json:"taskID,omitempty"` // SleepUntil is an optional sleeptime to start a task. SleepUntil *time.Time `json:"sleepUntil,omitempty"` Every *notification.Duration `json:"every,omitempty"` // Offset represents a delay before execution. // It gets marshalled from a string duration, i.e.: "10s" is 10 seconds Offset *notification.Duration `json:"offset,omitempty"` RunbookLink string `json:"runbookLink"` TagRules []notification.TagRule `json:"tagRules,omitempty"` StatusRules []notification.StatusRule `json:"statusRules,omitempty"` *influxdb.Limit influxdb.CRUDLog }
Base is the embed struct of every notification rule.
func (*Base) ClearPrivateData ¶
func (b *Base) ClearPrivateData()
ClearPrivateData clears the task ID from the base.
func (Base) GetCRUDLog ¶
func (b Base) GetCRUDLog() influxdb.CRUDLog
GetCRUDLog implements influxdb.Getter interface.
func (*Base) GetDescription ¶
GetDescription implements influxdb.Getter interface.
func (Base) GetEndpointID ¶
GetEndpointID gets the endpointID for a base.
func (*Base) GetLimit ¶
func (b *Base) GetLimit() *influxdb.Limit
GetLimit returns the limit pointer.
func (*Base) MatchesTags ¶
MatchesTags returns true if the Rule matches all of the tags
func (*Base) SetDescription ¶
SetDescription implements influxdb.Updator interface.
func (*Base) SetOwnerID ¶
SetOwnerID will set the owner id.
type HTTP ¶
type HTTP struct {
Base
}
HTTP is the notification rule config of http.
func (*HTTP) GenerateFlux ¶
GenerateFlux generates a flux script for the http notification rule.
func (*HTTP) GenerateFluxAST ¶
GenerateFluxAST generates a flux AST for the http notification rule.
func (HTTP) MarshalJSON ¶
MarshalJSON implement json.Marshaler interface.
type PagerDuty ¶
PagerDuty is the rule config of pagerduty notification.
func (*PagerDuty) GenerateFlux ¶
GenerateFlux generates a flux script for the pagerduty notification rule.
func (*PagerDuty) GenerateFluxAST ¶
GenerateFluxAST generates a flux AST for the pagerduty notification rule.
func (PagerDuty) MarshalJSON ¶
MarshalJSON implement json.Marshaler interface.
type Slack ¶
type Slack struct { Base Channel string `json:"channel"` MessageTemplate string `json:"messageTemplate"` }
Slack is the notification rule config of slack.
func (*Slack) GenerateFlux ¶
GenerateFlux generates a flux script for the slack notification rule.
func (*Slack) GenerateFluxAST ¶
GenerateFluxAST generates a flux AST for the slack notification rule.
func (Slack) MarshalJSON ¶
MarshalJSON implement json.Marshaler interface.
type Telegram ¶
type Telegram struct { Base MessageTemplate string `json:"messageTemplate"` ParseMode string `json:"parseMode"` DisableWebPagePreview bool `json:"disableWebPagePreview"` }
Telegram is the notification rule config of telegram.
func (*Telegram) GenerateFlux ¶
GenerateFlux generates a flux script for the telegram notification rule.
func (*Telegram) GenerateFluxAST ¶
GenerateFluxAST generates a flux AST for the telegram notification rule.
func (Telegram) MarshalJSON ¶
MarshalJSON implement json.Marshaler interface.