Documentation ¶
Index ¶
- type CreateUserParams
- type DBTX
- type GetUserByResetTokenRow
- type ListUsersParams
- type Querier
- type Queries
- func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)
- func (q *Queries) DeleteUser(ctx context.Context, id int32) error
- func (q *Queries) GetUser(ctx context.Context, id int32) (User, error)
- func (q *Queries) GetUserByEmail(ctx context.Context, email string) (User, error)
- func (q *Queries) GetUserByResetToken(ctx context.Context, resetToken pgtype.Text) (GetUserByResetTokenRow, error)
- func (q *Queries) ListUsers(ctx context.Context, arg ListUsersParams) ([]User, error)
- func (q *Queries) ResetPassword(ctx context.Context, arg ResetPasswordParams) (User, error)
- func (q *Queries) UpdateResetToken(ctx context.Context, arg UpdateResetTokenParams) error
- func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) (User, error)
- func (q *Queries) VerifyUser(ctx context.Context, email string) error
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type ResetPasswordParams
- type UpdateResetTokenParams
- type UpdateUserParams
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateUserParams ¶
type GetUserByResetTokenRow ¶
type GetUserByResetTokenRow struct { ID int32 `json:"id"` Email string `json:"email"` Username string `json:"username"` PhoneNumber pgtype.Text `json:"phone_number"` Password string `json:"password"` Role string `json:"role"` IsVerified pgtype.Bool `json:"is_verified"` CreatedAt pgtype.Timestamptz `json:"created_at"` }
type ListUsersParams ¶
type Querier ¶
type Querier interface { CreateUser(ctx context.Context, arg CreateUserParams) (User, error) DeleteUser(ctx context.Context, id int32) error GetUser(ctx context.Context, id int32) (User, error) GetUserByEmail(ctx context.Context, email string) (User, error) GetUserByResetToken(ctx context.Context, resetToken pgtype.Text) (GetUserByResetTokenRow, error) ListUsers(ctx context.Context, arg ListUsersParams) ([]User, error) ResetPassword(ctx context.Context, arg ResetPasswordParams) (User, error) UpdateResetToken(ctx context.Context, arg UpdateResetTokenParams) error UpdateUser(ctx context.Context, arg UpdateUserParams) (User, error) VerifyUser(ctx context.Context, email string) error }
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) CreateUser ¶
func (*Queries) GetUserByEmail ¶
func (*Queries) GetUserByResetToken ¶
func (*Queries) ResetPassword ¶
func (*Queries) UpdateResetToken ¶
func (q *Queries) UpdateResetToken(ctx context.Context, arg UpdateResetTokenParams) error
func (*Queries) UpdateUser ¶
type ResetPasswordParams ¶
type UpdateResetTokenParams ¶
type UpdateResetTokenParams struct { ResetToken pgtype.Text `json:"reset_token"` ResetTokenExpiry pgtype.Timestamptz `json:"reset_token_expiry"` Email string `json:"email"` }
type UpdateUserParams ¶
type User ¶
type User struct { ID int32 `json:"id"` Email string `json:"email"` Username string `json:"username"` PhoneNumber pgtype.Text `json:"phone_number"` // hashed password Password string `json:"password"` // role-based access: admin, seller, or buyer Role string `json:"role"` IsVerified pgtype.Bool `json:"is_verified"` CreatedAt pgtype.Timestamptz `json:"created_at"` ResetToken pgtype.Text `json:"reset_token"` ResetTokenExpiry pgtype.Timestamptz `json:"reset_token_expiry"` }
Click to show internal directories.
Click to hide internal directories.