Documentation
¶
Index ¶
- Variables
- func EmailSecretKey(receverName, from string) string
- type AliyunMsg
- type AliyunVoice
- type BaseChannel
- type ChannelConfig
- func (ChannelConfig) GormDBDataType(db *gorm.DB, field *schema.Field) string
- func (m ChannelConfig) GormDataType() string
- func (m ChannelConfig) MarshalJSON() ([]byte, error)
- func (m *ChannelConfig) Scan(val interface{}) error
- func (m *ChannelConfig) UnmarshalJSON(b []byte) error
- func (m ChannelConfig) Value() (driver.Value, error)
- type ChannelGetter
- type ChannelIf
- type ChannelMapper
- type ChannelType
- type Email
- type Feishu
- type Webhook
Constants ¶
This section is empty.
Variables ¶
View Source
var ( EmailSecretName = "gemscloud-email-password" EmailSecretLabel map[string]string = map[string]string{ "gemcloud": "email-secret", } )
View Source
var (
KubegemsWebhookURL = fmt.Sprintf("https://kubegems-local-agent.%s:8041/alert", gems.NamespaceLocal)
)
Functions ¶
func EmailSecretKey ¶
Types ¶
type AliyunMsg ¶ added in v1.23.0
type AliyunMsg struct { BaseChannel `json:",inline"` AccessKeyId string `json:"accessKeyId" binding:"required"` AccessKeySecret string `json:"accessKeySecret" binding:"required"` PhoneNumbers string `json:"phoneNumbers" binding:"required"` // 电话号码,多个中间以","隔开 SignName string `json:"signName" binding:"required"` // 签名 TemplateCode string `json:"templateCode" binding:"required"` // 模板 }
AliyunMsg 阿里云短信
func (*AliyunMsg) Test ¶ added in v1.23.0
func (m *AliyunMsg) Test(alert prometheus.WebhookAlert) error
type AliyunVoice ¶ added in v1.23.0
type AliyunVoice struct { BaseChannel `json:",inline"` AccessKeyId string `json:"accessKeyId" binding:"required"` AccessKeySecret string `json:"accessKeySecret" binding:"required"` CallNumber string `json:"callNumber" binding:"required"` // 电话号码,只支持单个 TtsCode string `json:"ttsCode" binding:"required"` // 模板 }
AliyunVoice 阿里云语音
func (*AliyunVoice) Check ¶ added in v1.23.0
func (v *AliyunVoice) Check() error
func (*AliyunVoice) String ¶ added in v1.23.0
func (v *AliyunVoice) String() string
func (*AliyunVoice) Test ¶ added in v1.23.0
func (v *AliyunVoice) Test(alert prometheus.WebhookAlert) error
func (*AliyunVoice) ToReceiver ¶ added in v1.23.0
func (v *AliyunVoice) ToReceiver(name string) v1alpha1.Receiver
type BaseChannel ¶ added in v1.22.2
type BaseChannel struct { ChannelType ChannelType `json:"channelType"` SendResolved bool `json:"sendResolved"` }
type ChannelConfig ¶
type ChannelConfig struct {
ChannelIf
}
func (ChannelConfig) GormDBDataType ¶
GormDBDataType gorm db data type
func (ChannelConfig) GormDataType ¶
func (m ChannelConfig) GormDataType() string
GormDataType gorm common data type
func (ChannelConfig) MarshalJSON ¶
func (m ChannelConfig) MarshalJSON() ([]byte, error)
MarshalJSON to output non base64 encoded []byte
func (*ChannelConfig) Scan ¶
func (m *ChannelConfig) Scan(val interface{}) error
Scan scan value into Jsonb, implements sql.Scanner interface
func (*ChannelConfig) UnmarshalJSON ¶
func (m *ChannelConfig) UnmarshalJSON(b []byte) error
UnmarshalJSON to deserialize []byte
type ChannelGetter ¶
type ChannelIf ¶
type ChannelIf interface { ToReceiver(name string) v1alpha1.Receiver Check() error Test(alert prometheus.WebhookAlert) error String() string }
type ChannelMapper ¶
func (*ChannelMapper) FindChannel ¶
func (m *ChannelMapper) FindChannel(id uint) (ChannelIf, error)
type ChannelType ¶
type ChannelType string
const ( TypeWebhook ChannelType = "webhook" TypeEmail ChannelType = "email" TypeFeishu ChannelType = "feishu" TypeAliyunMsg ChannelType = "aliyunMsg" TypeAliyunVoice ChannelType = "aliyunVoice" )
type Email ¶
type Email struct { BaseChannel `json:",inline"` SMTPServer string `json:"smtpServer" binding:"required"` RequireTLS bool `json:"requireTLS"` From string `json:"from" binding:"required"` To string `json:"to" binding:"required"` AuthPassword string `json:"authPassword" binding:"required"` }
func (*Email) Test ¶
func (e *Email) Test(alert prometheus.WebhookAlert) error
type Feishu ¶
type Feishu struct { BaseChannel `json:",inline"` URL string `json:"url" binding:"required"` // feishu robot webhook url At string `json:"at"` // 要@的用户id,所有人则是 all SignSecret string `json:"signSecret"` // 签名校验key }
func (*Feishu) Test ¶
func (f *Feishu) Test(alert prometheus.WebhookAlert) error
type Webhook ¶
type Webhook struct { BaseChannel `json:",inline"` URL string `json:"url" binding:"required"` InsecureSkipVerify bool `json:"insecureSkipVerify"` }
func (*Webhook) Test ¶
func (w *Webhook) Test(alert prometheus.WebhookAlert) error
Click to show internal directories.
Click to hide internal directories.