-
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 #148 from prateekpandey14/fix-lint-fmt
Fixing golint and gofmt errors
- Loading branch information
Showing
28 changed files
with
543 additions
and
951 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,23 +2,22 @@ package main | |
|
||
import ( | ||
"fmt" | ||
"github.com/sendgrid/sendgrid-go" | ||
"log" | ||
"os" | ||
|
||
"github.com/sendgrid/sendgrid-go" | ||
) | ||
|
||
/////////////////////////////////////////////////// | ||
// 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) | ||
|
@@ -31,10 +30,8 @@ func CreateanewAlert() { | |
} | ||
} | ||
|
||
/////////////////////////////////////////////////// | ||
// Retrieve all alerts | ||
// Retrieveallalerts Retrieve all alerts | ||
// GET /alerts | ||
|
||
func Retrieveallalerts() { | ||
apiKey := os.Getenv("YOUR_SENDGRID_APIKEY") | ||
host := "https://api.sendgrid.com" | ||
|
@@ -50,10 +47,8 @@ func Retrieveallalerts() { | |
} | ||
} | ||
|
||
/////////////////////////////////////////////////// | ||
// Update an alert | ||
// Updateanalert Update an alert | ||
// PATCH /alerts/{alert_id} | ||
|
||
func Updateanalert() { | ||
apiKey := os.Getenv("YOUR_SENDGRID_APIKEY") | ||
host := "https://api.sendgrid.com" | ||
|
@@ -72,10 +67,8 @@ func Updateanalert() { | |
} | ||
} | ||
|
||
/////////////////////////////////////////////////// | ||
// Retrieve a specific alert | ||
// Retrieveaspecificalert Retrieve a specific alert | ||
// GET /alerts/{alert_id} | ||
|
||
func Retrieveaspecificalert() { | ||
apiKey := os.Getenv("YOUR_SENDGRID_APIKEY") | ||
host := "https://api.sendgrid.com" | ||
|
@@ -91,10 +84,8 @@ func Retrieveaspecificalert() { | |
} | ||
} | ||
|
||
/////////////////////////////////////////////////// | ||
// Delete an alert | ||
// Deleteanalert Delete an alert | ||
// DELETE /alerts/{alert_id} | ||
|
||
func Deleteanalert() { | ||
apiKey := os.Getenv("YOUR_SENDGRID_APIKEY") | ||
host := "https://api.sendgrid.com" | ||
|
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.