Documentation ¶
Index ¶
- type PostgresUserStore
- func (p *PostgresUserStore) GetUser(c *gin.Context, user *models.User) (*models.UserAccount, error)
- func (p *PostgresUserStore) GetUserByAccountNumber(c *gin.Context, accountNumber uint64) (*models.UserAccount, error)
- func (p *PostgresUserStore) GetUserByEmail(c *gin.Context, email string) (*models.User, error)
- func (p *PostgresUserStore) InsertUser(c *gin.Context, newUser *models.User) (*models.UserAccount, error)
- func (p *PostgresUserStore) UpdateUser(c *gin.Context, accountNumber int64) (*models.UserAccount, error)
- type UserStorer
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 (*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.
Click to show internal directories.
Click to hide internal directories.