From de20da1e6c4b9bd9c05c113da672a6449238d324 Mon Sep 17 00:00:00 2001 From: genesisblock3301 Date: Sun, 17 Mar 2024 10:52:41 +0600 Subject: [PATCH] refactoring code base --- backend/configurations/db/config.go | 2 +- backend/controllers/role_controller.go | 4 +- backend/controllers/user_controller.go | 23 +-- backend/middlewares/auth-middleware.go | 2 +- backend/routes/roles_router.go | 4 +- backend/routes/user_router.go | 7 +- backend/services/jwt_service.go | 17 --- backend/services/mail_service.go | 4 +- backend/services/role_service.go | 6 +- backend/services/user_service.go | 10 +- backend/utils/auth_helper.go | 8 +- docs/docs.go | 122 ++++++++-------- docs/swagger.json | 122 ++++++++-------- docs/swagger.yaml | 82 +++++------ go.mod | 62 -------- go.sum | 189 ------------------------- main.go | 15 +- 17 files changed, 207 insertions(+), 472 deletions(-) delete mode 100644 go.mod delete mode 100644 go.sum diff --git a/backend/configurations/db/config.go b/backend/configurations/db/config.go index 9477338..40a0ca0 100644 --- a/backend/configurations/db/config.go +++ b/backend/configurations/db/config.go @@ -2,7 +2,7 @@ package db import ( "fmt" - "github.com/GenesisBlock3301/role_based_access_boilerplate_go/backend/configurations" + "github.com/go_user_role/backend/configurations" "gorm.io/driver/postgres" "gorm.io/gorm" ) diff --git a/backend/controllers/role_controller.go b/backend/controllers/role_controller.go index ffbd893..127ba57 100644 --- a/backend/controllers/role_controller.go +++ b/backend/controllers/role_controller.go @@ -1,9 +1,9 @@ package controllers import ( - "github.com/GenesisBlock3301/role_based_access_boilerplate_go/backend/serializers" - "github.com/GenesisBlock3301/role_based_access_boilerplate_go/backend/services" "github.com/gin-gonic/gin" + "github.com/go_user_role/backend/serializers" + "github.com/go_user_role/backend/services" "net/http" ) diff --git a/backend/controllers/user_controller.go b/backend/controllers/user_controller.go index b3f7b13..962df0e 100644 --- a/backend/controllers/user_controller.go +++ b/backend/controllers/user_controller.go @@ -1,14 +1,15 @@ package controllers import ( - "github.com/GenesisBlock3301/role_based_access_boilerplate_go/backend/configurations" - "github.com/GenesisBlock3301/role_based_access_boilerplate_go/backend/serializers" - "github.com/GenesisBlock3301/role_based_access_boilerplate_go/backend/services" - "github.com/GenesisBlock3301/role_based_access_boilerplate_go/backend/utils" - "github.com/GenesisBlock3301/role_based_access_boilerplate_go/backend/validations" "github.com/diebietse/gotp/v2" + _ "github.com/diebietse/gotp/v2" "github.com/gin-gonic/gin" "github.com/go-playground/validator/v10" + "github.com/go_user_role/backend/configurations" + "github.com/go_user_role/backend/serializers" + "github.com/go_user_role/backend/services" + "github.com/go_user_role/backend/utils" + "github.com/go_user_role/backend/validations" "net/http" "time" ) @@ -33,7 +34,7 @@ func NewUserController(service services.UserService) *UserController { // @Produce json // @Success 200 {string} successfully login // @failure 400 {string} string "error" -// @Router /create [post] +// @Router /user/create [post] func (u *UserController) CreateUserController(ctx *gin.Context) { var userInput serializers.RegisterSerializer // Validate UserInput @@ -66,7 +67,7 @@ func (u *UserController) CreateUserController(ctx *gin.Context) { // @Produce json // @Success 200 {string} successfully login. // @failure 400 {string} string "error" -// @Router /login [post] +// @Router /user/login [post] func (u *UserController) LoginController(ctx *gin.Context) { var user serializers.User if err := ctx.ShouldBindJSON(&user); err != nil { @@ -101,7 +102,7 @@ func (u *UserController) LoginController(ctx *gin.Context) { // @Accept json // @Produce json // @Success 200 {string} get user successfully. -// @Router / [get] +// @Router /user [get] func (u *UserController) GetCurrentUserController(ctx *gin.Context) { userId, err := services.ExtractTokenID(ctx) if err != nil { @@ -130,7 +131,7 @@ func (u *UserController) GetCurrentUserController(ctx *gin.Context) { // @Accept json // @Produce json // @Success 200 {string} successfully verify email. -// @Router /email-verify/ [get] +// @Router /user/email-verify [get] func (u *UserController) VerifyEmailController(ctx *gin.Context) { token := ctx.Query("token") @@ -153,7 +154,7 @@ func (u *UserController) VerifyEmailController(ctx *gin.Context) { // @Accept json // @Produce json // @Success 200 {string} successfully generate OTP -// @Router /generate-otp/ [get] +// @Router /user/generate-otp [get] func (u *UserController) GenerateOTP(ctx *gin.Context) { var UserLogin serializers.LoginSerializer // Validate UserInput @@ -186,7 +187,7 @@ func (u *UserController) GenerateOTP(ctx *gin.Context) { // @Accept json // @Produce json // @Success 200 {string} sent verify init. -// @Router /verify-otp/ [get] +// @Router /user/verify-otp [get] func (u *UserController) VerifyOTP(ctx *gin.Context) { var otp serializers.VerifyOTPSerializer // Validate OTP Input. diff --git a/backend/middlewares/auth-middleware.go b/backend/middlewares/auth-middleware.go index a4577cc..8b2490a 100644 --- a/backend/middlewares/auth-middleware.go +++ b/backend/middlewares/auth-middleware.go @@ -1,8 +1,8 @@ package middlewares import ( - "github.com/GenesisBlock3301/role_based_access_boilerplate_go/backend/services" "github.com/gin-gonic/gin" + "github.com/go_user_role/backend/services" "net/http" "os" ) diff --git a/backend/routes/roles_router.go b/backend/routes/roles_router.go index 5c144af..0a71ec2 100644 --- a/backend/routes/roles_router.go +++ b/backend/routes/roles_router.go @@ -1,9 +1,9 @@ package routes import ( - "github.com/GenesisBlock3301/role_based_access_boilerplate_go/backend/controllers" - "github.com/GenesisBlock3301/role_based_access_boilerplate_go/backend/services" "github.com/gin-gonic/gin" + "github.com/go_user_role/backend/controllers" + "github.com/go_user_role/backend/services" ) func RoleRouter(roleRouter *gin.RouterGroup) { diff --git a/backend/routes/user_router.go b/backend/routes/user_router.go index 913ab87..4ad21c7 100644 --- a/backend/routes/user_router.go +++ b/backend/routes/user_router.go @@ -1,16 +1,15 @@ package routes import ( - "github.com/GenesisBlock3301/role_based_access_boilerplate_go/backend/controllers" - "github.com/GenesisBlock3301/role_based_access_boilerplate_go/backend/middlewares" - "github.com/GenesisBlock3301/role_based_access_boilerplate_go/backend/services" "github.com/gin-gonic/gin" + "github.com/go_user_role/backend/controllers" + "github.com/go_user_role/backend/services" ) func UserRouter(userRouter *gin.RouterGroup) { userService := &services.UserService{} userController := controllers.NewUserController(*userService) - userRouter.GET("/", middlewares.JWTAuthMiddleware(), userController.GetCurrentUserController) + userRouter.GET("/", userController.GetCurrentUserController) userRouter.POST("/create/", userController.CreateUserController) userRouter.GET("/email-verify/", userController.VerifyEmailController) userRouter.POST("/login", userController.LoginController) diff --git a/backend/services/jwt_service.go b/backend/services/jwt_service.go index 14b2cf0..14dddec 100644 --- a/backend/services/jwt_service.go +++ b/backend/services/jwt_service.go @@ -85,23 +85,6 @@ func ExtractTokenID(c *gin.Context) (uint, error) { } return []byte("secret_no_sifat"), nil }) - //if err != nil { - // if ve, ok := err.(*jwt.ValidationError); ok { - // if ve.Errors&jwt.ValidationErrorExpired != 0 { - // // Token has expired - // fmt.Println("Token has expired") - // } - // } else { - // // Other validation error occurred - // fmt.Println("Error validating token:", err) - // } - //} else if token.Valid { - // // Token is valid - // fmt.Println("Token is valid") - //} else { - // // Token is not valid for some other reason - // fmt.Println("Token is not valid") - //} if err != nil { return 0, err } diff --git a/backend/services/mail_service.go b/backend/services/mail_service.go index 6114408..5f776b7 100644 --- a/backend/services/mail_service.go +++ b/backend/services/mail_service.go @@ -1,8 +1,8 @@ package services import ( - "github.com/GenesisBlock3301/role_based_access_boilerplate_go/backend/configurations" - "github.com/GenesisBlock3301/role_based_access_boilerplate_go/backend/serializers" + "github.com/go_user_role/backend/configurations" + "github.com/go_user_role/backend/serializers" "net/smtp" "os" ) diff --git a/backend/services/role_service.go b/backend/services/role_service.go index 2ec8c55..1cc9e88 100644 --- a/backend/services/role_service.go +++ b/backend/services/role_service.go @@ -2,9 +2,9 @@ package services import ( "errors" - "github.com/GenesisBlock3301/role_based_access_boilerplate_go/backend/configurations/db" - "github.com/GenesisBlock3301/role_based_access_boilerplate_go/backend/schemas" - "github.com/GenesisBlock3301/role_based_access_boilerplate_go/backend/serializers" + "github.com/go_user_role/backend/configurations/db" + "github.com/go_user_role/backend/schemas" + "github.com/go_user_role/backend/serializers" "log" "strconv" ) diff --git a/backend/services/user_service.go b/backend/services/user_service.go index 70ea193..793c358 100644 --- a/backend/services/user_service.go +++ b/backend/services/user_service.go @@ -2,12 +2,12 @@ package services import ( "errors" - "github.com/GenesisBlock3301/role_based_access_boilerplate_go/backend/configurations" - "github.com/GenesisBlock3301/role_based_access_boilerplate_go/backend/configurations/db" - "github.com/GenesisBlock3301/role_based_access_boilerplate_go/backend/schemas" - "github.com/GenesisBlock3301/role_based_access_boilerplate_go/backend/serializers" - "github.com/GenesisBlock3301/role_based_access_boilerplate_go/backend/utils" "github.com/dgrijalva/jwt-go" + "github.com/go_user_role/backend/configurations" + "github.com/go_user_role/backend/configurations/db" + "github.com/go_user_role/backend/schemas" + "github.com/go_user_role/backend/serializers" + "github.com/go_user_role/backend/utils" ) type IUserServiceInterface interface { diff --git a/backend/utils/auth_helper.go b/backend/utils/auth_helper.go index 8052f89..7320e70 100644 --- a/backend/utils/auth_helper.go +++ b/backend/utils/auth_helper.go @@ -2,11 +2,11 @@ package utils import ( "errors" - "github.com/GenesisBlock3301/role_based_access_boilerplate_go/backend/configurations" - "github.com/GenesisBlock3301/role_based_access_boilerplate_go/backend/configurations/db" - "github.com/GenesisBlock3301/role_based_access_boilerplate_go/backend/schemas" - "github.com/GenesisBlock3301/role_based_access_boilerplate_go/backend/serializers" "github.com/dgrijalva/jwt-go" + "github.com/go_user_role/backend/configurations" + "github.com/go_user_role/backend/configurations/db" + "github.com/go_user_role/backend/schemas" + "github.com/go_user_role/backend/serializers" "golang.org/x/crypto/bcrypt" ) diff --git a/docs/docs.go b/docs/docs.go index c9673b4..94b00a0 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -24,7 +24,62 @@ const docTemplate = `{ "host": "{{.Host}}", "basePath": "{{.BasePath}}", "paths": { - "/": { + "/role/create": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Role" + ], + "summary": "Create Role.", + "parameters": [ + { + "description": "Role Info", + "name": "role", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/serializers.Role" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + } + } + }, + "/role/list": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Role" + ], + "summary": "GET roles.", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + } + } + }, + "/user": { "get": { "description": "do ping", "consumes": [ @@ -47,7 +102,7 @@ const docTemplate = `{ } } }, - "/create": { + "/user/create": { "post": { "description": "User Registration", "consumes": [ @@ -87,7 +142,7 @@ const docTemplate = `{ } } }, - "/email-verify/": { + "/user/email-verify": { "get": { "consumes": [ "application/json" @@ -119,7 +174,7 @@ const docTemplate = `{ } } }, - "/generate-otp/": { + "/user/generate-otp": { "get": { "consumes": [ "application/json" @@ -152,7 +207,7 @@ const docTemplate = `{ } } }, - "/login": { + "/user/login": { "post": { "description": "User login", "consumes": [ @@ -192,62 +247,7 @@ const docTemplate = `{ } } }, - "/role/create": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Role" - ], - "summary": "Create Role.", - "parameters": [ - { - "description": "Role Info", - "name": "role", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/serializers.Role" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "string" - } - } - } - } - }, - "/role/list": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Role" - ], - "summary": "GET roles.", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "string" - } - } - } - } - }, - "/verify-otp/": { + "/user/verify-otp": { "get": { "consumes": [ "application/json" diff --git a/docs/swagger.json b/docs/swagger.json index a18c865..109ae10 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -18,7 +18,62 @@ "host": "localhost:8080", "basePath": "/api/v1", "paths": { - "/": { + "/role/create": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Role" + ], + "summary": "Create Role.", + "parameters": [ + { + "description": "Role Info", + "name": "role", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/serializers.Role" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + } + } + }, + "/role/list": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Role" + ], + "summary": "GET roles.", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + } + } + }, + "/user": { "get": { "description": "do ping", "consumes": [ @@ -41,7 +96,7 @@ } } }, - "/create": { + "/user/create": { "post": { "description": "User Registration", "consumes": [ @@ -81,7 +136,7 @@ } } }, - "/email-verify/": { + "/user/email-verify": { "get": { "consumes": [ "application/json" @@ -113,7 +168,7 @@ } } }, - "/generate-otp/": { + "/user/generate-otp": { "get": { "consumes": [ "application/json" @@ -146,7 +201,7 @@ } } }, - "/login": { + "/user/login": { "post": { "description": "User login", "consumes": [ @@ -186,62 +241,7 @@ } } }, - "/role/create": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Role" - ], - "summary": "Create Role.", - "parameters": [ - { - "description": "Role Info", - "name": "role", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/serializers.Role" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "string" - } - } - } - } - }, - "/role/list": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Role" - ], - "summary": "GET roles.", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "string" - } - } - } - } - }, - "/verify-otp/": { + "/user/verify-otp": { "get": { "consumes": [ "application/json" diff --git a/docs/swagger.yaml b/docs/swagger.yaml index f48f745..97d3f27 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -47,7 +47,42 @@ info: title: Role Based Authentication API version: "1.0" paths: - /: + /role/create: + post: + consumes: + - application/json + parameters: + - description: Role Info + in: body + name: role + required: true + schema: + $ref: '#/definitions/serializers.Role' + produces: + - application/json + responses: + "200": + description: OK + schema: + type: string + summary: Create Role. + tags: + - Role + /role/list: + get: + consumes: + - application/json + produces: + - application/json + responses: + "200": + description: OK + schema: + type: string + summary: GET roles. + tags: + - Role + /user: get: consumes: - application/json @@ -62,7 +97,7 @@ paths: summary: Get authenticated user. tags: - User - /create: + /user/create: post: consumes: - application/json @@ -88,7 +123,7 @@ paths: summary: Register User. tags: - User - /email-verify/: + /user/email-verify: get: consumes: - application/json @@ -109,7 +144,7 @@ paths: summary: Verify email controller. tags: - User - /generate-otp/: + /user/generate-otp: get: consumes: - application/json @@ -130,7 +165,7 @@ paths: summary: Generate OTP. tags: - User - /login: + /user/login: post: consumes: - application/json @@ -156,42 +191,7 @@ paths: summary: Login user. tags: - User - /role/create: - post: - consumes: - - application/json - parameters: - - description: Role Info - in: body - name: role - required: true - schema: - $ref: '#/definitions/serializers.Role' - produces: - - application/json - responses: - "200": - description: OK - schema: - type: string - summary: Create Role. - tags: - - Role - /role/list: - get: - consumes: - - application/json - produces: - - application/json - responses: - "200": - description: OK - schema: - type: string - summary: GET roles. - tags: - - Role - /verify-otp/: + /user/verify-otp: get: consumes: - application/json diff --git a/go.mod b/go.mod deleted file mode 100644 index 6bc28de..0000000 --- a/go.mod +++ /dev/null @@ -1,62 +0,0 @@ -module github.com/GenesisBlock3301/role_based_access_boilerplate_go - -go 1.21.3 - -require ( - gorm.io/driver/postgres v1.5.7 - gorm.io/gorm v1.25.7-0.20240204074919-46816ad31dde -) - -require ( - github.com/dgrijalva/jwt-go v3.2.0+incompatible - github.com/diebietse/gotp/v2 v2.0.4 - github.com/gin-gonic/gin v1.9.1 - github.com/go-playground/validator/v10 v10.19.0 - github.com/joho/godotenv v1.5.1 - github.com/swaggo/files v1.0.1 - github.com/swaggo/gin-swagger v1.6.0 - github.com/swaggo/swag v1.16.3 - golang.org/x/crypto v0.21.0 -) - -require ( - github.com/KyleBanks/depth v1.2.1 // indirect - github.com/PuerkitoBio/purell v1.1.1 // indirect - github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect - github.com/bytedance/sonic v1.9.1 // indirect - github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect - github.com/gabriel-vasile/mimetype v1.4.3 // indirect - github.com/gin-contrib/sse v0.1.0 // indirect - github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/jsonreference v0.19.6 // indirect - github.com/go-openapi/spec v0.20.4 // indirect - github.com/go-openapi/swag v0.19.15 // indirect - github.com/go-playground/locales v0.14.1 // indirect - github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/goccy/go-json v0.10.2 // indirect - github.com/jackc/pgpassfile v1.0.0 // indirect - github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect - github.com/jackc/pgx/v5 v5.4.3 // indirect - github.com/jinzhu/inflection v1.0.0 // indirect - github.com/jinzhu/now v1.1.5 // indirect - github.com/josharian/intern v1.0.0 // indirect - github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/cpuid/v2 v2.2.4 // indirect - github.com/leodido/go-urn v1.4.0 // indirect - github.com/mailru/easyjson v0.7.6 // indirect - github.com/mattn/go-isatty v0.0.19 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/pelletier/go-toml/v2 v2.0.8 // indirect - github.com/rogpeppe/go-internal v1.12.0 // indirect - github.com/twitchyliquid64/golang-asm v0.15.1 // indirect - github.com/ugorji/go/codec v1.2.11 // indirect - golang.org/x/arch v0.3.0 // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/text v0.14.0 // indirect - golang.org/x/tools v0.7.0 // indirect - google.golang.org/protobuf v1.30.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect -) diff --git a/go.sum b/go.sum deleted file mode 100644 index 2560780..0000000 --- a/go.sum +++ /dev/null @@ -1,189 +0,0 @@ -github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= -github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= -github.com/bytedance/sonic v1.9.1 h1:6iJ6NqdoxCDr6mbY8h18oSO+cShGSMRGCEo7F2h0x8s= -github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= -github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= -github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= -github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -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/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/diebietse/gotp/v2 v2.0.4 h1:kdTQ6+ANmZIUhbASLzYQYYHm3qgC4vqMcK+JZc0ObrU= -github.com/diebietse/gotp/v2 v2.0.4/go.mod h1:3YD3f/0Zeie1rOL52+BNxsr/I8lNvZVapaVc8JJgIMQ= -github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= -github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= -github.com/gin-contrib/gzip v0.0.6 h1:NjcunTcGAj5CO1gn4N8jHOSIeRFHIbn51z6K+xaN4d4= -github.com/gin-contrib/gzip v0.0.6/go.mod h1:QOJlmV2xmayAjkNS2Y8NQsMneuRShOU/kjovCXNuzzk= -github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= -github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= -github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.19.6 h1:UBIxjkht+AWIgYzCDSv2GN+E/togfwXUJFRTWhl2Jjs= -github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= -github.com/go-openapi/spec v0.20.4 h1:O8hJrt0UMnhHcluhIdUgCLRWyM2x7QkBXRvOs7m+O1M= -github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.15 h1:D2NRCBzS9/pEY3gP9Nl8aDqGUcPFrwG2p+CNFrLyrCM= -github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= -github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= -github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= -github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= -github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.19.0 h1:ol+5Fu+cSq9JD7SoSqe04GMI92cbn0+wvQ3bZ8b/AU4= -github.com/go-playground/validator/v10 v10.19.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= -github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= -github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= -github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= -github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= -github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= -github.com/jackc/pgx/v5 v5.4.3 h1:cxFyXhxlvAifxnkKKdlxv8XqUf59tDlYjnV5YYfsJJY= -github.com/jackc/pgx/v5 v5.4.3/go.mod h1:Ig06C2Vu0t5qXC60W8sqIthScaEnFvojjj9dSljmHRA= -github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= -github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= -github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= -github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= -github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= -github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= -github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= -github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= -github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= -github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= -github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= -github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= -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/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= -github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/swaggo/files v1.0.1 h1:J1bVJ4XHZNq0I46UU90611i9/YzdrF7x92oX1ig5IdE= -github.com/swaggo/files v1.0.1/go.mod h1:0qXmMNH6sXNf+73t65aKeB+ApmgxdnkQzVTAj2uaMUg= -github.com/swaggo/gin-swagger v1.6.0 h1:y8sxvQ3E20/RCyrXeFfg60r6H0Z+SwpTjMYsMm+zy8M= -github.com/swaggo/gin-swagger v1.6.0/go.mod h1:BG00cCEy294xtVpyIAHG6+e2Qzj/xKlRdOqDkvq0uzo= -github.com/swaggo/swag v1.16.3 h1:PnCYjPCah8FK4I26l2F/KQ4yz3sILcVUN3cTlBFA9Pg= -github.com/swaggo/swag v1.16.3/go.mod h1:DImHIuOFXKpMFAQjcC7FG4m3Dg4+QuUgUzJmKjI/gRk= -github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= -github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= -github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= -github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k= -golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= -golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= -golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gorm.io/driver/postgres v1.5.7 h1:8ptbNJTDbEmhdr62uReG5BGkdQyeasu/FZHxI0IMGnM= -gorm.io/driver/postgres v1.5.7/go.mod h1:3e019WlBaYI5o5LIdNV+LyxCMNtLOQETBXL2h4chKpA= -gorm.io/gorm v1.25.7-0.20240204074919-46816ad31dde h1:9DShaph9qhkIYw7QF91I/ynrr4cOO2PZra2PFD7Mfeg= -gorm.io/gorm v1.25.7-0.20240204074919-46816ad31dde/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/main.go b/main.go index e1b7791..7ea867b 100644 --- a/main.go +++ b/main.go @@ -2,12 +2,13 @@ package main import ( "fmt" - "github.com/GenesisBlock3301/role_based_access_boilerplate_go/backend/configurations" - "github.com/GenesisBlock3301/role_based_access_boilerplate_go/backend/configurations/db" - "github.com/GenesisBlock3301/role_based_access_boilerplate_go/backend/routes" - "github.com/GenesisBlock3301/role_based_access_boilerplate_go/backend/schemas" - _ "github.com/GenesisBlock3301/role_based_access_boilerplate_go/docs" "github.com/gin-gonic/gin" + "github.com/go_user_role/backend/configurations" + "github.com/go_user_role/backend/configurations/db" + "github.com/go_user_role/backend/middlewares" + "github.com/go_user_role/backend/routes" + "github.com/go_user_role/backend/schemas" + _ "github.com/go_user_role/docs" "github.com/joho/godotenv" "github.com/swaggo/files" // swagger embed files "github.com/swaggo/gin-swagger" // gin-swagger middleware @@ -22,7 +23,7 @@ func init() { func initEnv() { log.Println("Loading env setting....") - err := godotenv.Load() + err := godotenv.Load(".env.local") if err != nil { log.Fatal("No local env file. Using global OS environment variables") } @@ -53,6 +54,8 @@ func main() { // Initialize `gin` router router := gin.Default() + router.Use(middlewares.JWTAuthMiddleware()) + // Create a new custom rate limiter with a limit of 5 request per second per IP //limiter := middlewares.NewCustomRateLimiter(5, time.Second)