From ce2e66e690c744b92782911d1e34c560a6fddad4 Mon Sep 17 00:00:00 2001 From: Rafael Piovesan Date: Sun, 22 May 2022 15:06:54 -0300 Subject: [PATCH] refactor!: bumping version to v2 --- api/http/handler/handler.go | 2 +- api/http/handler/ride.go | 4 ++-- api/http/handler/ride_test.go | 6 +++--- api/http/middleware/originip.go | 2 +- api/http/middleware/user.go | 4 ++-- api/http/server.go | 8 ++++---- cmd/api/main.go | 8 ++++---- datastore/bun/audit_record.go | 2 +- datastore/bun/audit_record_test.go | 10 +++++----- datastore/bun/idempotency_key.go | 2 +- datastore/bun/idempotency_key_test.go | 10 +++++----- datastore/bun/ride.go | 2 +- datastore/bun/ride_test.go | 8 ++++---- datastore/bun/sqlstore.go | 2 +- datastore/bun/sqlstore_test.go | 12 ++++++------ datastore/bun/staged_job.go | 2 +- datastore/bun/staged_job_test.go | 8 ++++---- datastore/bun/user.go | 2 +- datastore/bun/user_test.go | 8 ++++---- entity/audit_record.go | 2 +- entity/idempotency_key.go | 2 +- entity/staged_job.go | 2 +- go.mod | 2 +- mocks/Datastore.go | 4 ++-- mocks/RideUseCase.go | 2 +- rocketride.go | 2 +- usecase/ride.go | 12 ++++++------ usecase/ride_test.go | 10 +++++----- 28 files changed, 70 insertions(+), 70 deletions(-) diff --git a/api/http/handler/handler.go b/api/http/handler/handler.go index 5e67eac..a1a215a 100644 --- a/api/http/handler/handler.go +++ b/api/http/handler/handler.go @@ -6,7 +6,7 @@ import ( "github.com/go-playground/validator/v10" "github.com/labstack/echo/v4" - "github.com/rafael-piovesan/go-rocket-ride/entity" + "github.com/rafael-piovesan/go-rocket-ride/v2/entity" ) type Handler struct { diff --git a/api/http/handler/ride.go b/api/http/handler/ride.go index 58c1d6d..a9c1fda 100644 --- a/api/http/handler/ride.go +++ b/api/http/handler/ride.go @@ -6,8 +6,8 @@ import ( "math" "github.com/labstack/echo/v4" - rocketride "github.com/rafael-piovesan/go-rocket-ride" - "github.com/rafael-piovesan/go-rocket-ride/entity" + rocketride "github.com/rafael-piovesan/go-rocket-ride/v2" + "github.com/rafael-piovesan/go-rocket-ride/v2/entity" ) type createRequest struct { diff --git a/api/http/handler/ride_test.go b/api/http/handler/ride_test.go index 1ff021a..b486737 100644 --- a/api/http/handler/ride_test.go +++ b/api/http/handler/ride_test.go @@ -14,9 +14,9 @@ import ( "github.com/brianvoe/gofakeit/v6" "github.com/labstack/echo/v4" - "github.com/rafael-piovesan/go-rocket-ride/entity" - "github.com/rafael-piovesan/go-rocket-ride/entity/idempotency" - "github.com/rafael-piovesan/go-rocket-ride/mocks" + "github.com/rafael-piovesan/go-rocket-ride/v2/entity" + "github.com/rafael-piovesan/go-rocket-ride/v2/entity/idempotency" + "github.com/rafael-piovesan/go-rocket-ride/v2/mocks" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" diff --git a/api/http/middleware/originip.go b/api/http/middleware/originip.go index 2a8c81c..bb2aedf 100644 --- a/api/http/middleware/originip.go +++ b/api/http/middleware/originip.go @@ -2,7 +2,7 @@ package middleware import ( "github.com/labstack/echo/v4" - "github.com/rafael-piovesan/go-rocket-ride/entity/originip" + "github.com/rafael-piovesan/go-rocket-ride/v2/entity/originip" ) type IPMiddleware struct{} diff --git a/api/http/middleware/user.go b/api/http/middleware/user.go index a800a16..95e0a46 100644 --- a/api/http/middleware/user.go +++ b/api/http/middleware/user.go @@ -5,8 +5,8 @@ import ( "github.com/go-playground/validator/v10" "github.com/labstack/echo/v4" - rocketride "github.com/rafael-piovesan/go-rocket-ride" - "github.com/rafael-piovesan/go-rocket-ride/entity" + rocketride "github.com/rafael-piovesan/go-rocket-ride/v2" + "github.com/rafael-piovesan/go-rocket-ride/v2/entity" ) type userRequest struct { diff --git a/api/http/server.go b/api/http/server.go index 53195fb..83b9020 100644 --- a/api/http/server.go +++ b/api/http/server.go @@ -12,10 +12,10 @@ import ( "github.com/labstack/echo/v4" "github.com/labstack/echo/v4/middleware" "github.com/labstack/gommon/log" - rocketride "github.com/rafael-piovesan/go-rocket-ride" - "github.com/rafael-piovesan/go-rocket-ride/api/http/handler" - cstmiddleware "github.com/rafael-piovesan/go-rocket-ride/api/http/middleware" - "github.com/rafael-piovesan/go-rocket-ride/usecase" + rocketride "github.com/rafael-piovesan/go-rocket-ride/v2" + "github.com/rafael-piovesan/go-rocket-ride/v2/api/http/handler" + cstmiddleware "github.com/rafael-piovesan/go-rocket-ride/v2/api/http/middleware" + "github.com/rafael-piovesan/go-rocket-ride/v2/usecase" ) type Server struct { diff --git a/cmd/api/main.go b/cmd/api/main.go index 0cc6f27..d3043e6 100644 --- a/cmd/api/main.go +++ b/cmd/api/main.go @@ -3,10 +3,10 @@ package main import ( "log" - rocketride "github.com/rafael-piovesan/go-rocket-ride" - "github.com/rafael-piovesan/go-rocket-ride/api/http" - bunstore "github.com/rafael-piovesan/go-rocket-ride/datastore/bun" - "github.com/rafael-piovesan/go-rocket-ride/pkg/stripemock" + rocketride "github.com/rafael-piovesan/go-rocket-ride/v2" + "github.com/rafael-piovesan/go-rocket-ride/v2/api/http" + bunstore "github.com/rafael-piovesan/go-rocket-ride/v2/datastore/bun" + "github.com/rafael-piovesan/go-rocket-ride/v2/pkg/stripemock" ) func main() { diff --git a/datastore/bun/audit_record.go b/datastore/bun/audit_record.go index e1225e7..865117d 100644 --- a/datastore/bun/audit_record.go +++ b/datastore/bun/audit_record.go @@ -3,7 +3,7 @@ package bun import ( "context" - "github.com/rafael-piovesan/go-rocket-ride/entity" + "github.com/rafael-piovesan/go-rocket-ride/v2/entity" ) func (s *sqlStore) CreateAuditRecord(ctx context.Context, ar *entity.AuditRecord) (*entity.AuditRecord, error) { diff --git a/datastore/bun/audit_record_test.go b/datastore/bun/audit_record_test.go index 58f3205..1a64777 100644 --- a/datastore/bun/audit_record_test.go +++ b/datastore/bun/audit_record_test.go @@ -8,11 +8,11 @@ import ( "testing" "github.com/brianvoe/gofakeit/v6" - "github.com/rafael-piovesan/go-rocket-ride/entity" - "github.com/rafael-piovesan/go-rocket-ride/entity/audit" - "github.com/rafael-piovesan/go-rocket-ride/pkg/migrate" - "github.com/rafael-piovesan/go-rocket-ride/pkg/testcontainer" - "github.com/rafael-piovesan/go-rocket-ride/pkg/testfixtures" + "github.com/rafael-piovesan/go-rocket-ride/v2/entity" + "github.com/rafael-piovesan/go-rocket-ride/v2/entity/audit" + "github.com/rafael-piovesan/go-rocket-ride/v2/pkg/migrate" + "github.com/rafael-piovesan/go-rocket-ride/v2/pkg/testcontainer" + "github.com/rafael-piovesan/go-rocket-ride/v2/pkg/testfixtures" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/tabbed/pqtype" diff --git a/datastore/bun/idempotency_key.go b/datastore/bun/idempotency_key.go index f15e689..7fdcf19 100644 --- a/datastore/bun/idempotency_key.go +++ b/datastore/bun/idempotency_key.go @@ -5,7 +5,7 @@ import ( "database/sql" "errors" - "github.com/rafael-piovesan/go-rocket-ride/entity" + "github.com/rafael-piovesan/go-rocket-ride/v2/entity" ) func (s *sqlStore) CreateIdempotencyKey( diff --git a/datastore/bun/idempotency_key_test.go b/datastore/bun/idempotency_key_test.go index a1335cb..a662a93 100644 --- a/datastore/bun/idempotency_key_test.go +++ b/datastore/bun/idempotency_key_test.go @@ -10,11 +10,11 @@ import ( "time" "github.com/brianvoe/gofakeit/v6" - "github.com/rafael-piovesan/go-rocket-ride/entity" - "github.com/rafael-piovesan/go-rocket-ride/entity/idempotency" - "github.com/rafael-piovesan/go-rocket-ride/pkg/migrate" - "github.com/rafael-piovesan/go-rocket-ride/pkg/testcontainer" - "github.com/rafael-piovesan/go-rocket-ride/pkg/testfixtures" + "github.com/rafael-piovesan/go-rocket-ride/v2/entity" + "github.com/rafael-piovesan/go-rocket-ride/v2/entity/idempotency" + "github.com/rafael-piovesan/go-rocket-ride/v2/pkg/migrate" + "github.com/rafael-piovesan/go-rocket-ride/v2/pkg/testcontainer" + "github.com/rafael-piovesan/go-rocket-ride/v2/pkg/testfixtures" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/datastore/bun/ride.go b/datastore/bun/ride.go index 7358141..a4f3d29 100644 --- a/datastore/bun/ride.go +++ b/datastore/bun/ride.go @@ -5,7 +5,7 @@ import ( "database/sql" "errors" - "github.com/rafael-piovesan/go-rocket-ride/entity" + "github.com/rafael-piovesan/go-rocket-ride/v2/entity" ) func (s *sqlStore) CreateRide(ctx context.Context, rd *entity.Ride) (*entity.Ride, error) { diff --git a/datastore/bun/ride_test.go b/datastore/bun/ride_test.go index bc2b285..0ef2cb9 100644 --- a/datastore/bun/ride_test.go +++ b/datastore/bun/ride_test.go @@ -8,10 +8,10 @@ import ( "testing" "github.com/brianvoe/gofakeit/v6" - "github.com/rafael-piovesan/go-rocket-ride/entity" - "github.com/rafael-piovesan/go-rocket-ride/pkg/migrate" - "github.com/rafael-piovesan/go-rocket-ride/pkg/testcontainer" - "github.com/rafael-piovesan/go-rocket-ride/pkg/testfixtures" + "github.com/rafael-piovesan/go-rocket-ride/v2/entity" + "github.com/rafael-piovesan/go-rocket-ride/v2/pkg/migrate" + "github.com/rafael-piovesan/go-rocket-ride/v2/pkg/testcontainer" + "github.com/rafael-piovesan/go-rocket-ride/v2/pkg/testfixtures" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/datastore/bun/sqlstore.go b/datastore/bun/sqlstore.go index 1c15250..48331e8 100644 --- a/datastore/bun/sqlstore.go +++ b/datastore/bun/sqlstore.go @@ -12,7 +12,7 @@ import ( // loading bun's official Postgres driver. _ "github.com/uptrace/bun/driver/pgdriver" - rocketride "github.com/rafael-piovesan/go-rocket-ride" + rocketride "github.com/rafael-piovesan/go-rocket-ride/v2" ) type sqlStore struct { diff --git a/datastore/bun/sqlstore_test.go b/datastore/bun/sqlstore_test.go index d4601df..5e2320a 100644 --- a/datastore/bun/sqlstore_test.go +++ b/datastore/bun/sqlstore_test.go @@ -9,12 +9,12 @@ import ( "testing" "github.com/brianvoe/gofakeit/v6" - rocketride "github.com/rafael-piovesan/go-rocket-ride" - "github.com/rafael-piovesan/go-rocket-ride/entity" - "github.com/rafael-piovesan/go-rocket-ride/entity/audit" - "github.com/rafael-piovesan/go-rocket-ride/pkg/migrate" - "github.com/rafael-piovesan/go-rocket-ride/pkg/testcontainer" - "github.com/rafael-piovesan/go-rocket-ride/pkg/testfixtures" + rocketride "github.com/rafael-piovesan/go-rocket-ride/v2" + "github.com/rafael-piovesan/go-rocket-ride/v2/entity" + "github.com/rafael-piovesan/go-rocket-ride/v2/entity/audit" + "github.com/rafael-piovesan/go-rocket-ride/v2/pkg/migrate" + "github.com/rafael-piovesan/go-rocket-ride/v2/pkg/testcontainer" + "github.com/rafael-piovesan/go-rocket-ride/v2/pkg/testfixtures" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/tabbed/pqtype" diff --git a/datastore/bun/staged_job.go b/datastore/bun/staged_job.go index 9f1861a..88d7bf9 100644 --- a/datastore/bun/staged_job.go +++ b/datastore/bun/staged_job.go @@ -3,7 +3,7 @@ package bun import ( "context" - "github.com/rafael-piovesan/go-rocket-ride/entity" + "github.com/rafael-piovesan/go-rocket-ride/v2/entity" ) func (s *sqlStore) CreateStagedJob(ctx context.Context, sj *entity.StagedJob) (*entity.StagedJob, error) { diff --git a/datastore/bun/staged_job_test.go b/datastore/bun/staged_job_test.go index 5f5c55e..2af5cf4 100644 --- a/datastore/bun/staged_job_test.go +++ b/datastore/bun/staged_job_test.go @@ -7,10 +7,10 @@ import ( "context" "testing" - "github.com/rafael-piovesan/go-rocket-ride/entity" - "github.com/rafael-piovesan/go-rocket-ride/entity/stagedjob" - "github.com/rafael-piovesan/go-rocket-ride/pkg/migrate" - "github.com/rafael-piovesan/go-rocket-ride/pkg/testcontainer" + "github.com/rafael-piovesan/go-rocket-ride/v2/entity" + "github.com/rafael-piovesan/go-rocket-ride/v2/entity/stagedjob" + "github.com/rafael-piovesan/go-rocket-ride/v2/pkg/migrate" + "github.com/rafael-piovesan/go-rocket-ride/v2/pkg/testcontainer" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/datastore/bun/user.go b/datastore/bun/user.go index fe492b0..00b6bd3 100644 --- a/datastore/bun/user.go +++ b/datastore/bun/user.go @@ -6,7 +6,7 @@ import ( "errors" "strings" - "github.com/rafael-piovesan/go-rocket-ride/entity" + "github.com/rafael-piovesan/go-rocket-ride/v2/entity" ) func (s *sqlStore) GetUserByEmail(ctx context.Context, e string) (*entity.User, error) { diff --git a/datastore/bun/user_test.go b/datastore/bun/user_test.go index a26fbd9..fb2db48 100644 --- a/datastore/bun/user_test.go +++ b/datastore/bun/user_test.go @@ -8,10 +8,10 @@ import ( "testing" "github.com/brianvoe/gofakeit/v6" - "github.com/rafael-piovesan/go-rocket-ride/entity" - "github.com/rafael-piovesan/go-rocket-ride/pkg/migrate" - "github.com/rafael-piovesan/go-rocket-ride/pkg/testcontainer" - "github.com/rafael-piovesan/go-rocket-ride/pkg/testfixtures" + "github.com/rafael-piovesan/go-rocket-ride/v2/entity" + "github.com/rafael-piovesan/go-rocket-ride/v2/pkg/migrate" + "github.com/rafael-piovesan/go-rocket-ride/v2/pkg/testcontainer" + "github.com/rafael-piovesan/go-rocket-ride/v2/pkg/testfixtures" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/entity/audit_record.go b/entity/audit_record.go index 671de99..eee579c 100644 --- a/entity/audit_record.go +++ b/entity/audit_record.go @@ -4,7 +4,7 @@ import ( "encoding/json" "time" - "github.com/rafael-piovesan/go-rocket-ride/entity/audit" + "github.com/rafael-piovesan/go-rocket-ride/v2/entity/audit" ) type AuditRecord struct { diff --git a/entity/idempotency_key.go b/entity/idempotency_key.go index 9aa00e2..7509b0f 100644 --- a/entity/idempotency_key.go +++ b/entity/idempotency_key.go @@ -4,7 +4,7 @@ import ( "encoding/json" "time" - "github.com/rafael-piovesan/go-rocket-ride/entity/idempotency" + "github.com/rafael-piovesan/go-rocket-ride/v2/entity/idempotency" ) type IdempotencyKey struct { diff --git a/entity/staged_job.go b/entity/staged_job.go index a73292a..c6c4907 100644 --- a/entity/staged_job.go +++ b/entity/staged_job.go @@ -3,7 +3,7 @@ package entity import ( "encoding/json" - "github.com/rafael-piovesan/go-rocket-ride/entity/stagedjob" + "github.com/rafael-piovesan/go-rocket-ride/v2/entity/stagedjob" ) type StagedJob struct { diff --git a/go.mod b/go.mod index dd3f545..8974bdc 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/rafael-piovesan/go-rocket-ride +module github.com/rafael-piovesan/go-rocket-ride/v2 go 1.18 diff --git a/mocks/Datastore.go b/mocks/Datastore.go index 4bf955c..eeae60e 100644 --- a/mocks/Datastore.go +++ b/mocks/Datastore.go @@ -5,10 +5,10 @@ package mocks import ( context "context" - entity "github.com/rafael-piovesan/go-rocket-ride/entity" + entity "github.com/rafael-piovesan/go-rocket-ride/v2/entity" mock "github.com/stretchr/testify/mock" - rocketride "github.com/rafael-piovesan/go-rocket-ride" + rocketride "github.com/rafael-piovesan/go-rocket-ride/v2" testing "testing" ) diff --git a/mocks/RideUseCase.go b/mocks/RideUseCase.go index 2b88989..08c8a3a 100644 --- a/mocks/RideUseCase.go +++ b/mocks/RideUseCase.go @@ -5,7 +5,7 @@ package mocks import ( context "context" - entity "github.com/rafael-piovesan/go-rocket-ride/entity" + entity "github.com/rafael-piovesan/go-rocket-ride/v2/entity" mock "github.com/stretchr/testify/mock" testing "testing" diff --git a/rocketride.go b/rocketride.go index 09e4c07..0a8e4d8 100644 --- a/rocketride.go +++ b/rocketride.go @@ -3,7 +3,7 @@ package rocketride import ( "context" - "github.com/rafael-piovesan/go-rocket-ride/entity" + "github.com/rafael-piovesan/go-rocket-ride/v2/entity" ) type Datastore interface { diff --git a/usecase/ride.go b/usecase/ride.go index 49025ee..8b4fc63 100644 --- a/usecase/ride.go +++ b/usecase/ride.go @@ -12,12 +12,12 @@ import ( "github.com/stripe/stripe-go/v72" "github.com/stripe/stripe-go/v72/charge" - rocketride "github.com/rafael-piovesan/go-rocket-ride" - "github.com/rafael-piovesan/go-rocket-ride/entity" - "github.com/rafael-piovesan/go-rocket-ride/entity/audit" - "github.com/rafael-piovesan/go-rocket-ride/entity/idempotency" - "github.com/rafael-piovesan/go-rocket-ride/entity/originip" - "github.com/rafael-piovesan/go-rocket-ride/entity/stagedjob" + rocketride "github.com/rafael-piovesan/go-rocket-ride/v2" + "github.com/rafael-piovesan/go-rocket-ride/v2/entity" + "github.com/rafael-piovesan/go-rocket-ride/v2/entity/audit" + "github.com/rafael-piovesan/go-rocket-ride/v2/entity/idempotency" + "github.com/rafael-piovesan/go-rocket-ride/v2/entity/originip" + "github.com/rafael-piovesan/go-rocket-ride/v2/entity/stagedjob" ) type rideUseCase struct { diff --git a/usecase/ride_test.go b/usecase/ride_test.go index 11d6407..2a45491 100644 --- a/usecase/ride_test.go +++ b/usecase/ride_test.go @@ -11,11 +11,11 @@ import ( "time" "github.com/brianvoe/gofakeit/v6" - rocketride "github.com/rafael-piovesan/go-rocket-ride" - "github.com/rafael-piovesan/go-rocket-ride/entity" - "github.com/rafael-piovesan/go-rocket-ride/entity/idempotency" - "github.com/rafael-piovesan/go-rocket-ride/entity/originip" - "github.com/rafael-piovesan/go-rocket-ride/mocks" + rocketride "github.com/rafael-piovesan/go-rocket-ride/v2" + "github.com/rafael-piovesan/go-rocket-ride/v2/entity" + "github.com/rafael-piovesan/go-rocket-ride/v2/entity/idempotency" + "github.com/rafael-piovesan/go-rocket-ride/v2/entity/originip" + "github.com/rafael-piovesan/go-rocket-ride/v2/mocks" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require"