store

package
v0.0.0-...-25768b5 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgresUserStore

type PostgresUserStore struct {
	// contains filtered or unexported fields
}

PostgresUserStore implements UserStorer for PostgreSQL database.

func NewPostgresUserStore

func NewPostgresUserStore(db *sql.DB) *PostgresUserStore

NewPostgresUserStore creates a new instance of PostgresUserStore.

func (*PostgresUserStore) GetUser

func (p *PostgresUserStore) GetUser(c *gin.Context, user *models.User) (*models.UserAccount, error)

GetUser retrieves a user from the database based on email and password.

func (*PostgresUserStore) GetUserByAccountNumber

func (p *PostgresUserStore) GetUserByAccountNumber(c *gin.Context, accountNumber uint64) (*models.UserAccount, error)

func (*PostgresUserStore) GetUserByEmail

func (p *PostgresUserStore) GetUserByEmail(c *gin.Context, email string) (*models.User, error)

func (*PostgresUserStore) InsertUser

func (p *PostgresUserStore) InsertUser(c *gin.Context, newUser *models.User) (*models.UserAccount, error)

InsertUser inserts a new user into the database.

func (*PostgresUserStore) UpdateUser

func (p *PostgresUserStore) UpdateUser(c *gin.Context, accountNumber int64) (*models.UserAccount, error)

UpdateUser updates user details in the PostgreSQL store

type UserStorer

type UserStorer interface {
	InsertUser(*gin.Context, *models.User) (*models.UserAccount, error)
	GetUser(*gin.Context, *models.User) (*models.UserAccount, error)
	GetUserByAccountNumber(*gin.Context, uint64) (*models.UserAccount, error)
	GetUserByEmail(*gin.Context, string) (*models.User, error)
	UpdateUser(*gin.Context, int64) (*models.UserAccount, error)
}

UserStorer defines the interface for user operations.

Jump to

Keyboard shortcuts

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