Skip to content

Commit

Permalink
Bumped major version to v4
Browse files Browse the repository at this point in the history
  • Loading branch information
thrawn01 committed Jan 27, 2020
1 parent daaedcf commit 7e505be
Show file tree
Hide file tree
Showing 27 changed files with 50 additions and 59 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [4.0.0] - 2020-01-27
### Changes
* Changed `UserVariables` type from `map[string]interface{}` to `interface{}`
to handle truncated user-variable messages in events.
### Added
* Add support for setting AMP content in messages

## [3.6.3] - 2019-12-03
### Changes
* Calls to get stats now use epoch as the time format
Expand Down
30 changes: 13 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@

Go library for interacting with the [Mailgun](https://mailgun.com/) [API](https://documentation.mailgun.com/api_reference.html).

**NOTE: Backward compatibility has been broken with the v3.0 release which includes versioned paths required by 1.11
go modules (See [Releasing Modules](https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher)).
Pin your dependencies to the v1.1.1 or v2.0 tag if you are not ready for v3.0**

## Usage
```go
package main
Expand All @@ -19,7 +15,7 @@ import (
"log"
"time"

"github.com/mailgun/mailgun-go/v3"
"github.com/mailgun/mailgun-go/v4"
)

// Your available domain names can be found here:
Expand Down Expand Up @@ -66,8 +62,8 @@ import (
"fmt"
"time"

"github.com/mailgun/mailgun-go/v3"
"github.com/mailgun/mailgun-go/v3/events"
"github.com/mailgun/mailgun-go/v4"
"github.com/mailgun/mailgun-go/v4/events"
)

func main() {
Expand Down Expand Up @@ -122,7 +118,7 @@ import (
"context"
"time"

"github.com/mailgun/mailgun-go/v3"
"github.com/mailgun/mailgun-go/v4"
)

func main() {
Expand Down Expand Up @@ -163,7 +159,7 @@ import (
"log"
"time"

"github.com/mailgun/mailgun-go/v3"
"github.com/mailgun/mailgun-go/v4"
)

// If your plan does not include email validations but you have an account,
Expand Down Expand Up @@ -200,8 +196,8 @@ import (
"os"
"time"

"github.com/mailgun/mailgun-go/v3"
"github.com/mailgun/mailgun-go/v3/events"
"github.com/mailgun/mailgun-go/v4"
"github.com/mailgun/mailgun-go/v4/events"
)

func main() {
Expand Down Expand Up @@ -270,7 +266,7 @@ import (
"log"
"time"

"github.com/mailgun/mailgun-go/v3"
"github.com/mailgun/mailgun-go/v4"
)

// Your available domain names can be found here:
Expand Down Expand Up @@ -324,13 +320,13 @@ mg.SetAPIBase(mailgun.APIBaseEU)
## Installation

If you are using [golang modules](https://github.com/golang/go/wiki/Modules) make sure you
include the `/v3` at the end of your import paths
include the `/v4` at the end of your import paths
```bash
$ go get github.com/mailgun/mailgun-go/v3
$ go get github.com/mailgun/mailgun-go/v4
```

If you are **not** using golang modules, you can drop the `/v3` at the end of the import path.
As long as you are using the latest 1.10 or 1.11 golang release, import paths that end in `/v3`
If you are **not** using golang modules, you can drop the `/v4` at the end of the import path.
As long as you are using the latest 1.10 or 1.11 golang release, import paths that end in `/v4`
in your code should work fine even if you do not have golang modules enabled for your project.
```bash
$ go get github.com/mailgun/mailgun-go
Expand All @@ -340,7 +336,7 @@ $ go get github.com/mailgun/mailgun-go

Using version 3 of the mailgun-go library with go dep currently results in the following error
```
"github.com/mailgun/mailgun-go/v3/events", which contains malformed code: no package exists at ...
"github.com/mailgun/mailgun-go/v4/events", which contains malformed code: no package exists at ...
```
This is a known bug in go dep. You can follow the PR to fix this bug [here](https://github.com/golang/dep/pull/1963)
Until this bug is fixed, the best way to use version 3 of the mailgun-go library is to use the golang community
Expand Down
2 changes: 1 addition & 1 deletion domains_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"

"github.com/facebookgo/ensure"
"github.com/mailgun/mailgun-go/v3"
"github.com/mailgun/mailgun-go/v4"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion email_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"

"github.com/facebookgo/ensure"
"github.com/mailgun/mailgun-go/v3"
"github.com/mailgun/mailgun-go/v4"
)

func TestEmailValidation(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion events.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"time"

"github.com/mailgun/mailgun-go/v3/events"
"github.com/mailgun/mailgun-go/v4/events"
"github.com/mailru/easyjson"
)

Expand Down
4 changes: 2 additions & 2 deletions events_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"time"

"github.com/facebookgo/ensure"
"github.com/mailgun/mailgun-go/v3"
"github.com/mailgun/mailgun-go/v3/events"
"github.com/mailgun/mailgun-go/v4"
"github.com/mailgun/mailgun-go/v4/events"
)

