本文整理汇总了Golang中github.com/grafana/grafana/pkg/services/alerting.RegisterNotifier函数的典型用法代码示例。如果您正苦于以下问题:Golang RegisterNotifier函数的具体用法?Golang RegisterNotifier怎么用?Golang RegisterNotifier使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RegisterNotifier函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: init
func init() {
alerting.RegisterNotifier(&alerting.NotifierPlugin{
Type: "webhook",
Name: "webhook",
Description: "Sends HTTP POST request to a URL",
Factory: NewWebHookNotifier,
OptionsTemplate: `
<h3 class="page-heading">Webhook settings</h3>
<div class="gf-form">
<span class="gf-form-label width-10">Url</span>
<input type="text" required class="gf-form-input max-width-26" ng-model="ctrl.model.settings.url"></input>
</div>
<div class="gf-form">
<span class="gf-form-label width-10">Http Method</span>
<div class="gf-form-select-wrapper width-14">
<select class="gf-form-input" ng-model="ctrl.model.settings.httpMethod" ng-options="t for t in ['POST', 'PUT']">
</select>
</div>
</div>
<div class="gf-form">
<span class="gf-form-label width-10">Username</span>
<input type="text" class="gf-form-input max-width-14" ng-model="ctrl.model.settings.username"></input>
</div>
<div class="gf-form">
<span class="gf-form-label width-10">Password</span>
<input type="text" class="gf-form-input max-width-14" ng-model="ctrl.model.settings.password"></input>
</div>
`,
})
}
示例2: init
func init() {
alerting.RegisterNotifier(&alerting.NotifierPlugin{
Type: "telegram",
Name: "Telegram",
Description: "Sends notifications to Telegram",
Factory: NewOpsGenieNotifier,
OptionsTemplate: `
<h3 class="page-heading">Telegram API settings</h3>
<div class="gf-form">
<span class="gf-form-label width-9">BOT API Token</span>
<input type="text" required
class="gf-form-input"
ng-model="ctrl.model.settings.bottoken"
placeholder="Telegram BOT API Token"></input>
</div>
<div class="gf-form">
<span class="gf-form-label width-9">Chat ID</span>
<input type="text" required
class="gf-form-input"
ng-model="ctrl.model.settings.chatid"
data-placement="right">
</input>
<info-popover mode="right-absolute">
Integer Telegram Chat Identifier
</info-popover>
</div>
`,
})
}
示例3: init
func init() {
alerting.RegisterNotifier(&alerting.NotifierPlugin{
Type: "victorops",
Name: "VictorOps",
Description: "Sends notifications to VictorOps",
Factory: NewVictoropsNotifier,
OptionsTemplate: `
<h3 class="page-heading">VictorOps settings</h3>
<div class="gf-form">
<span class="gf-form-label width-6">Url</span>
<input type="text" required class="gf-form-input max-width-30" ng-model="ctrl.model.settings.url" placeholder="VictorOps url"></input>
</div>
`,
})
}
示例4: init
func init() {
alerting.RegisterNotifier(&alerting.NotifierPlugin{
Type: "LINE",
Name: "LINE",
Description: "Send notifications to LINE notify",
Factory: NewLINENotifier,
OptionsTemplate: `
<div class="gf-form-group">
<h3 class="page-heading">LINE notify settings</h3>
<div class="gf-form">
<span class="gf-form-label width-14">Token</span>
<input type="text" required class="gf-form-input max-width-22" ng-model="ctrl.model.settings.token" placeholder="LINE notify token key"></input>
</div>
</div>
`,
})
}
示例5: init
func init() {
alerting.RegisterNotifier(&alerting.NotifierPlugin{
Type: "email",
Name: "Email",
Description: "Sends notifications using Grafana server configured STMP settings",
Factory: NewEmailNotifier,
OptionsTemplate: `
<h3 class="page-heading">Email addresses</h3>
<div class="gf-form">
<textarea rows="7" class="gf-form-input width-25" required ng-model="ctrl.model.settings.addresses"></textarea>
</div>
<div class="gf-form">
<span>You can enter multiple email addresses using a ";" separator</span>
</div>
`,
})
}
示例6: init
func init() {
alerting.RegisterNotifier(&alerting.NotifierPlugin{
Type: "slack",
Name: "Slack",
Description: "Sends notifications using Grafana server configured STMP settings",
Factory: NewSlackNotifier,
OptionsTemplate: `
<h3 class="page-heading">Slack settings</h3>
<div class="gf-form max-width-30">
<span class="gf-form-label width-6">Url</span>
<input type="text" required class="gf-form-input max-width-30" ng-model="ctrl.model.settings.url" placeholder="Slack incoming webhook url"></input>
</div>
<div class="gf-form max-width-30">
<span class="gf-form-label width-6">Recipient</span>
<input type="text"
class="gf-form-input max-width-30"
ng-model="ctrl.model.settings.recipient"
data-placement="right">
</input>
<info-popover mode="right-absolute">
Override default channel or user, use #channel-name or @username
</info-popover>
</div>
<div class="gf-form max-width-30">
<span class="gf-form-label width-6">Mention</span>
<input type="text"
class="gf-form-input max-width-30"
ng-model="ctrl.model.settings.mention"
data-placement="right">
</input>
<info-popover mode="right-absolute">
Mention a user or a group using @ when notifying in a channel
</info-popover>
</div>
`,
})
}
示例7: init
func init() {
alerting.RegisterNotifier(&alerting.NotifierPlugin{
Type: "sensu",
Name: "Sensu",
Description: "Sends HTTP POST request to a Sensu API",
Factory: NewSensuNotifier,
OptionsTemplate: `
<h3 class="page-heading">Sensu settings</h3>
<div class="gf-form">
<span class="gf-form-label width-10">Url</span>
<input type="text" required class="gf-form-input max-width-26" ng-model="ctrl.model.settings.url" placeholder="http://sensu-api.local:4567/results"></input>
</div>
<div class="gf-form">
<span class="gf-form-label width-10">Username</span>
<input type="text" class="gf-form-input max-width-14" ng-model="ctrl.model.settings.username"></input>
</div>
<div class="gf-form">
<span class="gf-form-label width-10">Password</span>
<input type="text" class="gf-form-input max-width-14" ng-model="ctrl.model.settings.password"></input>
</div>
`,
})
}
示例8: init
func init() {
alerting.RegisterNotifier(&alerting.NotifierPlugin{
Type: "pagerduty",
Name: "PagerDuty",
Description: "Sends notifications to PagerDuty",
Factory: NewPagerdutyNotifier,
OptionsTemplate: `
<h3 class="page-heading">PagerDuty settings</h3>
<div class="gf-form">
<span class="gf-form-label width-14">Integration Key</span>
<input type="text" required class="gf-form-input max-width-22" ng-model="ctrl.model.settings.integrationKey" placeholder="Pagerduty integeration Key"></input>
</div>
<div class="gf-form">
<gf-form-switch
class="gf-form"
label="Auto resolve incidents"
label-class="width-14"
checked="ctrl.model.settings.autoResolve"
tooltip="Resolve incidents in pagerduty once the alert goes back to ok.">
</gf-form-switch>
</div>
`,
})
}
示例9: init
func init() {
alerting.RegisterNotifier(&alerting.NotifierPlugin{
Type: "opsgenie",
Name: "OpsGenie",
Description: "Sends notifications to OpsGenie",
Factory: NewOpsGenieNotifier,
OptionsTemplate: `
<h3 class="page-heading">OpsGenie settings</h3>
<div class="gf-form">
<span class="gf-form-label width-14">API Key</span>
<input type="text" required class="gf-form-input max-width-22" ng-model="ctrl.model.settings.apiKey" placeholder="OpsGenie API Key"></input>
</div>
<div class="gf-form">
<gf-form-switch
class="gf-form"
label="Auto close incidents"
label-class="width-14"
checked="ctrl.model.settings.autoClose"
tooltip="Automatically close alerts in OpseGenie once the alert goes back to ok.">
</gf-form-switch>
</div>
`,
})
}
示例10: init
func init() {
alerting.RegisterNotifier("victorops", NewVictoropsNotifier)
}
示例11: init
func init() {
alerting.RegisterNotifier("slack", NewSlackNotifier)
}
示例12: init
func init() {
alerting.RegisterNotifier("opsgenie", NewOpsGenieNotifier)
}
示例13: init
func init() {
alerting.RegisterNotifier("webhook", NewWebHookNotifier)
}
示例14: init
func init() {
alerting.RegisterNotifier("email", NewEmailNotifier)
}
示例15: init
func init() {
alerting.RegisterNotifier("pagerduty", NewPagerdutyNotifier)
}