mirror of https://github.com/statping/statping
email template - docs
parent
721b4ca96b
commit
81923a3b7c
|
@ -0,0 +1,4 @@
|
|||
// Package Notifier contains the main functionality for the Statup Notification system
|
||||
//
|
||||
// by Hunter Long
|
||||
package notifier
|
File diff suppressed because one or more lines are too long
|
@ -69,13 +69,11 @@ func TestEmailNotifier(t *testing.T) {
|
|||
emailer.Port = int(EMAIL_PORT)
|
||||
emailer.Delay = time.Duration(100 * time.Millisecond)
|
||||
|
||||
message := "this is a test email!"
|
||||
|
||||
testEmail = &EmailOutgoing{
|
||||
To: emailer.GetValue("var2"),
|
||||
Subject: fmt.Sprintf("Service %v is Failing", TestService.Name),
|
||||
Template: MESSAGE,
|
||||
Data: interface{}(message),
|
||||
Template: TEMPLATE,
|
||||
Data: TestService,
|
||||
From: emailer.GetValue("var1"),
|
||||
}
|
||||
})
|
||||
|
|
|
@ -22,6 +22,7 @@ import (
|
|||
"github.com/hunterlong/statup/utils"
|
||||
"github.com/jinzhu/gorm"
|
||||
_ "github.com/jinzhu/gorm/dialects/sqlite"
|
||||
"time"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -31,6 +32,7 @@ var (
|
|||
)
|
||||
|
||||
var TestService = &types.Service{
|
||||
Id: 1,
|
||||
Name: "Interpol - All The Rage Back Home",
|
||||
Domain: "https://www.youtube.com/watch?v=-u6DvRyyKGU",
|
||||
ExpectedStatus: 200,
|
||||
|
@ -38,10 +40,16 @@ var TestService = &types.Service{
|
|||
Type: "http",
|
||||
Method: "GET",
|
||||
Timeout: 20,
|
||||
LastStatusCode: 404,
|
||||
Expected: "test example",
|
||||
LastResponse: "<html>this is an example response</html>",
|
||||
CreatedAt: time.Now().Add(-24 * time.Hour),
|
||||
}
|
||||
|
||||
var TestFailure = &types.Failure{
|
||||
Issue: "testing",
|
||||
Service: 1,
|
||||
CreatedAt: time.Now().Add(-12 * time.Hour),
|
||||
}
|
||||
|
||||
var TestUser = &types.User{
|
||||
|
|
|
@ -26,11 +26,6 @@ import (
|
|||
var (
|
||||
SLACK_URL string
|
||||
slackMessage = `{"text":"this is a test from the Slack notifier!"}`
|
||||
slackTestMessage = SlackMessage{
|
||||
Service: TestService,
|
||||
Template: FAILURE,
|
||||
Time: time.Now().Unix(),
|
||||
}
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
// Package type contains all of the structs for objects in Statup including
|
||||
// services, hits, failures, Core, and others.
|
||||
// Package types contains all of the structs for objects in Statup including services, hits, failures, Core, and others.
|
||||
//
|
||||
// by Hunter Long
|
||||
package types
|
||||
|
|
Loading…
Reference in New Issue