Documentation ¶
Index ¶
- Variables
- func EmailSecretKey(receverName, from string) string
- 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 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" )
type Email ¶
type Email struct { ChannelType `json:"channelType"` SMTPServer string `json:"smtpServer"` RequireTLS bool `json:"requireTLS"` From string `json:"from"` To string `json:"to"` AuthPassword string `json:"authPassword"` }
func (*Email) Test ¶
func (e *Email) Test(alert prometheus.WebhookAlert) error
type Feishu ¶
type Feishu struct { ChannelType `json:"channelType"` URL string `json:"url"` // 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 { ChannelType `json:"channelType"` URL string `json:"url"` 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.