From f822aed996921b79166c6201d0ed3dcbdfee3e7e Mon Sep 17 00:00:00 2001 From: "danny.aguswahyudi" Date: Tue, 11 May 2021 12:13:54 +0700 Subject: [PATCH 1/5] moving dependency from gojektech to gojek --- README.md | 10 +++--- examples/client.go | 6 ++-- go.mod | 24 +++++-------- go.sum | 65 ++++++++++++---------------------- httpclient/client.go | 4 +-- httpclient/client_test.go | 2 +- httpclient/options.go | 2 +- httpclient/options_test.go | 2 +- hystrix/hystrix_client.go | 4 +-- hystrix/hystrix_client_test.go | 2 +- hystrix/options.go | 4 +-- plugins/request_logger.go | 2 +- 12 files changed, 50 insertions(+), 77 deletions(-) diff --git a/README.md b/README.md index e5524bc..bef5763 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ All HTTP methods are exposed as a fluent interface. ## Installation ``` -go get -u github.com/gojektech/heimdall/v6 +go get -u github.com/gojek/heimdall/v6 ``` ## Usage @@ -43,8 +43,8 @@ go get -u github.com/gojektech/heimdall/v6 This package can be used by adding the following import statement to your `.go` files. ```go -import "github.com/gojektech/heimdall/v6/httpclient" // with go modules enabled (GO111MODULE=on or outside GOPATH) -import "github.com/gojektech/heimdall/httpclient" // with go modules disabled +import "github.com/gojek/heimdall/v6/httpclient" // with go modules enabled (GO111MODULE=on or outside GOPATH) +import "github.com/gojek/heimdall/httpclient" // with go modules disabled ``` ### Making a simple `GET` request @@ -89,7 +89,7 @@ fmt.Println(string(body)) To import hystrix package of heimdall. ```go -import "github.com/gojektech/heimdall/v6/hystrix" // with go modules enabled (GO111MODULE=on or outside GOPATH) +import "github.com/gojek/heimdall/v6/hystrix" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/gojektech/heimdall/hystrix" // with go modules disabled ``` @@ -314,7 +314,7 @@ To add a plugin to an existing client, use the `AddPlugin` method of the client. An example, with the [request logger plugin](/plugins/request_logger.go): ```go -// import "github.com/gojektech/heimdall/v6/plugins" +// import "github.com/gojek/heimdall/v6/plugins" client := heimdall.NewHTTPClient(timeout) requestLogger := plugins.NewRequestLogger(nil, nil) diff --git a/examples/client.go b/examples/client.go index 9706019..c87663e 100644 --- a/examples/client.go +++ b/examples/client.go @@ -6,9 +6,9 @@ import ( "net/http" "time" - "github.com/gojektech/heimdall/v6" - "github.com/gojektech/heimdall/v6/httpclient" - "github.com/gojektech/heimdall/v6/hystrix" + "github.com/gojek/heimdall/v6" + "github.com/gojek/heimdall/v6/httpclient" + "github.com/gojek/heimdall/v6/hystrix" "github.com/pkg/errors" ) diff --git a/go.mod b/go.mod index 5b9fcc3..71f7dd3 100644 --- a/go.mod +++ b/go.mod @@ -1,23 +1,15 @@ -module github.com/gojektech/heimdall/v6 +module github.com/gojek/heimdall/v6 go 1.14 require ( github.com/DataDog/datadog-go v3.7.1+incompatible // indirect github.com/afex/hystrix-go v0.0.0-20180209013831-27fae8d30f1a - github.com/cactus/go-statsd-client/statsd v0.0.0-20200423205355-cb0885a1018c // indirect - github.com/davecgh/go-spew v1.1.0 // indirect - github.com/gojektech/valkyrie v0.0.0-20180215180059-6aee720afcdf - github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e // indirect - github.com/jtolds/gls v4.2.1+incompatible // indirect - github.com/mattn/goveralls v0.0.6 // indirect - github.com/pkg/errors v0.8.0 - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 // indirect - github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d // indirect - github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c // indirect - github.com/stretchr/objx v0.1.1 // indirect - github.com/stretchr/testify v1.2.1 - golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect - golang.org/x/tools v0.0.0-20200530233709-52effbd89c51 // indirect + github.com/cactus/go-statsd-client v3.0.1+incompatible // indirect + github.com/gojek/valkyrie v0.0.0-20180215180059-6aee720afcdf + github.com/pkg/errors v0.9.1 + github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect + github.com/smartystreets/goconvey v1.6.4 // indirect + github.com/stretchr/objx v0.3.0 // indirect + github.com/stretchr/testify v1.3.0 ) diff --git a/go.sum b/go.sum index a645c3e..758438a 100644 --- a/go.sum +++ b/go.sum @@ -2,54 +2,35 @@ github.com/DataDog/datadog-go v3.7.1+incompatible h1:HmA9qHVrHIAqpSvoCYJ+c6qst0l github.com/DataDog/datadog-go v3.7.1+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/afex/hystrix-go v0.0.0-20180209013831-27fae8d30f1a h1:kUr+IdWoKBJQ+e0LC/ysc1w5clvmxbvNNE+lK2yGPrQ= github.com/afex/hystrix-go v0.0.0-20180209013831-27fae8d30f1a/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= -github.com/cactus/go-statsd-client v3.2.0+incompatible h1:ZJpQV7zHnerDzsEQS1wnI38tpR7wX3QFmL7WzTerEmY= -github.com/cactus/go-statsd-client/statsd v0.0.0-20200423205355-cb0885a1018c h1:HIGF0r/56+7fuIZw2V4isE22MK6xpxWx7BbV8dJ290w= -github.com/cactus/go-statsd-client/statsd v0.0.0-20200423205355-cb0885a1018c/go.mod h1:l/bIBLeOl9eX+wxJAzxS4TveKRtAqlyDpHjhkfO0MEI= +github.com/cactus/go-statsd-client v3.0.1+incompatible h1:Fk6etBCheGhbrRmfHuaetxZ6H9/Mp2xl4D+Dcxo19zo= +github.com/cactus/go-statsd-client v3.0.1+incompatible/go.mod h1:cMRcwZDklk7hXp+Law83urTHUiHMzCev/r4JMYr/zU0= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/gojektech/valkyrie v0.0.0-20180215180059-6aee720afcdf h1:WUa/Tvd+vZuW17gOND3CryHvG0yc2nhC1gr+H2F7bFM= -github.com/gojektech/valkyrie v0.0.0-20180215180059-6aee720afcdf/go.mod h1:tDYRk1s5Pms6XJjj5m2PxAzmQvaDU8GqDf1u6x7yxKw= -github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e h1:JKmoR8x90Iww1ks85zJ1lfDGgIiMDuIptTOhJq+zKyg= -github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/jtolds/gls v4.2.1+incompatible h1:fSuqC+Gmlu6l/ZYAoZzx2pyucC8Xza35fpRVWLVmUEE= -github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/mattn/goveralls v0.0.6 h1:cr8Y0VMo/MnEZBjxNN/vh6G90SZ7IMb6lms1dzMoO+Y= -github.com/mattn/goveralls v0.0.6/go.mod h1:h8b4ow6FxSPMQHF6o2ve3qsclnffZjYTNEKmLesRwqw= -github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/gojek/valkyrie v0.0.0-20180215180059-6aee720afcdf h1:5xRGbUdOmZKoDXkGx5evVLehuCMpuO1hl701bEQqXOM= +github.com/gojek/valkyrie v0.0.0-20180215180059-6aee720afcdf/go.mod h1:QzhUKaYKJmcbTnCYCAVQrroCOY7vOOI8cSQ4NbuhYf0= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 h1:MkV+77GLUNo5oJ0jf870itWm3D0Sjh7+Za9gazKc5LQ= -github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= +github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c h1:Ho+uVpkel/udgjbwB5Lktg9BtvJSh2DT0Hi6LPSyI2w= -github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s= -github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.1 h1:52QO5WkIUcHGIR7EnGagH88x1bUzqGXTC5/1bDTUQ7U= -github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.3.0 h1:NGXK3lHquSN08v5vWalVI/L8XU9hdzE/G6xsrze47As= +github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7 h1:EBZoQjiKKPaLbPrbpssUfuHtwM6KV/vb4U85g/cigFY= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200522201501-cb1345f3a375/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200530233709-52effbd89c51 h1:Wec8/IO8hAraBf0it7/dPQYOslIrgM938wZYNkLnOYc= -golang.org/x/tools v0.0.0-20200530233709-52effbd89c51/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= diff --git a/httpclient/client.go b/httpclient/client.go index 5f03c5b..b34a1cb 100644 --- a/httpclient/client.go +++ b/httpclient/client.go @@ -7,8 +7,8 @@ import ( "net/http" "time" - "github.com/gojektech/heimdall/v6" - "github.com/gojektech/valkyrie" + "github.com/gojek/heimdall/v6" + "github.com/gojek/valkyrie" "github.com/pkg/errors" ) diff --git a/httpclient/client_test.go b/httpclient/client_test.go index dbca35d..c71029d 100644 --- a/httpclient/client_test.go +++ b/httpclient/client_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/gojektech/heimdall/v6" + "github.com/gojek/heimdall/v6" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" diff --git a/httpclient/options.go b/httpclient/options.go index ee2f080..aadc28b 100644 --- a/httpclient/options.go +++ b/httpclient/options.go @@ -3,7 +3,7 @@ package httpclient import ( "time" - "github.com/gojektech/heimdall/v6" + "github.com/gojek/heimdall/v6" ) // Option represents the client options diff --git a/httpclient/options_test.go b/httpclient/options_test.go index b92ce71..4e9bb69 100644 --- a/httpclient/options_test.go +++ b/httpclient/options_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/gojektech/heimdall/v6" + "github.com/gojek/heimdall/v6" "github.com/stretchr/testify/assert" ) diff --git a/hystrix/hystrix_client.go b/hystrix/hystrix_client.go index 01c0ca3..a4f8260 100644 --- a/hystrix/hystrix_client.go +++ b/hystrix/hystrix_client.go @@ -10,8 +10,8 @@ import ( "github.com/afex/hystrix-go/hystrix" metricCollector "github.com/afex/hystrix-go/hystrix/metric_collector" "github.com/afex/hystrix-go/plugins" - "github.com/gojektech/heimdall/v6" - "github.com/gojektech/heimdall/v6/httpclient" + "github.com/gojek/heimdall/v6" + "github.com/gojek/heimdall/v6/httpclient" "github.com/pkg/errors" ) diff --git a/hystrix/hystrix_client_test.go b/hystrix/hystrix_client_test.go index 65a7bbd..e98989f 100644 --- a/hystrix/hystrix_client_test.go +++ b/hystrix/hystrix_client_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/gojektech/heimdall/v6" + "github.com/gojek/heimdall/v6" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/hystrix/options.go b/hystrix/options.go index a8dc452..def1c78 100644 --- a/hystrix/options.go +++ b/hystrix/options.go @@ -4,8 +4,8 @@ import ( "time" "github.com/afex/hystrix-go/plugins" - "github.com/gojektech/heimdall/v6" - "github.com/gojektech/heimdall/v6/httpclient" + "github.com/gojek/heimdall/v6" + "github.com/gojek/heimdall/v6/httpclient" ) // Option represents the hystrix client options diff --git a/plugins/request_logger.go b/plugins/request_logger.go index d8686e3..307a134 100644 --- a/plugins/request_logger.go +++ b/plugins/request_logger.go @@ -8,7 +8,7 @@ import ( "os" "time" - "github.com/gojektech/heimdall/v6" + "github.com/gojek/heimdall/v6" ) type ctxKey string From 1dd64c7ed456c1d9c68eb1a66e8f52548b1e0918 Mon Sep 17 00:00:00 2001 From: "danny.aguswahyudi" Date: Tue, 11 May 2021 13:17:16 +0700 Subject: [PATCH 2/5] updating README, AUTHORS, CONTRIBUTING --- AUTHORS.md | 6 +++--- CONTRIBUTING.md | 4 ++-- README.md | 14 +++++++------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index e6fd49a..549a8ae 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -1,5 +1,5 @@ # Heimdall - Authors -For people who've contributed to [Heimdall](https://github.com/gojektech/heimdall), -_please checkout [Contributors Graphs](https://github.com/gojektech/heimdall/graphs/contributors) -on [GO-JEK Tech's GitHub](https://github.com/gojektech)._ +For people who've contributed to [Heimdall](https://github.com/gojek/heimdall), +_please checkout [Contributors Graphs](https://github.com/gojek/heimdall/graphs/contributors) +on [GO-JEK Tech's GitHub](https://github.com/gojek)._ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 826d20d..7d86cde 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Heimdall - Contributing -Heimdall `github.com/gojektech/heimdall` is an open-source project. +Heimdall `github.com/gojek/heimdall` is an open-source project. It is licensed using the [Apache License 2.0][1]. We appreciate pull requests; here are our guidelines: @@ -36,7 +36,7 @@ Much Thanks! ❤❤❤ GO-JEK Tech [1]: http://www.apache.org/licenses/LICENSE-2.0 -[2]: https://github.com/gojektech/heimdall/issues +[2]: https://github.com/gojek/heimdall/issues [3]: https://golang.org/doc/effective_go.html [4]: http://gun.io/blog/how-to-github-fork-branch-and-pull-request [5]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html diff --git a/README.md b/README.md index bef5763..2bbc47b 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@

