From 183bbe871c9a1e98c7c39fe987cf7bc39a80eef1 Mon Sep 17 00:00:00 2001 From: CrazyBolillo Date: Sun, 6 Oct 2024 00:10:18 -0600 Subject: [PATCH] ref: move models to pkg This makes it possible for other projects to use the same model definitions when making requests to the API. --- internal/handler/authorization.go | 2 +- internal/handler/endpoint.go | 2 +- internal/handler/endpoint_test.go | 2 +- internal/service/bouncer.go | 2 +- internal/service/contact.go | 2 +- internal/service/endpoint.go | 2 +- {internal => pkg}/model/bouncer.go | 0 {internal => pkg}/model/contact.go | 0 {internal => pkg}/model/endpoint.go | 0 9 files changed, 6 insertions(+), 6 deletions(-) rename {internal => pkg}/model/bouncer.go (100%) rename {internal => pkg}/model/contact.go (100%) rename {internal => pkg}/model/endpoint.go (100%) diff --git a/internal/handler/authorization.go b/internal/handler/authorization.go index 2496e62..cbedcfb 100644 --- a/internal/handler/authorization.go +++ b/internal/handler/authorization.go @@ -3,7 +3,7 @@ package handler import ( "context" "encoding/json" - "github.com/crazybolillo/eryth/internal/model" + "github.com/crazybolillo/eryth/pkg/model" "github.com/go-chi/chi/v5" "log/slog" "net/http" diff --git a/internal/handler/endpoint.go b/internal/handler/endpoint.go index 0970715..9c5f027 100644 --- a/internal/handler/endpoint.go +++ b/internal/handler/endpoint.go @@ -3,9 +3,9 @@ package handler import ( "encoding/json" "errors" - "github.com/crazybolillo/eryth/internal/model" "github.com/crazybolillo/eryth/internal/query" "github.com/crazybolillo/eryth/internal/service" + "github.com/crazybolillo/eryth/pkg/model" "github.com/go-chi/chi/v5" "github.com/jackc/pgx/v5" "log/slog" diff --git a/internal/handler/endpoint_test.go b/internal/handler/endpoint_test.go index 5fc98f4..a38e7b3 100644 --- a/internal/handler/endpoint_test.go +++ b/internal/handler/endpoint_test.go @@ -5,8 +5,8 @@ import ( "context" "encoding/json" "fmt" - "github.com/crazybolillo/eryth/internal/model" "github.com/crazybolillo/eryth/internal/service" + "github.com/crazybolillo/eryth/pkg/model" "github.com/jackc/pgx/v5" "net/http" "net/http/httptest" diff --git a/internal/service/bouncer.go b/internal/service/bouncer.go index a3daab8..bf63259 100644 --- a/internal/service/bouncer.go +++ b/internal/service/bouncer.go @@ -3,8 +3,8 @@ package service import ( "context" "github.com/crazybolillo/eryth/internal/db" - "github.com/crazybolillo/eryth/internal/model" "github.com/crazybolillo/eryth/internal/sqlc" + "github.com/crazybolillo/eryth/pkg/model" "log/slog" ) diff --git a/internal/service/contact.go b/internal/service/contact.go index 54bd8a8..ea09635 100644 --- a/internal/service/contact.go +++ b/internal/service/contact.go @@ -3,8 +3,8 @@ package service import ( "context" "errors" - "github.com/crazybolillo/eryth/internal/model" "github.com/crazybolillo/eryth/internal/sqlc" + "github.com/crazybolillo/eryth/pkg/model" "github.com/jackc/pgx/v5" ) diff --git a/internal/service/endpoint.go b/internal/service/endpoint.go index 09ead7a..ae80883 100644 --- a/internal/service/endpoint.go +++ b/internal/service/endpoint.go @@ -7,8 +7,8 @@ import ( "encoding/hex" "fmt" "github.com/crazybolillo/eryth/internal/db" - "github.com/crazybolillo/eryth/internal/model" "github.com/crazybolillo/eryth/internal/sqlc" + "github.com/crazybolillo/eryth/pkg/model" "strings" ) diff --git a/internal/model/bouncer.go b/pkg/model/bouncer.go similarity index 100% rename from internal/model/bouncer.go rename to pkg/model/bouncer.go diff --git a/internal/model/contact.go b/pkg/model/contact.go similarity index 100% rename from internal/model/contact.go rename to pkg/model/contact.go diff --git a/internal/model/endpoint.go b/pkg/model/endpoint.go similarity index 100% rename from internal/model/endpoint.go rename to pkg/model/endpoint.go