func TestEventIteratorGetNext(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions examples/examples.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package examples
import (
"context"
"fmt"
"github.com/mailgun/mailgun-go/v3"
"github.com/mailgun/mailgun-go/v3/events"
"github.com/mailgun/mailgun-go/v4"
"github.com/mailgun/mailgun-go/v4/events"
"os"
"time"
)
Expand Down
4 changes: 2 additions & 2 deletions examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"strings"
"time"

"github.com/mailgun/mailgun-go/v3"
"github.com/mailgun/mailgun-go/v3/events"
"github.com/mailgun/mailgun-go/v4"
"github.com/mailgun/mailgun-go/v4/events"
)

func ExampleMailgunImpl_ValidateEmail() {
Expand Down
2 changes: 1 addition & 1 deletion exports_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

"github.com/facebookgo/ensure"
"github.com/mailgun/mailgun-go/v3"
"github.com/mailgun/mailgun-go/v4"
)

func TestExports(t *testing.T) {
Expand Down
10 changes: 3 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module github.com/mailgun/mailgun-go/v3
module github.com/mailgun/mailgun-go/v4

go 1.13

require (
github.com/davecgh/go-spew v1.1.1 // indirect
Expand All @@ -8,10 +10,4 @@ require (
github.com/go-chi/chi v4.0.0+incompatible
github.com/mailru/easyjson v0.7.0
github.com/pkg/errors v0.8.1
github.com/pquerna/ffjson v0.0.0-20190930134022-aa0246cd15f7 // indirect
github.com/ugorji/go v1.1.7 // indirect
)

replace github.com/mailgun/mailgun-go/v3/events => ./events

go 1.13
8 changes: 0 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,7 @@ github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870 h1:E2s37DuLxFhQD
github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0=
github.com/go-chi/chi v4.0.0+incompatible h1:SiLLEDyAkqNnw+T/uDTf3aFB9T4FTrwMpuYrgaRcnW4=
github.com/go-chi/chi v4.0.0+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ=
github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329 h1:2gxZ0XQIU/5z3Z3bUBu+FXuk2pFbkN6tcwi/pjyaDic=
github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.7.0 h1:aizVhC/NAAcKWb+5QsU1iNOZb4Yws5UO2I+aIprQITM=
github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pquerna/ffjson v0.0.0-20190930134022-aa0246cd15f7 h1:xoIK0ctDddBMnc74udxJYBqlo9Ylnsp1waqjLsnef20=
github.com/pquerna/ffjson v0.0.0-20190930134022-aa0246cd15f7/go.mod h1:YARuvh7BUWHNhzDq2OM5tzR2RiCcN2D7sapiKyCel/M=
github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo=
github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw=
github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs=
github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY=
2 changes: 1 addition & 1 deletion ips_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"

"github.com/facebookgo/ensure"
"github.com/mailgun/mailgun-go/v3"
"github.com/mailgun/mailgun-go/v4"
)

var server mailgun.MockServer
Expand Down
2 changes: 1 addition & 1 deletion limits_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

"github.com/facebookgo/ensure"
"github.com/mailgun/mailgun-go/v3"
"github.com/mailgun/mailgun-go/v4"
)

