Documentation
¶
Index ¶
- Constants
- func AddHeaders(req *http.Request, headers map[string]string)
- func AddNew(notificationTypes NotificationTypes)
- func GetJsonParamsBody(msgParam MessageParam) (io.Reader, error)
- func GetUrlValues(msgParam MessageParam) url.Values
- func SendErrorNotification(errorNotification ErrorNotification)
- func SendResponseTimeNotification(responseTimeNotification ResponseTimeNotification)
- func SendTestNotification()
- type DingdingNotify
- func (dingdingNotify DingdingNotify) GetClientName() string
- func (dingdingNotify DingdingNotify) Initialize() error
- func (dingdingNotify DingdingNotify) SendErrorNotification(errorNotification ErrorNotification) error
- func (dingdingNotify DingdingNotify) SendResponseTimeNotification(responseTimeNotification ResponseTimeNotification) error
- type ErrorNotification
- type HttpNotify
- func (httpNotify HttpNotify) GetClientName() string
- func (httpNotify HttpNotify) Initialize() error
- func (httpNotify HttpNotify) SendErrorNotification(errorNotification ErrorNotification) error
- func (httpNotify HttpNotify) SendResponseTimeNotification(responseTimeNotification ResponseTimeNotification) error
- type MailNotify
- func (mailNotify MailNotify) GetClientName() string
- func (mailNotify MailNotify) Initialize() error
- func (mailNotify MailNotify) SendErrorNotification(errorNotification ErrorNotification) error
- func (mailNotify MailNotify) SendResponseTimeNotification(responseTimeNotification ResponseTimeNotification) error
- type MailgunNotify
- func (mailgunNotify MailgunNotify) GetClientName() string
- func (mailgunNotify MailgunNotify) Initialize() error
- func (mailgunNotify MailgunNotify) SendErrorNotification(errorNotification ErrorNotification) error
- func (mailgunNotify MailgunNotify) SendResponseTimeNotification(responseTimeNotification ResponseTimeNotification) error
- type Message
- type MessageParam
- type NotificationTypes
- type Notify
- type PagerdutyNotify
- func (pagerdutyNotify PagerdutyNotify) GetClientName() string
- func (pagerdutyNotify PagerdutyNotify) Initialize() error
- func (pagerdutyNotify PagerdutyNotify) SendErrorNotification(errorNotification ErrorNotification) error
- func (pagerdutyNotify PagerdutyNotify) SendResponseTimeNotification(responseTimeNotification ResponseTimeNotification) error
- type Payload
- type RequestBody
- type ResponseTimeNotification
- type SlackNotify
- func (slackNotify SlackNotify) GetClientName() string
- func (slackNotify SlackNotify) Initialize() error
- func (slackNotify SlackNotify) SendErrorNotification(errorNotification ErrorNotification) error
- func (slackNotify SlackNotify) SendResponseTimeNotification(responseTimeNotification ResponseTimeNotification) error
- type Txt
Constants ¶
View Source
const ( ContentType = "Content-Type" ContentLength = "Content-Length" FormContentType = "application/x-www-form-urlencoded" JsonContentType = "application/json" )
Variables ¶
This section is empty.
Functions ¶
func AddNew ¶
func AddNew(notificationTypes NotificationTypes)
Add notification clients given by user in config file to notificationsList
func GetJsonParamsBody ¶
func GetJsonParamsBody(msgParam MessageParam) (io.Reader, error)
func GetUrlValues ¶
func GetUrlValues(msgParam MessageParam) url.Values
func SendErrorNotification ¶
func SendErrorNotification(errorNotification ErrorNotification)
Send Error notification to all clients registered
func SendResponseTimeNotification ¶
func SendResponseTimeNotification(responseTimeNotification ResponseTimeNotification)
Send response time notification to all clients registered
func SendTestNotification ¶
func SendTestNotification()
Send Test notification to all registered clients .To make sure everything is working
Types ¶
type DingdingNotify ¶
type DingdingNotify struct {
HttpNotify
}
func (DingdingNotify) GetClientName ¶
func (dingdingNotify DingdingNotify) GetClientName() string
func (DingdingNotify) Initialize ¶
func (dingdingNotify DingdingNotify) Initialize() error
func (DingdingNotify) SendErrorNotification ¶
func (dingdingNotify DingdingNotify) SendErrorNotification(errorNotification ErrorNotification) error
func (DingdingNotify) SendResponseTimeNotification ¶
func (dingdingNotify DingdingNotify) SendResponseTimeNotification(responseTimeNotification ResponseTimeNotification) error
type ErrorNotification ¶
type HttpNotify ¶
type HttpNotify struct {
Url string `json:"url"`
RequestType string `json:"requestType"`
Headers map[string]string `json:"headers"`
}
func (HttpNotify) GetClientName ¶
func (httpNotify HttpNotify) GetClientName() string
func (HttpNotify) Initialize ¶
func (httpNotify HttpNotify) Initialize() error
func (HttpNotify) SendErrorNotification ¶
func (httpNotify HttpNotify) SendErrorNotification(errorNotification ErrorNotification) error
func (HttpNotify) SendResponseTimeNotification ¶
func (httpNotify HttpNotify) SendResponseTimeNotification(responseTimeNotification ResponseTimeNotification) error
type MailNotify ¶
type MailNotify struct {
Username string `json:"username"`
Password string `json:"password"`
Host string `json:"smtpHost"`
Port int `json:"port"`
From string `json:"from"`
To string `json:"to"`
}
func (MailNotify) GetClientName ¶
func (mailNotify MailNotify) GetClientName() string
func (MailNotify) Initialize ¶
func (mailNotify MailNotify) Initialize() error
func (MailNotify) SendErrorNotification ¶
func (mailNotify MailNotify) SendErrorNotification(errorNotification ErrorNotification) error
func (MailNotify) SendResponseTimeNotification ¶
func (mailNotify MailNotify) SendResponseTimeNotification(responseTimeNotification ResponseTimeNotification) error
type MailgunNotify ¶
type MailgunNotify struct {
Email string `json:"email"`
ApiKey string `json:"apiKey"`
Domain string `json:"domain"`
PublicApiKey string `json:"publicApiKey"`
}
func (MailgunNotify) GetClientName ¶
func (mailgunNotify MailgunNotify) GetClientName() string
func (MailgunNotify) Initialize ¶
func (mailgunNotify MailgunNotify) Initialize() error
func (MailgunNotify) SendErrorNotification ¶
func (mailgunNotify MailgunNotify) SendErrorNotification(errorNotification ErrorNotification) error
func (MailgunNotify) SendResponseTimeNotification ¶
func (mailgunNotify MailgunNotify) SendResponseTimeNotification(responseTimeNotification ResponseTimeNotification) error
type MessageParam ¶
type MessageParam struct {
Message string `json:"message"`
}
type NotificationTypes ¶
type NotificationTypes struct {
MailNotify MailNotify `json:"mail"`
Mailgun MailgunNotify `json:"mailGun"`
Slack SlackNotify `json:"slack"`
Http HttpNotify `json:"httpEndPoint"`
Dingding DingdingNotify `json:"dingding"`
Pagerduty PagerdutyNotify `json:"pagerduty"`
}
Diffrent types of clients to deliver notifications
type Notify ¶
type Notify interface {
GetClientName() string
Initialize() error
SendResponseTimeNotification(notification ResponseTimeNotification) error
SendErrorNotification(notification ErrorNotification) error
}
type PagerdutyNotify ¶
type PagerdutyNotify struct {
Url string `json:"url"`
RoutingKey string `json:"routingKey"`
Severity string `json:"severity"`
}
func (PagerdutyNotify) GetClientName ¶
func (pagerdutyNotify PagerdutyNotify) GetClientName() string
func (PagerdutyNotify) Initialize ¶
func (pagerdutyNotify PagerdutyNotify) Initialize() error
func (PagerdutyNotify) SendErrorNotification ¶
func (pagerdutyNotify PagerdutyNotify) SendErrorNotification(errorNotification ErrorNotification) error
func (PagerdutyNotify) SendResponseTimeNotification ¶
func (pagerdutyNotify PagerdutyNotify) SendResponseTimeNotification(responseTimeNotification ResponseTimeNotification) error
type RequestBody ¶
type RequestBody struct {
Payload Payload `json:"payload"`
RoutingKey string `json:"routing_key"`
DedupKey string `json:"dedup_key"`
EventAction string `json:"event_action"`
}
func CreatePagerdutyRequest ¶
func CreatePagerdutyRequest(url, summary string, config PagerdutyNotify) RequestBody
type SlackNotify ¶
type SlackNotify struct {
Username string `json:"username"`
ChannelName string `json:"channelName"` //Not mandatory field
ChannelWebhookURL string `json:"channelWebhookURL"`
IconUrl string `json:"iconUrl"`
}
func (SlackNotify) GetClientName ¶
func (slackNotify SlackNotify) GetClientName() string
func (SlackNotify) Initialize ¶
func (slackNotify SlackNotify) Initialize() error
func (SlackNotify) SendErrorNotification ¶
func (slackNotify SlackNotify) SendErrorNotification(errorNotification ErrorNotification) error
func (SlackNotify) SendResponseTimeNotification ¶
func (slackNotify SlackNotify) SendResponseTimeNotification(responseTimeNotification ResponseTimeNotification) error
Click to show internal directories.
Click to hide internal directories.