Documentation ¶
Index ¶
- Constants
- Variables
- type Config
- func (c *Config) GenerateReceivers(nr *v2beta2.Receiver, nc *v2beta2.Config) ([]Receiver, error)
- func (c *Config) GetCredential(credential *v2beta2.Credential) (string, error)
- func (c *Config) OutputReceiver(tenant, receiver string) interface{}
- func (c *Config) RcvsFromNs(namespace *string) []Receiver
- func (c *Config) RcvsFromTenantID(tenantID string) []Receiver
- func (c *Config) Run() error
- type DingTalk
- func (c DingTalk) Enabled() bool
- func (d *DingTalk) GetConfig() interface{}
- func (c DingTalk) GetConfigSelector() *metav1.LabelSelector
- func (c DingTalk) GetType() string
- func (d *DingTalk) SetConfig(obj interface{}) error
- func (c DingTalk) SetUseDefault(b bool)
- func (c DingTalk) UseDefault() bool
- func (d *DingTalk) Validate() error
- type DingTalkChatBot
- type DingTalkConfig
- type Email
- func (c Email) Enabled() bool
- func (e *Email) GetConfig() interface{}
- func (c Email) GetConfigSelector() *metav1.LabelSelector
- func (c Email) GetType() string
- func (e *Email) SetConfig(obj interface{}) error
- func (c Email) SetUseDefault(b bool)
- func (c Email) UseDefault() bool
- func (e *Email) Validate() error
- type EmailConfig
- type Pushover
- func (c Pushover) Enabled() bool
- func (p *Pushover) GetConfig() interface{}
- func (c Pushover) GetConfigSelector() *metav1.LabelSelector
- func (c Pushover) GetType() string
- func (p *Pushover) SetConfig(obj interface{}) error
- func (c Pushover) SetUseDefault(b bool)
- func (c Pushover) UseDefault() bool
- func (p *Pushover) Validate() error
- type PushoverConfig
- type Receiver
- func NewDingTalkConfig(dc *v2beta2.DingTalkConfig) Receiver
- func NewDingTalkReceiver(c *Config, dr *v2beta2.DingTalkReceiver) Receiver
- func NewEmailConfig(ec *v2beta2.EmailConfig) Receiver
- func NewEmailReceiver(c *Config, er *v2beta2.EmailReceiver) Receiver
- func NewPushoverConfig(sc *v2beta2.PushoverConfig) Receiver
- func NewPushoverReceiver(c *Config, pr *v2beta2.PushoverReceiver) Receiver
- func NewReceiver(c *Config, obj interface{}) Receiver
- func NewSlackConfig(sc *v2beta2.SlackConfig) Receiver
- func NewSlackReceiver(c *Config, sr *v2beta2.SlackReceiver) Receiver
- func NewSmsConfig(sc *v2beta2.SmsConfig) Receiver
- func NewSmsReceiver(c *Config, sr *v2beta2.SmsReceiver) Receiver
- func NewWebhookConfig(_ *v2beta2.WebhookConfig) Receiver
- func NewWebhookReceiver(_ *Config, wr *v2beta2.WebhookReceiver) Receiver
- func NewWechatConfig(wc *v2beta2.WechatConfig) Receiver
- func NewWechatReceiver(c *Config, wr *v2beta2.WechatReceiver) Receiver
- type Slack
- func (c Slack) Enabled() bool
- func (s *Slack) GetConfig() interface{}
- func (c Slack) GetConfigSelector() *metav1.LabelSelector
- func (c Slack) GetType() string
- func (s *Slack) SetConfig(obj interface{}) error
- func (c Slack) SetUseDefault(b bool)
- func (c Slack) UseDefault() bool
- func (s *Slack) Validate() error
- type SlackConfig
- type Sms
- type SmsConfig
- type Webhook
- func (c Webhook) Enabled() bool
- func (w *Webhook) GetConfig() interface{}
- func (c Webhook) GetConfigSelector() *metav1.LabelSelector
- func (c Webhook) GetType() string
- func (w *Webhook) SetConfig(obj interface{}) error
- func (c Webhook) SetUseDefault(b bool)
- func (c Webhook) UseDefault() bool
- func (w *Webhook) Validate() error
- type WebhookConfig
- type Wechat
- func (w *Wechat) Clone() *Wechat
- func (c Wechat) Enabled() bool
- func (w *Wechat) GetConfig() interface{}
- func (c Wechat) GetConfigSelector() *metav1.LabelSelector
- func (c Wechat) GetType() string
- func (w *Wechat) SetConfig(obj interface{}) error
- func (c Wechat) SetUseDefault(b bool)
- func (c Wechat) UseDefault() bool
- func (w *Wechat) Validate() error
- type WechatConfig
Constants ¶
View Source
const ( HTML = "html" Text = "text" Markdown = "markdown" Aliyun = "aliyun" Tencent = "tencent" )
Variables ¶
View Source
var (
ChannelCapacity = 1000
)
Functions ¶
This section is empty.
Types ¶
type Config ¶
func (*Config) GenerateReceivers ¶ added in v1.2.0
GenerateReceivers generate receivers from the given notification config and notification receiver. If the notification config is nil, use the exist config. If the notification config is not nil, the receiver will use the given config, the notification config type must matched the notification receiver type.
func (*Config) GetCredential ¶ added in v1.2.0
func (c *Config) GetCredential(credential *v2beta2.Credential) (string, error)
func (*Config) OutputReceiver ¶
func (*Config) RcvsFromNs ¶
func (*Config) RcvsFromTenantID ¶ added in v1.2.0
type DingTalk ¶
type DingTalk struct { ChatIDs []string ChatBot *DingTalkChatBot DingTalkConfig *DingTalkConfig Selector *metav1.LabelSelector Template string TitleTemplate string TmplType string // contains filtered or unexported fields }
func (DingTalk) GetConfigSelector ¶ added in v1.2.0
func (c DingTalk) GetConfigSelector() *metav1.LabelSelector
func (DingTalk) SetUseDefault ¶
func (c DingTalk) SetUseDefault(b bool)
func (DingTalk) UseDefault ¶
func (c DingTalk) UseDefault() bool
type DingTalkChatBot ¶
type DingTalkChatBot struct { Webhook *v2beta2.Credential Keywords []string Secret *v2beta2.Credential AtMobiles []string AtUsers []string AtAll bool }
DingTalkChatBot is the configuration of ChatBot
type DingTalkConfig ¶
type DingTalkConfig struct { AppKey *v2beta2.Credential AppSecret *v2beta2.Credential }
type Email ¶
type Email struct { Template string SubjectTemplate string TmplType string To []string EmailConfig *EmailConfig Selector *metav1.LabelSelector // contains filtered or unexported fields }
func (Email) GetConfigSelector ¶ added in v1.2.0
func (c Email) GetConfigSelector() *metav1.LabelSelector
func (Email) SetUseDefault ¶
func (c Email) SetUseDefault(b bool)
func (Email) UseDefault ¶
func (c Email) UseDefault() bool
type EmailConfig ¶
type Pushover ¶ added in v1.3.0
type Pushover struct { Template string // Profiles are users to send notifications to. Profiles []*v2beta2.PushoverUserProfile PushoverConfig *PushoverConfig Selector *metav1.LabelSelector // contains filtered or unexported fields }
func (Pushover) GetConfigSelector ¶ added in v1.3.0
func (c Pushover) GetConfigSelector() *metav1.LabelSelector
func (Pushover) SetUseDefault ¶ added in v1.3.0
func (c Pushover) SetUseDefault(b bool)
func (Pushover) UseDefault ¶ added in v1.3.0
func (c Pushover) UseDefault() bool
type PushoverConfig ¶ added in v1.3.0
type PushoverConfig struct { // The token of a Pushover application. Token *v2beta2.Credential }
type Receiver ¶
type Receiver interface { Enabled() bool UseDefault() bool SetUseDefault(b bool) GetType() string GetConfigSelector() *metav1.LabelSelector GetConfig() interface{} SetConfig(c interface{}) error Validate() error }
func NewDingTalkConfig ¶ added in v1.0.0
func NewDingTalkConfig(dc *v2beta2.DingTalkConfig) Receiver
func NewDingTalkReceiver ¶
func NewDingTalkReceiver(c *Config, dr *v2beta2.DingTalkReceiver) Receiver
func NewEmailConfig ¶ added in v1.0.0
func NewEmailConfig(ec *v2beta2.EmailConfig) Receiver
func NewEmailReceiver ¶
func NewEmailReceiver(c *Config, er *v2beta2.EmailReceiver) Receiver
func NewPushoverConfig ¶ added in v1.3.0
func NewPushoverConfig(sc *v2beta2.PushoverConfig) Receiver
func NewPushoverReceiver ¶ added in v1.3.0
func NewPushoverReceiver(c *Config, pr *v2beta2.PushoverReceiver) Receiver
func NewReceiver ¶ added in v1.0.0
func NewSlackConfig ¶ added in v1.0.0
func NewSlackConfig(sc *v2beta2.SlackConfig) Receiver
func NewSlackReceiver ¶
func NewSlackReceiver(c *Config, sr *v2beta2.SlackReceiver) Receiver
func NewSmsConfig ¶ added in v1.2.0
func NewSmsReceiver ¶ added in v1.2.0
func NewSmsReceiver(c *Config, sr *v2beta2.SmsReceiver) Receiver
func NewWebhookConfig ¶ added in v1.0.0
func NewWebhookConfig(_ *v2beta2.WebhookConfig) Receiver
func NewWebhookReceiver ¶
func NewWebhookReceiver(_ *Config, wr *v2beta2.WebhookReceiver) Receiver
func NewWechatConfig ¶ added in v1.0.0
func NewWechatConfig(wc *v2beta2.WechatConfig) Receiver
func NewWechatReceiver ¶
func NewWechatReceiver(c *Config, wr *v2beta2.WechatReceiver) Receiver
type Slack ¶
type Slack struct { Template string // The channel or user to send notifications to. Channels []string SlackConfig *SlackConfig Selector *metav1.LabelSelector // contains filtered or unexported fields }
func (Slack) GetConfigSelector ¶ added in v1.2.0
func (c Slack) GetConfigSelector() *metav1.LabelSelector
func (Slack) SetUseDefault ¶
func (c Slack) SetUseDefault(b bool)
func (Slack) UseDefault ¶
func (c Slack) UseDefault() bool
type SlackConfig ¶
type SlackConfig struct { // The token of user or bot. Token *v2beta2.Credential }
type Sms ¶ added in v1.2.0
type Sms struct { Template string PhoneNumbers []string SmsConfig *SmsConfig Selector *metav1.LabelSelector // contains filtered or unexported fields }
func (Sms) GetConfigSelector ¶ added in v1.2.0
func (c Sms) GetConfigSelector() *metav1.LabelSelector
func (Sms) SetUseDefault ¶ added in v1.2.0
func (c Sms) SetUseDefault(b bool)
func (Sms) UseDefault ¶ added in v1.2.0
func (c Sms) UseDefault() bool
type Webhook ¶
type Webhook struct { Template string // `url` gives the location of the webhook, in standard URL form. URL string HttpConfig *v2beta2.HTTPClientConfig WebhookConfig *WebhookConfig Selector *metav1.LabelSelector // contains filtered or unexported fields }
func (Webhook) GetConfigSelector ¶ added in v1.2.0
func (c Webhook) GetConfigSelector() *metav1.LabelSelector
func (Webhook) SetUseDefault ¶
func (c Webhook) SetUseDefault(b bool)
func (Webhook) UseDefault ¶
func (c Webhook) UseDefault() bool
type WebhookConfig ¶
type WebhookConfig struct { }
type Wechat ¶
type Wechat struct { Template string TmplType string ToUser []string ToParty []string ToTag []string WechatConfig *WechatConfig Selector *metav1.LabelSelector // contains filtered or unexported fields }
func (Wechat) GetConfigSelector ¶ added in v1.2.0
func (c Wechat) GetConfigSelector() *metav1.LabelSelector
func (Wechat) SetUseDefault ¶
func (c Wechat) SetUseDefault(b bool)
func (Wechat) UseDefault ¶
func (c Wechat) UseDefault() bool
type WechatConfig ¶
type WechatConfig struct { APISecret *v2beta2.Credential CorpID string APIURL string AgentID string }
Click to show internal directories.
Click to hide internal directories.