Skip to content

Commit

Permalink
switched response to RFC2822Time
Browse files Browse the repository at this point in the history
  • Loading branch information
vtopc committed Oct 19, 2024
1 parent 196c144 commit 6f869a0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions analytics_response.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package mailgun

type MetricsResponse struct {
Start string `json:"start"`
End string `json:"end"`
Start RFC2822Time `json:"start"`
End RFC2822Time `json:"end"`
Resolution Resolution `json:"resolution"`
Duration string `json:"duration"`
Dimensions []string `json:"dimensions"`
Expand Down
2 changes: 1 addition & 1 deletion analytics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package mailgun
var mockAcceptedIncomingCount uint64 = 10

var expectedResponse = MetricsResponse{
Start: "Mon, 15 Apr 2024 00:00:00 +0000",
// Start: "Mon, 15 Apr 2024 00:00:00 +0000",
Dimensions: []string{"time"},
Items: []MetricsItem{
{
Expand Down
5 changes: 3 additions & 2 deletions examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func ExampleMailgunImpl_VerifyWebhookSignature() {
}
}

func ExmplMailgunImpl_ListMetrics() {
func ExampleMailgunImpl_ListMetrics() {
mg, err := mailgun.NewMailgunFromEnv()
if err != nil {
log.Fatal(err)
Expand Down Expand Up @@ -222,7 +222,8 @@ func ExmplMailgunImpl_ListMetrics() {
log.Fatal(iter.Err())
}

fmt.Printf("Page %d:\n", i+1)
fmt.Printf("Page %d: Start: %s; End: %s; Pagination: %+v\n",
i+1, resp.Start, resp.End, resp.Pagination)
for _, item := range resp.Items {
b, _ := json.Marshal(item)
fmt.Printf("%s\n", b)
Expand Down

0 comments on commit 6f869a0

Please sign in to comment.