diff --git a/cmd/server/main.go b/cmd/server/main.go index 0a77ed6..8531e05 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -1,9 +1,11 @@ package main import ( - "golang-rest-api-template/config" - _ "golang-rest-api-template/internal/handlers/category/model" - "golang-rest-api-template/package/logger" + "github.com/MitulShah1/golang-rest-api-template/package/logger" + + _ "github.com/MitulShah1/golang-rest-api-template/internal/handlers/category/model" + + "github.com/MitulShah1/golang-rest-api-template/config" ) // @title REST API Template Example diff --git a/config/config.go b/config/config.go index 125292c..4275ba7 100644 --- a/config/config.go +++ b/config/config.go @@ -2,15 +2,16 @@ package config import ( "context" - "golang-rest-api-template/internal/handlers" - "golang-rest-api-template/package/database" - "golang-rest-api-template/package/logger" "net/http" "os" "os/signal" "syscall" "time" + "github.com/MitulShah1/golang-rest-api-template/internal/handlers" + "github.com/MitulShah1/golang-rest-api-template/package/database" + "github.com/MitulShah1/golang-rest-api-template/package/logger" + "github.com/joho/godotenv" ) diff --git a/docs/docs.go b/docs/docs.go index 2eb4ae1..498708a 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -74,19 +74,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.CategoryByIDResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.CategoryByIDResponse" } }, "400": { "description": "Bad Request", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse" } }, "401": { "description": "Unauthorized", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse" } }, "404": { @@ -98,7 +98,7 @@ const docTemplate = `{ "500": { "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse" } } } @@ -129,7 +129,7 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.UpdateCategoryRequest" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.UpdateCategoryRequest" } } ], @@ -137,19 +137,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse" } }, "400": { "description": "Bad Request", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse" } }, "401": { "description": "Unauthorized", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse" } }, "404": { @@ -161,7 +161,7 @@ const docTemplate = `{ "500": { "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse" } } } @@ -191,19 +191,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse" } }, "400": { "description": "Bad Request", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse" } }, "401": { "description": "Unauthorized", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse" } }, "404": { @@ -215,7 +215,7 @@ const docTemplate = `{ "500": { "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse" } } } @@ -241,7 +241,7 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.CreateCategoryRequest" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.CreateCategoryRequest" } } ], @@ -249,19 +249,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.CreateCategoryResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.CreateCategoryResponse" } }, "400": { "description": "Bad Request", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse" } }, "401": { "description": "Unauthorized", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse" } }, "404": { @@ -273,7 +273,7 @@ const docTemplate = `{ "500": { "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse" } } } @@ -299,7 +299,7 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_product_model.CreateProductRequest" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.CreateProductRequest" } } ], @@ -307,19 +307,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_product_model.ProductDetailResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.ProductDetailResponse" } }, "400": { "description": "Bad Request", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse" } }, "401": { "description": "Unauthorized", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse" } }, "404": { @@ -331,7 +331,7 @@ const docTemplate = `{ "500": { "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse" } } } @@ -363,19 +363,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_product_model.ProductDetailResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.ProductDetailResponse" } }, "400": { "description": "Bad Request", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse" } }, "401": { "description": "Unauthorized", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse" } }, "404": { @@ -387,7 +387,7 @@ const docTemplate = `{ "500": { "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse" } } } @@ -418,7 +418,7 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_product_model.UpdateProductRequest" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.UpdateProductRequest" } } ], @@ -426,19 +426,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse" } }, "400": { "description": "Bad Request", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse" } }, "401": { "description": "Unauthorized", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse" } }, "404": { @@ -450,7 +450,7 @@ const docTemplate = `{ "500": { "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse" } } } @@ -480,19 +480,19 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse" } }, "400": { "description": "Bad Request", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse" } }, "401": { "description": "Unauthorized", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse" } }, "404": { @@ -504,7 +504,7 @@ const docTemplate = `{ "500": { "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse" } } } @@ -512,11 +512,11 @@ const docTemplate = `{ } }, "definitions": { - "golang-rest-api-template_internal_handlers_category_model.CategoryByIDResponse": { + "github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.CategoryByIDResponse": { "type": "object", "properties": { "data": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.CategoryDetail" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.CategoryDetail" }, "message": { "type": "string" @@ -526,7 +526,7 @@ const docTemplate = `{ } } }, - "golang-rest-api-template_internal_handlers_category_model.CategoryDetail": { + "github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.CategoryDetail": { "type": "object", "properties": { "description": { @@ -543,7 +543,7 @@ const docTemplate = `{ } } }, - "golang-rest-api-template_internal_handlers_category_model.CreateCategoryRequest": { + "github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.CreateCategoryRequest": { "type": "object", "required": [ "description", @@ -562,7 +562,7 @@ const docTemplate = `{ } } }, - "golang-rest-api-template_internal_handlers_category_model.CreateCategoryResponse": { + "github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.CreateCategoryResponse": { "type": "object", "properties": { "data": { @@ -581,7 +581,7 @@ const docTemplate = `{ } } }, - "golang-rest-api-template_internal_handlers_category_model.StandardResponse": { + "github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse": { "type": "object", "properties": { "data": {}, @@ -593,7 +593,7 @@ const docTemplate = `{ } } }, - "golang-rest-api-template_internal_handlers_category_model.UpdateCategoryRequest": { + "github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.UpdateCategoryRequest": { "type": "object", "required": [ "description", @@ -612,7 +612,7 @@ const docTemplate = `{ } } }, - "golang-rest-api-template_internal_handlers_product_model.CreateProductRequest": { + "github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.CreateProductRequest": { "type": "object", "required": [ "category_id", @@ -639,7 +639,7 @@ const docTemplate = `{ } } }, - "golang-rest-api-template_internal_handlers_product_model.ProductDetailResponse": { + "github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.ProductDetailResponse": { "type": "object", "properties": { "category_id": { @@ -662,7 +662,7 @@ const docTemplate = `{ } } }, - "golang-rest-api-template_internal_handlers_product_model.StandardResponse": { + "github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse": { "type": "object", "properties": { "data": {}, @@ -674,7 +674,7 @@ const docTemplate = `{ } } }, - "golang-rest-api-template_internal_handlers_product_model.UpdateProductRequest": { + "github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.UpdateProductRequest": { "type": "object", "required": [ "category_id", diff --git a/docs/swagger.json b/docs/swagger.json index b81be6c..f74341e 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -67,19 +67,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.CategoryByIDResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.CategoryByIDResponse" } }, "400": { "description": "Bad Request", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse" } }, "401": { "description": "Unauthorized", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse" } }, "404": { @@ -91,7 +91,7 @@ "500": { "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse" } } } @@ -122,7 +122,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.UpdateCategoryRequest" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.UpdateCategoryRequest" } } ], @@ -130,19 +130,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse" } }, "400": { "description": "Bad Request", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse" } }, "401": { "description": "Unauthorized", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse" } }, "404": { @@ -154,7 +154,7 @@ "500": { "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse" } } } @@ -184,19 +184,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse" } }, "400": { "description": "Bad Request", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse" } }, "401": { "description": "Unauthorized", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse" } }, "404": { @@ -208,7 +208,7 @@ "500": { "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse" } } } @@ -234,7 +234,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.CreateCategoryRequest" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.CreateCategoryRequest" } } ], @@ -242,19 +242,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.CreateCategoryResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.CreateCategoryResponse" } }, "400": { "description": "Bad Request", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse" } }, "401": { "description": "Unauthorized", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse" } }, "404": { @@ -266,7 +266,7 @@ "500": { "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse" } } } @@ -292,7 +292,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_product_model.CreateProductRequest" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.CreateProductRequest" } } ], @@ -300,19 +300,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_product_model.ProductDetailResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.ProductDetailResponse" } }, "400": { "description": "Bad Request", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse" } }, "401": { "description": "Unauthorized", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse" } }, "404": { @@ -324,7 +324,7 @@ "500": { "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse" } } } @@ -356,19 +356,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_product_model.ProductDetailResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.ProductDetailResponse" } }, "400": { "description": "Bad Request", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse" } }, "401": { "description": "Unauthorized", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse" } }, "404": { @@ -380,7 +380,7 @@ "500": { "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse" } } } @@ -411,7 +411,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_product_model.UpdateProductRequest" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.UpdateProductRequest" } } ], @@ -419,19 +419,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse" } }, "400": { "description": "Bad Request", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse" } }, "401": { "description": "Unauthorized", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse" } }, "404": { @@ -443,7 +443,7 @@ "500": { "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse" } } } @@ -473,19 +473,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse" } }, "400": { "description": "Bad Request", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse" } }, "401": { "description": "Unauthorized", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse" } }, "404": { @@ -497,7 +497,7 @@ "500": { "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse" } } } @@ -505,11 +505,11 @@ } }, "definitions": { - "golang-rest-api-template_internal_handlers_category_model.CategoryByIDResponse": { + "github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.CategoryByIDResponse": { "type": "object", "properties": { "data": { - "$ref": "#/definitions/golang-rest-api-template_internal_handlers_category_model.CategoryDetail" + "$ref": "#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.CategoryDetail" }, "message": { "type": "string" @@ -519,7 +519,7 @@ } } }, - "golang-rest-api-template_internal_handlers_category_model.CategoryDetail": { + "github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.CategoryDetail": { "type": "object", "properties": { "description": { @@ -536,7 +536,7 @@ } } }, - "golang-rest-api-template_internal_handlers_category_model.CreateCategoryRequest": { + "github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.CreateCategoryRequest": { "type": "object", "required": [ "description", @@ -555,7 +555,7 @@ } } }, - "golang-rest-api-template_internal_handlers_category_model.CreateCategoryResponse": { + "github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.CreateCategoryResponse": { "type": "object", "properties": { "data": { @@ -574,7 +574,7 @@ } } }, - "golang-rest-api-template_internal_handlers_category_model.StandardResponse": { + "github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse": { "type": "object", "properties": { "data": {}, @@ -586,7 +586,7 @@ } } }, - "golang-rest-api-template_internal_handlers_category_model.UpdateCategoryRequest": { + "github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.UpdateCategoryRequest": { "type": "object", "required": [ "description", @@ -605,7 +605,7 @@ } } }, - "golang-rest-api-template_internal_handlers_product_model.CreateProductRequest": { + "github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.CreateProductRequest": { "type": "object", "required": [ "category_id", @@ -632,7 +632,7 @@ } } }, - "golang-rest-api-template_internal_handlers_product_model.ProductDetailResponse": { + "github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.ProductDetailResponse": { "type": "object", "properties": { "category_id": { @@ -655,7 +655,7 @@ } } }, - "golang-rest-api-template_internal_handlers_product_model.StandardResponse": { + "github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse": { "type": "object", "properties": { "data": {}, @@ -667,7 +667,7 @@ } } }, - "golang-rest-api-template_internal_handlers_product_model.UpdateProductRequest": { + "github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.UpdateProductRequest": { "type": "object", "required": [ "category_id", diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 510946f..2eab851 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -1,15 +1,15 @@ basePath: /api definitions: - golang-rest-api-template_internal_handlers_category_model.CategoryByIDResponse: + github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.CategoryByIDResponse: properties: data: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_category_model.CategoryDetail' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.CategoryDetail' message: type: string success: type: boolean type: object - golang-rest-api-template_internal_handlers_category_model.CategoryDetail: + github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.CategoryDetail: properties: description: type: string @@ -20,7 +20,7 @@ definitions: parent_id: type: integer type: object - golang-rest-api-template_internal_handlers_category_model.CreateCategoryRequest: + github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.CreateCategoryRequest: properties: description: type: string @@ -33,7 +33,7 @@ definitions: - name - parent_id type: object - golang-rest-api-template_internal_handlers_category_model.CreateCategoryResponse: + github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.CreateCategoryResponse: properties: data: properties: @@ -45,7 +45,7 @@ definitions: success: type: boolean type: object - golang-rest-api-template_internal_handlers_category_model.StandardResponse: + github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse: properties: data: {} message: @@ -53,7 +53,7 @@ definitions: success: type: boolean type: object - golang-rest-api-template_internal_handlers_category_model.UpdateCategoryRequest: + github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.UpdateCategoryRequest: properties: description: type: string @@ -66,7 +66,7 @@ definitions: - name - parent_id type: object - golang-rest-api-template_internal_handlers_product_model.CreateProductRequest: + github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.CreateProductRequest: properties: category_id: type: integer @@ -85,7 +85,7 @@ definitions: - price - stock type: object - golang-rest-api-template_internal_handlers_product_model.ProductDetailResponse: + github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.ProductDetailResponse: properties: category_id: type: integer @@ -100,7 +100,7 @@ definitions: stock: type: integer type: object - golang-rest-api-template_internal_handlers_product_model.StandardResponse: + github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse: properties: data: {} message: @@ -108,7 +108,7 @@ definitions: success: type: boolean type: object - golang-rest-api-template_internal_handlers_product_model.UpdateProductRequest: + github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.UpdateProductRequest: properties: category_id: type: integer @@ -177,15 +177,15 @@ paths: "200": description: OK schema: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse' "400": description: Bad Request schema: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse' "401": description: Unauthorized schema: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse' "404": description: 404 page not found schema: @@ -193,7 +193,7 @@ paths: "500": description: Internal Server Error schema: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse' summary: Delete Category example tags: - Category @@ -213,15 +213,15 @@ paths: "200": description: OK schema: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_category_model.CategoryByIDResponse' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.CategoryByIDResponse' "400": description: Bad Request schema: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse' "401": description: Unauthorized schema: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse' "404": description: 404 page not found schema: @@ -229,7 +229,7 @@ paths: "500": description: Internal Server Error schema: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse' summary: Get Category details example tags: - Category @@ -248,22 +248,22 @@ paths: name: category required: true schema: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_category_model.UpdateCategoryRequest' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.UpdateCategoryRequest' produces: - application/json responses: "200": description: OK schema: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse' "400": description: Bad Request schema: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse' "401": description: Unauthorized schema: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse' "404": description: 404 page not found schema: @@ -271,7 +271,7 @@ paths: "500": description: Internal Server Error schema: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse' summary: Update Category example tags: - Category @@ -286,22 +286,22 @@ paths: name: category required: true schema: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_category_model.CreateCategoryRequest' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.CreateCategoryRequest' produces: - application/json responses: "200": description: OK schema: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_category_model.CreateCategoryResponse' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.CreateCategoryResponse' "400": description: Bad Request schema: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse' "401": description: Unauthorized schema: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse' "404": description: 404 page not found schema: @@ -309,7 +309,7 @@ paths: "500": description: Internal Server Error schema: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_category_model.StandardResponse' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_category_model.StandardResponse' summary: Create Category example tags: - Category @@ -324,22 +324,22 @@ paths: name: product required: true schema: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_product_model.CreateProductRequest' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.CreateProductRequest' produces: - application/json responses: "200": description: OK schema: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_product_model.ProductDetailResponse' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.ProductDetailResponse' "400": description: Bad Request schema: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse' "401": description: Unauthorized schema: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse' "404": description: 404 page not found schema: @@ -347,7 +347,7 @@ paths: "500": description: Internal Server Error schema: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse' summary: Create Product example tags: - Product @@ -368,15 +368,15 @@ paths: "200": description: OK schema: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse' "400": description: Bad Request schema: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse' "401": description: Unauthorized schema: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse' "404": description: 404 page not found schema: @@ -384,7 +384,7 @@ paths: "500": description: Internal Server Error schema: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse' summary: Delete Product example tags: - Product @@ -404,15 +404,15 @@ paths: "200": description: OK schema: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_product_model.ProductDetailResponse' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.ProductDetailResponse' "400": description: Bad Request schema: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse' "401": description: Unauthorized schema: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse' "404": description: 404 page not found schema: @@ -420,7 +420,7 @@ paths: "500": description: Internal Server Error schema: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse' summary: Get Product details example tags: - Product @@ -439,22 +439,22 @@ paths: name: product required: true schema: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_product_model.UpdateProductRequest' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.UpdateProductRequest' produces: - application/json responses: "200": description: OK schema: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse' "400": description: Bad Request schema: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse' "401": description: Unauthorized schema: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse' "404": description: 404 page not found schema: @@ -462,7 +462,7 @@ paths: "500": description: Internal Server Error schema: - $ref: '#/definitions/golang-rest-api-template_internal_handlers_product_model.StandardResponse' + $ref: '#/definitions/github_com_MitulShah1_golang-rest-api-template_internal_handlers_product_model.StandardResponse' summary: Update Product example tags: - Product diff --git a/go.mod b/go.mod index d1cf192..f81d27f 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module golang-rest-api-template +module github.com/MitulShah1/golang-rest-api-template go 1.21.0 diff --git a/internal/handlers/category/api.go b/internal/handlers/category/api.go index 53f6b22..c86c04c 100644 --- a/internal/handlers/category/api.go +++ b/internal/handlers/category/api.go @@ -2,12 +2,13 @@ package category import ( "encoding/json" - "golang-rest-api-template/internal/handlers/product/model" - "golang-rest-api-template/internal/response" - "golang-rest-api-template/internal/services/category" - "golang-rest-api-template/package/logger" "net/http" + "github.com/MitulShah1/golang-rest-api-template/internal/handlers/product/model" + "github.com/MitulShah1/golang-rest-api-template/internal/response" + "github.com/MitulShah1/golang-rest-api-template/internal/services/category" + "github.com/MitulShah1/golang-rest-api-template/package/logger" + "github.com/gorilla/mux" ) diff --git a/internal/handlers/category/create.go b/internal/handlers/category/create.go index c1dc141..95e3538 100644 --- a/internal/handlers/category/create.go +++ b/internal/handlers/category/create.go @@ -2,11 +2,12 @@ package category import ( "encoding/json" - "golang-rest-api-template/internal/handlers/category/model" - "golang-rest-api-template/internal/response" - "golang-rest-api-template/package/validation" "io" "net/http" + + "github.com/MitulShah1/golang-rest-api-template/internal/handlers/category/model" + "github.com/MitulShah1/golang-rest-api-template/internal/response" + "github.com/MitulShah1/golang-rest-api-template/package/validation" ) // Category godoc diff --git a/internal/handlers/category/create_test.go b/internal/handlers/category/create_test.go index 99268d6..a3f7cac 100644 --- a/internal/handlers/category/create_test.go +++ b/internal/handlers/category/create_test.go @@ -9,9 +9,9 @@ import ( "net/http/httptest" "testing" - "golang-rest-api-template/internal/handlers/category/model" - "golang-rest-api-template/internal/services/category/mocks" - "golang-rest-api-template/package/logger" + "github.com/MitulShah1/golang-rest-api-template/internal/handlers/category/model" + "github.com/MitulShah1/golang-rest-api-template/internal/services/category/mocks" + "github.com/MitulShah1/golang-rest-api-template/package/logger" "github.com/stretchr/testify/assert" ) diff --git a/internal/handlers/category/delete.go b/internal/handlers/category/delete.go index df82a23..c0b4fc5 100644 --- a/internal/handlers/category/delete.go +++ b/internal/handlers/category/delete.go @@ -1,11 +1,12 @@ package category import ( - "golang-rest-api-template/internal/handlers/category/model" - "golang-rest-api-template/internal/response" "net/http" "strconv" + "github.com/MitulShah1/golang-rest-api-template/internal/handlers/category/model" + "github.com/MitulShah1/golang-rest-api-template/internal/response" + "github.com/gorilla/mux" ) diff --git a/internal/handlers/category/delete_test.go b/internal/handlers/category/delete_test.go index f47e1e7..c66c86a 100644 --- a/internal/handlers/category/delete_test.go +++ b/internal/handlers/category/delete_test.go @@ -7,9 +7,9 @@ import ( "net/http/httptest" "testing" - "golang-rest-api-template/internal/handlers/category/model" - sqlModel "golang-rest-api-template/internal/repository/model" - "golang-rest-api-template/package/logger" + "github.com/MitulShah1/golang-rest-api-template/internal/handlers/category/model" + sqlModel "github.com/MitulShah1/golang-rest-api-template/internal/repository/model" + "github.com/MitulShah1/golang-rest-api-template/package/logger" "github.com/gorilla/mux" "github.com/stretchr/testify/assert" diff --git a/internal/handlers/category/details.go b/internal/handlers/category/details.go index c2d411d..1cc9973 100644 --- a/internal/handlers/category/details.go +++ b/internal/handlers/category/details.go @@ -2,11 +2,12 @@ package category import ( "encoding/json" - "golang-rest-api-template/internal/handlers/category/model" - "golang-rest-api-template/internal/response" "net/http" "strconv" + "github.com/MitulShah1/golang-rest-api-template/internal/handlers/category/model" + "github.com/MitulShah1/golang-rest-api-template/internal/response" + "github.com/gorilla/mux" ) diff --git a/internal/handlers/category/details_test.go b/internal/handlers/category/details_test.go index 4622aea..2991148 100644 --- a/internal/handlers/category/details_test.go +++ b/internal/handlers/category/details_test.go @@ -6,9 +6,9 @@ import ( "net/http/httptest" "testing" - "golang-rest-api-template/internal/handlers/category/model" - sqlModel "golang-rest-api-template/internal/repository/model" - "golang-rest-api-template/package/logger" + "github.com/MitulShah1/golang-rest-api-template/internal/handlers/category/model" + sqlModel "github.com/MitulShah1/golang-rest-api-template/internal/repository/model" + "github.com/MitulShah1/golang-rest-api-template/package/logger" "github.com/gorilla/mux" "github.com/stretchr/testify/assert" diff --git a/internal/handlers/category/update.go b/internal/handlers/category/update.go index b9538da..889b8bd 100644 --- a/internal/handlers/category/update.go +++ b/internal/handlers/category/update.go @@ -2,13 +2,14 @@ package category import ( "encoding/json" - "golang-rest-api-template/internal/handlers/category/model" - "golang-rest-api-template/internal/response" - "golang-rest-api-template/package/validation" "io" "net/http" "strconv" + "github.com/MitulShah1/golang-rest-api-template/internal/handlers/category/model" + "github.com/MitulShah1/golang-rest-api-template/internal/response" + "github.com/MitulShah1/golang-rest-api-template/package/validation" + "github.com/gorilla/mux" ) diff --git a/internal/handlers/category/update_test.go b/internal/handlers/category/update_test.go index a818a63..c25e4df 100644 --- a/internal/handlers/category/update_test.go +++ b/internal/handlers/category/update_test.go @@ -7,8 +7,8 @@ import ( "net/http/httptest" "testing" - "golang-rest-api-template/internal/handlers/category/model" - "golang-rest-api-template/package/logger" + "github.com/MitulShah1/golang-rest-api-template/internal/handlers/category/model" + "github.com/MitulShah1/golang-rest-api-template/package/logger" "github.com/gorilla/mux" "github.com/stretchr/testify/assert" diff --git a/internal/handlers/health/api.go b/internal/handlers/health/api.go index f79ae5d..e935b25 100644 --- a/internal/handlers/health/api.go +++ b/internal/handlers/health/api.go @@ -1,10 +1,11 @@ package health import ( - "golang-rest-api-template/internal/response" - "golang-rest-api-template/package/logger" "net/http" + "github.com/MitulShah1/golang-rest-api-template/internal/response" + "github.com/MitulShah1/golang-rest-api-template/package/logger" + "github.com/gorilla/mux" ) diff --git a/internal/handlers/health/api_test.go b/internal/handlers/health/api_test.go index 6ee4fe3..0942bb2 100644 --- a/internal/handlers/health/api_test.go +++ b/internal/handlers/health/api_test.go @@ -3,7 +3,7 @@ package health import ( "testing" - "golang-rest-api-template/package/logger" + "github.com/MitulShah1/golang-rest-api-template/package/logger" "github.com/stretchr/testify/assert" ) diff --git a/internal/handlers/product/api.go b/internal/handlers/product/api.go index 6c730c0..6b34b28 100644 --- a/internal/handlers/product/api.go +++ b/internal/handlers/product/api.go @@ -2,12 +2,13 @@ package product import ( "encoding/json" - "golang-rest-api-template/internal/handlers/product/model" - "golang-rest-api-template/internal/response" - "golang-rest-api-template/internal/services/product" - "golang-rest-api-template/package/logger" "net/http" + "github.com/MitulShah1/golang-rest-api-template/internal/handlers/product/model" + "github.com/MitulShah1/golang-rest-api-template/internal/response" + "github.com/MitulShah1/golang-rest-api-template/internal/services/product" + "github.com/MitulShah1/golang-rest-api-template/package/logger" + "github.com/gorilla/mux" ) diff --git a/internal/handlers/product/create.go b/internal/handlers/product/create.go index 0a62dcd..f70190a 100644 --- a/internal/handlers/product/create.go +++ b/internal/handlers/product/create.go @@ -2,11 +2,12 @@ package product import ( "encoding/json" - "golang-rest-api-template/internal/handlers/product/model" - "golang-rest-api-template/internal/response" - "golang-rest-api-template/package/validation" "io" "net/http" + + "github.com/MitulShah1/golang-rest-api-template/internal/handlers/product/model" + "github.com/MitulShah1/golang-rest-api-template/internal/response" + "github.com/MitulShah1/golang-rest-api-template/package/validation" ) // Product godoc diff --git a/internal/handlers/product/create_test.go b/internal/handlers/product/create_test.go index 65211da..4951085 100644 --- a/internal/handlers/product/create_test.go +++ b/internal/handlers/product/create_test.go @@ -9,9 +9,9 @@ import ( "net/http/httptest" "testing" - "golang-rest-api-template/internal/handlers/product/model" - "golang-rest-api-template/internal/services/product/mocks" - "golang-rest-api-template/package/logger" + "github.com/MitulShah1/golang-rest-api-template/internal/handlers/product/model" + "github.com/MitulShah1/golang-rest-api-template/internal/services/product/mocks" + "github.com/MitulShah1/golang-rest-api-template/package/logger" "github.com/stretchr/testify/assert" ) diff --git a/internal/handlers/product/delete.go b/internal/handlers/product/delete.go index f004cc3..82fcb2d 100644 --- a/internal/handlers/product/delete.go +++ b/internal/handlers/product/delete.go @@ -1,11 +1,12 @@ package product import ( - "golang-rest-api-template/internal/handlers/product/model" - "golang-rest-api-template/internal/response" "net/http" "strconv" + "github.com/MitulShah1/golang-rest-api-template/internal/handlers/product/model" + "github.com/MitulShah1/golang-rest-api-template/internal/response" + "github.com/gorilla/mux" ) diff --git a/internal/handlers/product/delete_test.go b/internal/handlers/product/delete_test.go index fc5b16a..257d6f3 100644 --- a/internal/handlers/product/delete_test.go +++ b/internal/handlers/product/delete_test.go @@ -7,8 +7,8 @@ import ( "net/http/httptest" "testing" - "golang-rest-api-template/internal/handlers/product/model" - "golang-rest-api-template/package/logger" + "github.com/MitulShah1/golang-rest-api-template/internal/handlers/product/model" + "github.com/MitulShah1/golang-rest-api-template/package/logger" "github.com/gorilla/mux" "github.com/stretchr/testify/assert" diff --git a/internal/handlers/product/details.go b/internal/handlers/product/details.go index a392d21..19e3697 100644 --- a/internal/handlers/product/details.go +++ b/internal/handlers/product/details.go @@ -2,11 +2,12 @@ package product import ( "encoding/json" - "golang-rest-api-template/internal/handlers/product/model" - "golang-rest-api-template/internal/response" "net/http" "strconv" + "github.com/MitulShah1/golang-rest-api-template/internal/handlers/product/model" + "github.com/MitulShah1/golang-rest-api-template/internal/response" + "github.com/gorilla/mux" ) diff --git a/internal/handlers/product/details_test.go b/internal/handlers/product/details_test.go index 5e16ec8..34277d2 100644 --- a/internal/handlers/product/details_test.go +++ b/internal/handlers/product/details_test.go @@ -7,8 +7,8 @@ import ( "net/http/httptest" "testing" - "golang-rest-api-template/internal/handlers/product/model" - "golang-rest-api-template/package/logger" + "github.com/MitulShah1/golang-rest-api-template/internal/handlers/product/model" + "github.com/MitulShah1/golang-rest-api-template/package/logger" "github.com/gorilla/mux" "github.com/stretchr/testify/assert" diff --git a/internal/handlers/product/update.go b/internal/handlers/product/update.go index 0efa29b..b7a1b9b 100644 --- a/internal/handlers/product/update.go +++ b/internal/handlers/product/update.go @@ -2,13 +2,14 @@ package product import ( "encoding/json" - "golang-rest-api-template/internal/handlers/product/model" - "golang-rest-api-template/internal/response" - "golang-rest-api-template/package/validation" "io" "net/http" "strconv" + "github.com/MitulShah1/golang-rest-api-template/internal/handlers/product/model" + "github.com/MitulShah1/golang-rest-api-template/internal/response" + "github.com/MitulShah1/golang-rest-api-template/package/validation" + "github.com/gorilla/mux" ) diff --git a/internal/handlers/product/update_test.go b/internal/handlers/product/update_test.go index 8e5155d..9596e5b 100644 --- a/internal/handlers/product/update_test.go +++ b/internal/handlers/product/update_test.go @@ -8,8 +8,8 @@ import ( "net/http/httptest" "testing" - "golang-rest-api-template/internal/handlers/product/model" - "golang-rest-api-template/package/logger" + "github.com/MitulShah1/golang-rest-api-template/internal/handlers/product/model" + "github.com/MitulShah1/golang-rest-api-template/package/logger" "github.com/gorilla/mux" "github.com/stretchr/testify/assert" diff --git a/internal/handlers/server.go b/internal/handlers/server.go index b436323..24c0b66 100644 --- a/internal/handlers/server.go +++ b/internal/handlers/server.go @@ -2,19 +2,20 @@ package handlers import ( "context" - "golang-rest-api-template/internal/handlers/health" - prodApi "golang-rest-api-template/internal/handlers/product" - "golang-rest-api-template/internal/repository" - "golang-rest-api-template/internal/services/category" - "golang-rest-api-template/internal/services/product" - "golang-rest-api-template/package/database" - "golang-rest-api-template/package/logger" - "golang-rest-api-template/package/middleware" "net" "net/http" - _ "golang-rest-api-template/docs" - catApi "golang-rest-api-template/internal/handlers/category" + "github.com/MitulShah1/golang-rest-api-template/internal/handlers/health" + prodApi "github.com/MitulShah1/golang-rest-api-template/internal/handlers/product" + "github.com/MitulShah1/golang-rest-api-template/internal/repository" + "github.com/MitulShah1/golang-rest-api-template/internal/services/category" + "github.com/MitulShah1/golang-rest-api-template/internal/services/product" + "github.com/MitulShah1/golang-rest-api-template/package/database" + "github.com/MitulShah1/golang-rest-api-template/package/logger" + "github.com/MitulShah1/golang-rest-api-template/package/middleware" + + _ "github.com/MitulShah1/golang-rest-api-template/docs" + catApi "github.com/MitulShah1/golang-rest-api-template/internal/handlers/category" "github.com/gorilla/mux" httpSwagger "github.com/swaggo/http-swagger/v2" diff --git a/internal/repository/category_repo.go b/internal/repository/category_repo.go index b855eb7..ce7761f 100644 --- a/internal/repository/category_repo.go +++ b/internal/repository/category_repo.go @@ -3,7 +3,8 @@ package repository import ( "context" "database/sql" - "golang-rest-api-template/internal/repository/model" + + "github.com/MitulShah1/golang-rest-api-template/internal/repository/model" "github.com/Masterminds/squirrel" ) diff --git a/internal/repository/category_repo_test.go b/internal/repository/category_repo_test.go index bbbf0a7..d52266f 100644 --- a/internal/repository/category_repo_test.go +++ b/internal/repository/category_repo_test.go @@ -7,9 +7,9 @@ import ( "testing" "time" - "golang-rest-api-template/internal/repository/model" - "golang-rest-api-template/package/database" - "golang-rest-api-template/package/database/mocks" + "github.com/MitulShah1/golang-rest-api-template/internal/repository/model" + "github.com/MitulShah1/golang-rest-api-template/package/database" + "github.com/MitulShah1/golang-rest-api-template/package/database/mocks" "github.com/DATA-DOG/go-sqlmock" "github.com/stretchr/testify/assert" diff --git a/internal/repository/product_repo.go b/internal/repository/product_repo.go index 40591aa..6135387 100644 --- a/internal/repository/product_repo.go +++ b/internal/repository/product_repo.go @@ -4,7 +4,8 @@ import ( "context" "database/sql" "fmt" - "golang-rest-api-template/internal/repository/model" + + "github.com/MitulShah1/golang-rest-api-template/internal/repository/model" "github.com/Masterminds/squirrel" ) diff --git a/internal/repository/product_repo_test.go b/internal/repository/product_repo_test.go index ebafa2c..bdc8416 100644 --- a/internal/repository/product_repo_test.go +++ b/internal/repository/product_repo_test.go @@ -6,10 +6,10 @@ import ( "errors" "testing" - "golang-rest-api-template/internal/repository/model" - "golang-rest-api-template/package/database" + "github.com/MitulShah1/golang-rest-api-template/internal/repository/model" + "github.com/MitulShah1/golang-rest-api-template/package/database" - "golang-rest-api-template/package/database/mocks" + "github.com/MitulShah1/golang-rest-api-template/package/database/mocks" "github.com/DATA-DOG/go-sqlmock" "github.com/stretchr/testify/assert" diff --git a/internal/repository/repo.go b/internal/repository/repo.go index 861ee82..1e3ffa4 100644 --- a/internal/repository/repo.go +++ b/internal/repository/repo.go @@ -1,6 +1,6 @@ package repository -import "golang-rest-api-template/package/database" +import "github.com/MitulShah1/golang-rest-api-template/package/database" type DBRepository interface { // Product Repository diff --git a/internal/response/reponse.go b/internal/response/reponse.go index 5bdba29..baf7bf3 100644 --- a/internal/response/reponse.go +++ b/internal/response/reponse.go @@ -3,7 +3,7 @@ package response import ( "net/http" - "golang-rest-api-template/package/logger" + "github.com/MitulShah1/golang-rest-api-template/package/logger" ) func sendResponse(w http.ResponseWriter, status int, resp []byte, contentType string) { diff --git a/internal/services/category/mocks/CategoryServiceInterface.go b/internal/services/category/mocks/CategoryServiceInterface.go index 8d21fa7..69815c8 100644 --- a/internal/services/category/mocks/CategoryServiceInterface.go +++ b/internal/services/category/mocks/CategoryServiceInterface.go @@ -4,11 +4,11 @@ package mocks import ( context "context" - model "golang-rest-api-template/internal/handlers/category/model" + model "github.com/MitulShah1/golang-rest-api-template/internal/handlers/category/model" mock "github.com/stretchr/testify/mock" - repositorymodel "golang-rest-api-template/internal/repository/model" + repositorymodel "github.com/MitulShah1/golang-rest-api-template/internal/repository/model" ) // CategoryServiceInterface is an autogenerated mock type for the CategoryServiceInterface type diff --git a/internal/services/category/service.go b/internal/services/category/service.go index 238d61f..4ede6ce 100644 --- a/internal/services/category/service.go +++ b/internal/services/category/service.go @@ -2,10 +2,11 @@ package category import ( "context" - "golang-rest-api-template/internal/handlers/category/model" - "golang-rest-api-template/internal/repository" - sqlModel "golang-rest-api-template/internal/repository/model" - "golang-rest-api-template/package/logger" + + "github.com/MitulShah1/golang-rest-api-template/internal/handlers/category/model" + "github.com/MitulShah1/golang-rest-api-template/internal/repository" + sqlModel "github.com/MitulShah1/golang-rest-api-template/internal/repository/model" + "github.com/MitulShah1/golang-rest-api-template/package/logger" ) type CategoryServiceInterface interface { diff --git a/internal/services/category/service_test.go b/internal/services/category/service_test.go index 7ffa3a2..70af4df 100644 --- a/internal/services/category/service_test.go +++ b/internal/services/category/service_test.go @@ -7,9 +7,9 @@ import ( "github.com/stretchr/testify/assert" - "golang-rest-api-template/internal/handlers/category/model" - sqlModel "golang-rest-api-template/internal/repository/model" - "golang-rest-api-template/internal/services/category/mocks" + "github.com/MitulShah1/golang-rest-api-template/internal/handlers/category/model" + sqlModel "github.com/MitulShah1/golang-rest-api-template/internal/repository/model" + "github.com/MitulShah1/golang-rest-api-template/internal/services/category/mocks" ) var mockRepo = new(mocks.CategoryServiceInterface) diff --git a/internal/services/product/mocks/ProductServiceInterface.go b/internal/services/product/mocks/ProductServiceInterface.go index a9f7bc6..e4717ce 100644 --- a/internal/services/product/mocks/ProductServiceInterface.go +++ b/internal/services/product/mocks/ProductServiceInterface.go @@ -4,8 +4,8 @@ package mocks import ( context "context" - model "golang-rest-api-template/internal/handlers/product/model" + model "github.com/MitulShah1/golang-rest-api-template/internal/handlers/product/model" mock "github.com/stretchr/testify/mock" ) diff --git a/internal/services/product/service.go b/internal/services/product/service.go index 820827f..ddc1f09 100644 --- a/internal/services/product/service.go +++ b/internal/services/product/service.go @@ -2,10 +2,11 @@ package product import ( "context" - "golang-rest-api-template/internal/handlers/product/model" - "golang-rest-api-template/internal/repository" - sqlModel "golang-rest-api-template/internal/repository/model" - "golang-rest-api-template/package/logger" + + "github.com/MitulShah1/golang-rest-api-template/internal/handlers/product/model" + "github.com/MitulShah1/golang-rest-api-template/internal/repository" + sqlModel "github.com/MitulShah1/golang-rest-api-template/internal/repository/model" + "github.com/MitulShah1/golang-rest-api-template/package/logger" ) type ProductServiceInterface interface { diff --git a/internal/services/product/service_test.go b/internal/services/product/service_test.go index 201d1e7..76bfe4c 100644 --- a/internal/services/product/service_test.go +++ b/internal/services/product/service_test.go @@ -7,8 +7,8 @@ import ( "github.com/stretchr/testify/assert" - "golang-rest-api-template/internal/handlers/product/model" - "golang-rest-api-template/internal/services/product/mocks" + "github.com/MitulShah1/golang-rest-api-template/internal/handlers/product/model" + "github.com/MitulShah1/golang-rest-api-template/internal/services/product/mocks" ) var mockService = new(mocks.ProductServiceInterface) diff --git a/package/database/database_test.go b/package/database/database_test.go index 2757141..bfcebc6 100644 --- a/package/database/database_test.go +++ b/package/database/database_test.go @@ -4,7 +4,7 @@ import ( "errors" "testing" - "golang-rest-api-template/package/database/mocks" + "github.com/MitulShah1/golang-rest-api-template/package/database/mocks" "github.com/DATA-DOG/go-sqlmock" "github.com/stretchr/testify/assert" diff --git a/package/middleware/basic_auth.go b/package/middleware/basic_auth.go index ffea3a5..cd35747 100644 --- a/package/middleware/basic_auth.go +++ b/package/middleware/basic_auth.go @@ -3,9 +3,10 @@ package middleware import ( "encoding/base64" "encoding/json" - "golang-rest-api-template/internal/response" "net/http" "strings" + + "github.com/MitulShah1/golang-rest-api-template/internal/response" ) // AuthMiddleware is a simple Basic Authentication middleware