pguser

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 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 DBUser

type DBUser struct {
	UUID         string `db:"uuid"`
	Email        string `db:"email"`
	NickName     string `db:"nick_name"`
	DisplayName  string `db:"display_name"`
	PasswordHash string `db:"password_hash"`
	IsAdmin      bool   `db:"is_admin"`

	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
}

type Repository

type Repository struct {
	*pgbase.Repository
}

func NewRepository

func NewRepository(pool *pgxpool.Pool) *Repository

func (*Repository) UserAdd

func (r *Repository) UserAdd(u user.User) error

func (*Repository) UserDeleteByUUID

func (r *Repository) UserDeleteByUUID(userUUID string) error

func (*Repository) UserGetAll

func (r *Repository) UserGetAll() ([]user.User, error)

func (*Repository) UserGetByEmail

func (r *Repository) UserGetByEmail(email string) (user.User, error)

func (*Repository) UserGetByNickName

func (r *Repository) UserGetByNickName(nick string) (user.User, error)

func (*Repository) UserGetByUUID

func (r *Repository) UserGetByUUID(userUUID string) (user.User, error)

func (*Repository) UserIsEmailRegistered

func (r *Repository) UserIsEmailRegistered(email string) (bool, error)

func (*Repository) UserIsNickNameRegistered

func (r *Repository) UserIsNickNameRegistered(nick string) (bool, error)

func (*Repository) UserUpdate

func (r *Repository) UserUpdate(u user.User) error

func (*Repository) UserUpdateInfo

func (r *Repository) UserUpdateInfo(info user.InfoUpdate) error

func (*Repository) UserUpdatePasswordHash

func (r *Repository) UserUpdatePasswordHash(passwordHash user.PasswordHashUpdate) error

Jump to

Keyboard shortcuts

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