func TestLimits(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion mailgun_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"

"github.com/facebookgo/ensure"
"github.com/mailgun/mailgun-go/v3"
"github.com/mailgun/mailgun-go/v4"
)

const domain = "valid-mailgun-domain"
Expand Down
2 changes: 1 addition & 1 deletion mailing_lists_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

"github.com/facebookgo/ensure"
"github.com/mailgun/mailgun-go/v3"
"github.com/mailgun/mailgun-go/v4"
)

func TestMailingListMembers(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion mock_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"time"

"github.com/go-chi/chi"
"github.com/mailgun/mailgun-go/v3/events"
"github.com/mailgun/mailgun-go/v4/events"
)

func (ms *MockServer) addEventRoutes(r chi.Router) {
Expand Down
2 changes: 1 addition & 1 deletion mock_messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"time"

"github.com/go-chi/chi"
"github.com/mailgun/mailgun-go/v3/events"
"github.com/mailgun/mailgun-go/v4/events"
)

func (ms *MockServer) addMessagesRoutes(r chi.Router) {
Expand Down
2 changes: 1 addition & 1 deletion parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"reflect"
"time"

"github.com/mailgun/mailgun-go/v3/events"
"github.com/mailgun/mailgun-go/v4/events"
"github.com/mailru/easyjson"
)

Expand Down
2 changes: 1 addition & 1 deletion parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"time"

"github.com/facebookgo/ensure"
"github.com/mailgun/mailgun-go/v3/events"
"github.com/mailgun/mailgun-go/v4/events"
)

func TestParseErrors(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion routes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

"github.com/facebookgo/ensure"
"github.com/mailgun/mailgun-go/v3"
"github.com/mailgun/mailgun-go/v4"
)

func TestRouteCRUD(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"fmt"
"github.com/facebookgo/ensure"
"github.com/mailgun/mailgun-go/v3"
"github.com/mailgun/mailgun-go/v3/events"
"github.com/mailgun/mailgun-go/v4"
"github.com/mailgun/mailgun-go/v4/events"
"strings"
"testing"
)
Expand Down
2 changes: 1 addition & 1 deletion tags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"time"

"github.com/facebookgo/ensure"
"github.com/mailgun/mailgun-go/v3"
"github.com/mailgun/mailgun-go/v4"
"github.com/pkg/errors"
)

Expand Down
2 changes: 1 addition & 1 deletion template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"time"

"github.com/facebookgo/ensure"
"github.com/mailgun/mailgun-go/v3"
"github.com/mailgun/mailgun-go/v4"
"github.com/pkg/errors"
)

Expand Down
2 changes: 1 addition & 1 deletion template_versions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

"github.com/facebookgo/ensure"
"github.com/mailgun/mailgun-go/v3"
"github.com/mailgun/mailgun-go/v4"
)

func TestTemplateVersionsCRUD(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package mailgun

// Version of current release
const Version = "3.6.1"
const Version = "4.0.0"
2 changes: 1 addition & 1 deletion webhooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"io"
"net/http"

"github.com/mailgun/mailgun-go/v3/events"
"github.com/mailgun/mailgun-go/v4/events"
)

type UrlOrUrls struct {
Expand Down
2 changes: 1 addition & 1 deletion webhooks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"testing"

"github.com/facebookgo/ensure"
"github.com/mailgun/mailgun-go/v3"
"github.com/mailgun/mailgun-go/v4"
)

func TestGetWebhook(t *testing.T) {
Expand Down

0 comments on commit 7e505be

Please sign in to comment.