Documentation
¶
Index ¶
- Variables
- func CreatePooledConnection(ctx context.Context, uri string) (*pgxpool.Pool, error)
- type Postgres
- func (p Postgres) BeginTx(ctx context.Context) (pgx.Tx, error)
- func (p Postgres) DeleteTokenByHash(ctx context.Context, hash string) error
- func (p Postgres) InsertToken(ctx context.Context, hash string, expiresAt time.Time, metaData []byte) error
- func (p Postgres) InsertUser(ctx context.Context, data models.User, hashedPassword string) (models.User, error)
- func (p Postgres) QueryTokenByHash(ctx context.Context, hash string) (database.Token, error)
- func (p Postgres) QueryUserByEmail(ctx context.Context, email string) (models.User, error)
- func (p Postgres) QueryUserByID(ctx context.Context, id uuid.UUID) (models.User, error)
- func (p Postgres) UpdateUser(ctx context.Context, data models.User) (models.User, error)
- func (p Postgres) UpdateUserPassword(ctx context.Context, userID uuid.UUID, newPassword string, updatedAt time.Time) error
- func (p Postgres) VerifyUserEmail(ctx context.Context, updatedAt time.Time, email string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInternalDBErr = errors.New("an error occurred that was not possible to recover from") ErrNoRowWithIdentifier = errors.New("could not find requested row in database") )
Functions ¶
Types ¶
type Postgres ¶
func NewPostgres ¶
func (Postgres) DeleteTokenByHash ¶
func (Postgres) InsertToken ¶
func (Postgres) InsertUser ¶
func (Postgres) QueryTokenByHash ¶
func (Postgres) QueryUserByEmail ¶
func (Postgres) QueryUserByID ¶
func (Postgres) UpdateUser ¶
func (Postgres) UpdateUserPassword ¶
Click to show internal directories.
Click to hide internal directories.