-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #200 from Cleanse/master
Helping get golint to 100%.
- Loading branch information
Showing
27 changed files
with
594 additions
and
543 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,22 +2,21 @@ package main | |
|
||
import ( | ||
"fmt" | ||
"github.com/sendgrid/sendgrid-go" | ||
"log" | ||
"os" | ||
|
||
"github.com/sendgrid/sendgrid-go" | ||
) | ||
|
||
// CreateanewAlert Create a new Alert | ||
// CreateanewAlert : Create a new Alert | ||
// POST /alerts | ||
func CreateanewAlert() { | ||
apiKey := os.Getenv("YOUR_SENDGRID_APIKEY") | ||
host := "https://api.sendgrid.com" | ||
request := sendgrid.GetRequest(apiKey, "/v3/alerts", host) | ||
request.Method = "POST" | ||
request.Body = []byte(` { | ||
"email_to": "[email protected]", | ||
"frequency": "daily", | ||
"email_to": "[email protected]", | ||
"frequency": "daily", | ||
"type": "stats_notification" | ||
}`) | ||
response, err := sendgrid.API(request) | ||
|
@@ -30,7 +29,7 @@ func CreateanewAlert() { | |
} | ||
} | ||
|
||
// Retrieveallalerts Retrieve all alerts | ||
// Retrieveallalerts : Retrieve all alerts | ||
// GET /alerts | ||
func Retrieveallalerts() { | ||
apiKey := os.Getenv("YOUR_SENDGRID_APIKEY") | ||
|
@@ -47,7 +46,7 @@ func Retrieveallalerts() { | |
} | ||
} | ||
|
||
// Updateanalert Update an alert | ||
// Updateanalert : Update an alert | ||
// PATCH /alerts/{alert_id} | ||
func Updateanalert() { | ||
apiKey := os.Getenv("YOUR_SENDGRID_APIKEY") | ||
|
@@ -67,7 +66,7 @@ func Updateanalert() { | |
} | ||
} | ||
|
||
// Retrieveaspecificalert Retrieve a specific alert | ||
// Retrieveaspecificalert : Retrieve a specific alert | ||
// GET /alerts/{alert_id} | ||
func Retrieveaspecificalert() { | ||
apiKey := os.Getenv("YOUR_SENDGRID_APIKEY") | ||
|
@@ -84,7 +83,7 @@ func Retrieveaspecificalert() { | |
} | ||
} | ||
|
||
// Deleteanalert Delete an alert | ||
// Deleteanalert : Delete an alert | ||
// DELETE /alerts/{alert_id} | ||
func Deleteanalert() { | ||
apiKey := os.Getenv("YOUR_SENDGRID_APIKEY") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.