Build Status - - + +

@@ -90,7 +90,7 @@ To import hystrix package of heimdall. ```go import "github.com/gojek/heimdall/v6/hystrix" // with go modules enabled (GO111MODULE=on or outside GOPATH) -import "github.com/gojektech/heimdall/hystrix" // with go modules disabled +import "github.com/gojek/heimdall/hystrix" // with go modules disabled ``` You can use the `hystrix.NewClient` function to create a client wrapped in a hystrix-like circuit breaker: @@ -207,7 +207,7 @@ client := httpclient.NewClient( // The rest is the same as the first example ``` -This will create an HTTP client which will retry every `500` milliseconds incase the request fails. The library also comes with an [Exponential Backoff](https://www.godoc.org/github.com/gojektech/heimdall#NewExponentialBackoff) +This will create an HTTP client which will retry every `500` milliseconds incase the request fails. The library also comes with an [Exponential Backoff](https://www.godoc.org/github.com/gojek/heimdall#NewExponentialBackoff) ### Custom retry mechanisms @@ -342,7 +342,7 @@ For a simple example on how to write plugins, look at the [request logger plugin ## Documentation -Further documentation can be found on [pkg.go.dev](https://pkg.go.dev/github.com/gojektech/heimdall) +Further documentation can be found on [pkg.go.dev](https://pkg.go.dev/github.com/gojek/heimdall) ## FAQ @@ -364,13 +364,13 @@ Heimdall makes use of [multiple mechanisms](https://medium.com/@sohamkamani/how- **So does this mean that I shouldn't use Heimdall for small scale applications?** -Although Heimdall was made keeping large scale systems in mind, it's interface is simple enough to be used for any type of systems. In fact, we use it for our pet projects as well. Even if you don't require retries or circuit breaking features, the [simpler HTTP client](https://github.com/gojektech/heimdall#making-a-simple-get-request) provides sensible defaults with a simpler interface, and can be upgraded easily should the need arise. +Although Heimdall was made keeping large scale systems in mind, it's interface is simple enough to be used for any type of systems. In fact, we use it for our pet projects as well. Even if you don't require retries or circuit breaking features, the [simpler HTTP client](https://github.com/gojek/heimdall#making-a-simple-get-request) provides sensible defaults with a simpler interface, and can be upgraded easily should the need arise. --- **Can I contribute to make Heimdall better?** -[Please do!](https://github.com/gojektech/heimdall/blob/master/CONTRIBUTING.md) We are looking for any kind of contribution to improve Heimdalls core funtionality and documentation. When in doubt, make a PR! +[Please do!](https://github.com/gojek/heimdall/blob/master/CONTRIBUTING.md) We are looking for any kind of contribution to improve Heimdalls core funtionality and documentation. When in doubt, make a PR! ## License From ba881d968e50cf550f89af18d6b43fa880c84e09 Mon Sep 17 00:00:00 2001 From: "danny.aguswahyudi" Date: Tue, 11 May 2021 13:26:06 +0700 Subject: [PATCH 3/5] Removing v6 from module name - Removing the v6 suffix in the module name can avoid stuttered version.Example github.com/gojek/heimdall/v6 v6.1.0. By removing the v6 we can let the user define the specific release. --- README.md | 9 ++++----- examples/client.go | 6 +++--- go.mod | 2 +- httpclient/client.go | 2 +- httpclient/client_test.go | 2 +- httpclient/options.go | 2 +- httpclient/options_test.go | 2 +- hystrix/hystrix_client.go | 4 ++-- hystrix/hystrix_client_test.go | 2 +- hystrix/options.go | 4 ++-- plugins/request_logger.go | 2 +- 11 files changed, 18 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 2bbc47b..536bd2a 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ All HTTP methods are exposed as a fluent interface. ## Installation ``` -go get -u github.com/gojek/heimdall/v6 +go get -u github.com/gojek/heimdall ``` ## Usage @@ -43,8 +43,7 @@ go get -u github.com/gojek/heimdall/v6 This package can be used by adding the following import statement to your `.go` files. ```go -import "github.com/gojek/heimdall/v6/httpclient" // with go modules enabled (GO111MODULE=on or outside GOPATH) -import "github.com/gojek/heimdall/httpclient" // with go modules disabled +import "github.com/gojek/heimdall/httpclient" ``` ### Making a simple `GET` request @@ -89,7 +88,7 @@ fmt.Println(string(body)) To import hystrix package of heimdall. ```go -import "github.com/gojek/heimdall/v6/hystrix" // with go modules enabled (GO111MODULE=on or outside GOPATH) +import "github.com/gojek/heimdall/hystrix" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/gojek/heimdall/hystrix" // with go modules disabled ``` @@ -314,7 +313,7 @@ To add a plugin to an existing client, use the `AddPlugin` method of the client. An example, with the [request logger plugin](/plugins/request_logger.go): ```go -// import "github.com/gojek/heimdall/v6/plugins" +// import "github.com/gojek/heimdall/plugins" client := heimdall.NewHTTPClient(timeout) requestLogger := plugins.NewRequestLogger(nil, nil) diff --git a/examples/client.go b/examples/client.go index c87663e..37bdc0f 100644 --- a/examples/client.go +++ b/examples/client.go @@ -6,9 +6,9 @@ import ( "net/http" "time" - "github.com/gojek/heimdall/v6" - "github.com/gojek/heimdall/v6/httpclient" - "github.com/gojek/heimdall/v6/hystrix" + "github.com/gojek/heimdall" + "github.com/gojek/heimdall/httpclient" + "github.com/gojek/heimdall/hystrix" "github.com/pkg/errors" ) diff --git a/go.mod b/go.mod index 71f7dd3..fefabd0 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/gojek/heimdall/v6 +module github.com/gojek/heimdall go 1.14 diff --git a/httpclient/client.go b/httpclient/client.go index b34a1cb..5d4454b 100644 --- a/httpclient/client.go +++ b/httpclient/client.go @@ -7,7 +7,7 @@ import ( "net/http" "time" - "github.com/gojek/heimdall/v6" + "github.com/gojek/heimdall" "github.com/gojek/valkyrie" "github.com/pkg/errors" ) diff --git a/httpclient/client_test.go b/httpclient/client_test.go index c71029d..fc23208 100644 --- a/httpclient/client_test.go +++ b/httpclient/client_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/gojek/heimdall/v6" + "github.com/gojek/heimdall" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" diff --git a/httpclient/options.go b/httpclient/options.go index aadc28b..f800f45 100644 --- a/httpclient/options.go +++ b/httpclient/options.go @@ -3,7 +3,7 @@ package httpclient import ( "time" - "github.com/gojek/heimdall/v6" + "github.com/gojek/heimdall" ) // Option represents the client options diff --git a/httpclient/options_test.go b/httpclient/options_test.go index 4e9bb69..d011277 100644 --- a/httpclient/options_test.go +++ b/httpclient/options_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/gojek/heimdall/v6" + "github.com/gojek/heimdall" "github.com/stretchr/testify/assert" ) diff --git a/hystrix/hystrix_client.go b/hystrix/hystrix_client.go index a4f8260..f8e639f 100644 --- a/hystrix/hystrix_client.go +++ b/hystrix/hystrix_client.go @@ -10,8 +10,8 @@ import ( "github.com/afex/hystrix-go/hystrix" metricCollector "github.com/afex/hystrix-go/hystrix/metric_collector" "github.com/afex/hystrix-go/plugins" - "github.com/gojek/heimdall/v6" - "github.com/gojek/heimdall/v6/httpclient" + "github.com/gojek/heimdall" + "github.com/gojek/heimdall/httpclient" "github.com/pkg/errors" ) diff --git a/hystrix/hystrix_client_test.go b/hystrix/hystrix_client_test.go index e98989f..67288c3 100644 --- a/hystrix/hystrix_client_test.go +++ b/hystrix/hystrix_client_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/gojek/heimdall/v6" + "github.com/gojek/heimdall" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/hystrix/options.go b/hystrix/options.go index def1c78..0e2f05c 100644 --- a/hystrix/options.go +++ b/hystrix/options.go @@ -4,8 +4,8 @@ import ( "time" "github.com/afex/hystrix-go/plugins" - "github.com/gojek/heimdall/v6" - "github.com/gojek/heimdall/v6/httpclient" + "github.com/gojek/heimdall" + "github.com/gojek/heimdall/httpclient" ) // Option represents the hystrix client options diff --git a/plugins/request_logger.go b/plugins/request_logger.go index 307a134..9c9f7b3 100644 --- a/plugins/request_logger.go +++ b/plugins/request_logger.go @@ -8,7 +8,7 @@ import ( "os" "time" - "github.com/gojek/heimdall/v6" + "github.com/gojek/heimdall" ) type ctxKey string From cdb37c67a0cf981c4c3550b16a7e5c0cd737c8d7 Mon Sep 17 00:00:00 2001 From: "danny.aguswahyudi" Date: Tue, 11 May 2021 17:15:16 +0700 Subject: [PATCH 4/5] adding v7 convention --- README.md | 9 ++++----- examples/client.go | 6 +++--- go.mod | 2 +- httpclient/client.go | 2 +- httpclient/client_test.go | 2 +- httpclient/options.go | 2 +- httpclient/options_test.go | 2 +- hystrix/hystrix_client.go | 4 ++-- hystrix/hystrix_client_test.go | 2 +- hystrix/options.go | 4 ++-- plugins/request_logger.go | 2 +- 11 files changed, 18 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 536bd2a..cca8ef8 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ go get -u github.com/gojek/heimdall This package can be used by adding the following import statement to your `.go` files. ```go -import "github.com/gojek/heimdall/httpclient" +import "github.com/gojek/heimdall/v7/httpclient" ``` ### Making a simple `GET` request @@ -88,8 +88,7 @@ fmt.Println(string(body)) To import hystrix package of heimdall. ```go -import "github.com/gojek/heimdall/hystrix" // with go modules enabled (GO111MODULE=on or outside GOPATH) -import "github.com/gojek/heimdall/hystrix" // with go modules disabled +import "github.com/gojek/heimdall/v7/hystrix" ``` You can use the `hystrix.NewClient` function to create a client wrapped in a hystrix-like circuit breaker: @@ -313,7 +312,7 @@ To add a plugin to an existing client, use the `AddPlugin` method of the client. An example, with the [request logger plugin](/plugins/request_logger.go): ```go -// import "github.com/gojek/heimdall/plugins" +// import "github.com/gojek/heimdall/v7/plugins" client := heimdall.NewHTTPClient(timeout) requestLogger := plugins.NewRequestLogger(nil, nil) @@ -341,7 +340,7 @@ For a simple example on how to write plugins, look at the [request logger plugin ## Documentation -Further documentation can be found on [pkg.go.dev](https://pkg.go.dev/github.com/gojek/heimdall) +Further documentation can be found on [pkg.go.dev](https://pkg.go.dev/github.com/gojek/heimdall/v7) ## FAQ diff --git a/examples/client.go b/examples/client.go index 37bdc0f..925f3ed 100644 --- a/examples/client.go +++ b/examples/client.go @@ -6,9 +6,9 @@ import ( "net/http" "time" - "github.com/gojek/heimdall" - "github.com/gojek/heimdall/httpclient" - "github.com/gojek/heimdall/hystrix" + "github.com/gojek/heimdall/v7" + "github.com/gojek/heimdall/v7/httpclient" + "github.com/gojek/heimdall/v7/hystrix" "github.com/pkg/errors" ) diff --git a/go.mod b/go.mod index fefabd0..9cc72ad 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/gojek/heimdall +module github.com/gojek/heimdall/v7 go 1.14 diff --git a/httpclient/client.go b/httpclient/client.go index 5d4454b..6880776 100644 --- a/httpclient/client.go +++ b/httpclient/client.go @@ -7,7 +7,7 @@ import ( "net/http" "time" - "github.com/gojek/heimdall" + "github.com/gojek/heimdall/v7" "github.com/gojek/valkyrie" "github.com/pkg/errors" ) diff --git a/httpclient/client_test.go b/httpclient/client_test.go index fc23208..83e94ba 100644 --- a/httpclient/client_test.go +++ b/httpclient/client_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/gojek/heimdall" + "github.com/gojek/heimdall/v7" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" diff --git a/httpclient/options.go b/httpclient/options.go index f800f45..a43cf02 100644 --- a/httpclient/options.go +++ b/httpclient/options.go @@ -3,7 +3,7 @@ package httpclient import ( "time" - "github.com/gojek/heimdall" + "github.com/gojek/heimdall/v7" ) // Option represents the client options diff --git a/httpclient/options_test.go b/httpclient/options_test.go index d011277..a9eb5ba 100644 --- a/httpclient/options_test.go +++ b/httpclient/options_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/gojek/heimdall" + "github.com/gojek/heimdall/v7" "github.com/stretchr/testify/assert" ) diff --git a/hystrix/hystrix_client.go b/hystrix/hystrix_client.go index f8e639f..563aa7c 100644 --- a/hystrix/hystrix_client.go +++ b/hystrix/hystrix_client.go @@ -10,8 +10,8 @@ import ( "github.com/afex/hystrix-go/hystrix" metricCollector "github.com/afex/hystrix-go/hystrix/metric_collector" "github.com/afex/hystrix-go/plugins" - "github.com/gojek/heimdall" - "github.com/gojek/heimdall/httpclient" + "github.com/gojek/heimdall/v7" + "github.com/gojek/heimdall/v7/httpclient" "github.com/pkg/errors" ) diff --git a/hystrix/hystrix_client_test.go b/hystrix/hystrix_client_test.go index 67288c3..b90d084 100644 --- a/hystrix/hystrix_client_test.go +++ b/hystrix/hystrix_client_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/gojek/heimdall" + "github.com/gojek/heimdall/v7" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/hystrix/options.go b/hystrix/options.go index 0e2f05c..d5f5639 100644 --- a/hystrix/options.go +++ b/hystrix/options.go @@ -4,8 +4,8 @@ import ( "time" "github.com/afex/hystrix-go/plugins" - "github.com/gojek/heimdall" - "github.com/gojek/heimdall/httpclient" + "github.com/gojek/heimdall/v7" + "github.com/gojek/heimdall/v7/httpclient" ) // Option represents the hystrix client options diff --git a/plugins/request_logger.go b/plugins/request_logger.go index 9c9f7b3..1e1b488 100644 --- a/plugins/request_logger.go +++ b/plugins/request_logger.go @@ -8,7 +8,7 @@ import ( "os" "time" - "github.com/gojek/heimdall" + "github.com/gojek/heimdall/v7" ) type ctxKey string From e009f97dba7983d8b6fa4cd8374694ff1d17b32c Mon Sep 17 00:00:00 2001 From: "danny.aguswahyudi" Date: Tue, 11 May 2021 19:25:21 +0700 Subject: [PATCH 5/5] update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cca8ef8..285ba65 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ All HTTP methods are exposed as a fluent interface. ## Installation ``` -go get -u github.com/gojek/heimdall +go get -u github.com/gojek/heimdall/v7 ``` ## Usage @@ -205,7 +205,7 @@ client := httpclient.NewClient( // The rest is the same as the first example ``` -This will create an HTTP client which will retry every `500` milliseconds incase the request fails. The library also comes with an [Exponential Backoff](https://www.godoc.org/github.com/gojek/heimdall#NewExponentialBackoff) +This will create an HTTP client which will retry every `500` milliseconds incase the request fails. The library also comes with an [Exponential Backoff](https://pkg.go.dev/github.com/gojek/heimdall#NewExponentialBackoff) ### Custom retry mechanisms