From b9356ae0e147ee62cedebf802510c27175e6128b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20P=C3=A9rez?= Date: Thu, 27 Mar 2025 06:01:02 +0100 Subject: [PATCH] changes in app and pgx --- app/app.go | 12 ++++++++---- db/pgx.go | 3 ++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/app.go b/app/app.go index 9cbfc52..ae7f0ff 100644 --- a/app/app.go +++ b/app/app.go @@ -47,8 +47,9 @@ const ( InvalidEntityID string = "invalid_entity_id" NotImplemented string = "not_implemented" NotPassValidation string = "not_pass_validation" + NotEnoughBalance string = "not_enough_balance" - // User keys + // User keys (DB) UserUsernameKey string = "username_key" UserEmailKey string = "email_key" UsernameAlreadyExists string = "username_already_exists" @@ -56,9 +57,12 @@ const ( EmailAlreadyExists string = "email_already_exists" PhoneNumberKey string = "phone_number_key" PhoneAlreadyExists string = "phone_already_exists" - IncorrectPassword string = "incorrect_password" - ErrorGeneratingToken string = "error_generating_token" - LoggedIn string = "logged_in" + + // Auth + TokenPayload string = "token_payload" + LoggedIn string = "logged_in" + IncorrectPassword string = "incorrect_password" + ErrorGeneratingToken string = "error_generating_token" ) var ( diff --git a/db/pgx.go b/db/pgx.go index f10ad5d..e1a466e 100644 --- a/db/pgx.go +++ b/db/pgx.go @@ -2,11 +2,12 @@ package db import ( "context" + "log/slog" + _ "github.com/jackc/pgconn" _ "github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5/pgxpool" _ "github.com/jackc/pgx/v5/stdlib" - "log/slog" ) func NewPGXPool(dataSource string) *pgxpool.Pool {