Documentation
¶
Index ¶
- Constants
- func UnmarshalJSON(b []byte) (influxdb.NotificationEndpoint, error)
- type Base
- func (b Base) GetCRUDLog() influxdb.CRUDLog
- func (b *Base) GetDescription() string
- func (b Base) GetID() platform.ID
- func (b *Base) GetName() string
- func (b Base) GetOrgID() platform.ID
- func (b *Base) GetStatus() influxdb.Status
- 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) SetStatus(status influxdb.Status)
- type HTTP
- type PagerDuty
- type Slack
- type Telegram
Constants ¶
const ( SlackType = "slack" PagerDutyType = "pagerduty" HTTPType = "http" TelegramType = "telegram" )
types of endpoints.
Variables ¶
This section is empty.
Functions ¶
func UnmarshalJSON ¶
func UnmarshalJSON(b []byte) (influxdb.NotificationEndpoint, error)
UnmarshalJSON will convert the bytes to notification endpoint.
Types ¶
type Base ¶
type Base struct {
ID *platform.ID `json:"id,omitempty"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
OrgID *platform.ID `json:"orgID,omitempty"`
Status influxdb.Status `json:"status"`
influxdb.CRUDLog
}
Base is the embed struct of every notification endpoint.
func (Base) GetCRUDLog ¶
GetCRUDLog implements influxdb.Getter interface.
func (*Base) GetDescription ¶
GetDescription implements influxdb.Getter interface.
func (*Base) SetDescription ¶
SetDescription implements influxdb.Updator interface.
type HTTP ¶
type HTTP struct {
Base
// Path is the API path of HTTP
URL string `json:"url"`
// Token is the bearer token for authorization
Headers map[string]string `json:"headers,omitempty"`
Token influxdb.SecretField `json:"token,omitempty"`
Username influxdb.SecretField `json:"username,omitempty"`
Password influxdb.SecretField `json:"password,omitempty"`
AuthMethod string `json:"authMethod"`
Method string `json:"method"`
ContentTemplate string `json:"contentTemplate"`
}
HTTP is the notification endpoint config of http.
func (*HTTP) BackfillSecretKeys ¶
func (s *HTTP) BackfillSecretKeys()
BackfillSecretKeys fill back fill the secret field key during the unmarshalling if value of that secret field is not nil.
func (HTTP) MarshalJSON ¶
MarshalJSON implement json.Marshaler interface.
func (HTTP) ParseResponse ¶
ParseResponse will parse the http response from http.
func (HTTP) SecretFields ¶
func (s HTTP) SecretFields() []influxdb.SecretField
SecretFields return available secret fields.
type PagerDuty ¶
type PagerDuty struct {
Base
// ClientURL is the url that is presented in the PagerDuty UI when this alert is triggered
ClientURL string `json:"clientURL"`
// RoutingKey is a version 4 UUID expressed as a 32-digit hexadecimal number.
// This is the Integration Key for an integration on any given service.
RoutingKey influxdb.SecretField `json:"routingKey"`
}
PagerDuty is the notification endpoint config of pagerduty.
func (*PagerDuty) BackfillSecretKeys ¶
func (s *PagerDuty) BackfillSecretKeys()
BackfillSecretKeys fill back fill the secret field key during the unmarshalling if value of that secret field is not nil.
func (PagerDuty) MarshalJSON ¶
MarshalJSON implement json.Marshaler interface.
func (PagerDuty) SecretFields ¶
func (s PagerDuty) SecretFields() []influxdb.SecretField
SecretFields return available secret fields.
type Slack ¶
type Slack struct {
Base
// URL is a valid slack webhook URL
// TODO(jm): validate this in unmarshaler
// example: https://slack.com/api/chat.postMessage
URL string `json:"url"`
// Token is the bearer token for authorization
Token influxdb.SecretField `json:"token"`
}
Slack is the notification endpoint config of slack.
func (*Slack) BackfillSecretKeys ¶
func (s *Slack) BackfillSecretKeys()
BackfillSecretKeys fill back fill the secret field key during the unmarshalling if value of that secret field is not nil.
func (Slack) MarshalJSON ¶
MarshalJSON implement json.Marshaler interface.
func (Slack) SecretFields ¶
func (s Slack) SecretFields() []influxdb.SecretField
SecretFields return available secret fields.
type Telegram ¶
type Telegram struct {
Base
// Token is the telegram bot token, see https://core.telegram.org/bots#creating-a-new-bot
Token influxdb.SecretField `json:"token"`
// Channel is an ID of the telegram channel, see https://core.telegram.org/bots/api#sendmessage
Channel string `json:"channel"`
}
Telegram is the notification endpoint config of telegram.
func (*Telegram) BackfillSecretKeys ¶
func (s *Telegram) BackfillSecretKeys()
BackfillSecretKeys fill back the secret field key during the unmarshalling if value of that secret field is not nil.
func (Telegram) MarshalJSON ¶
MarshalJSON implement json.Marshaler interface.
func (Telegram) SecretFields ¶
func (s Telegram) SecretFields() []influxdb.SecretField
SecretFields return available secret fields.