postgres

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Flag added in v0.6.0

type Flag struct{ DB *database.Transaction }

Flag is the implementation of transaction for the flag repository

func (*Flag) Get added in v0.6.0

func (pg *Flag) Get(userID *uuid.UUID) (flag *int64, err error)

func (*Flag) Set added in v0.6.0

func (pg *Flag) Set(userID *uuid.UUID, flag domain.Flag) error

type OTP added in v0.6.0

type OTP struct{ DB *database.Transaction }

OTP is the implementation of transaction for the otp repository

func (*OTP) GetToken added in v0.6.0

func (pg *OTP) GetToken(userID *uuid.UUID) (userName, token *string, err error)

func (*OTP) SetToken added in v0.6.0

func (pg *OTP) SetToken(userID *uuid.UUID, secret *string) (err error)

type PGAuth

type PGAuth struct{ DB *database.Transaction }

PGAuth is the implementation of transaction for the auth repository

func (*PGAuth) AddAttempts

func (pg *PGAuth) AddAttempts(userID *uuid.UUID) (err error)

func (*PGAuth) CreateAccount

func (pg *PGAuth) CreateAccount(input *domain.CreateAccount) (userID *uuid.UUID, err error)

CreateAccount register the user in the database

func (*PGAuth) LoginSteps

func (pg *PGAuth) LoginSteps(email *string) (steps *domain.Steps, err error)

type Session added in v0.6.0

type Session struct{ DB *database.Transaction }

Session is the implementation of transaction for the session repository

func (*Session) Create added in v0.6.0

func (pg *Session) Create(userID *uuid.UUID, clientIP, userAgent *string) (sessionID *uuid.UUID, err error)

Create add session of the user in database

func (*Session) Delete added in v0.6.0

func (pg *Session) Delete(ids ...*uuid.UUID) (err error)

Delete delete session of the user in database

func (*Session) Get added in v0.6.0

func (pg *Session) Get(userID *uuid.UUID) (sessions []*uuid.UUID, err error)

type User added in v0.6.0

type User struct{ DB *database.Transaction }

PGOTP is the implementation of transaction for the user repository

func (*User) AccountExists added in v0.6.0

func (pg *User) AccountExists(email *string) (err error)

AccountExists validate whether an account with the same identifier already exists

func (*User) ChangePassword added in v0.6.0

func (pg *User) ChangePassword(in *domain.ChangePassword) error

func (*User) Disable added in v0.6.0

func (pg *User) Disable(userUUID *uuid.UUID) (err error)

func (*User) GetUser added in v0.6.0

func (pg *User) GetUser(data *domain.User) (err error)

GetUser fetches a user's data from the database

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL