usermodel

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UserModel

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

Model for User.

func New

func New(ctx context.Context, p *pgxpool.Pool) *UserModel

func (*UserModel) DeleteUser

func (um *UserModel) DeleteUser(id int) error

Delete user from database.

func (*UserModel) GetIdAndPasswordByLogin

func (um *UserModel) GetIdAndPasswordByLogin(ctx context.Context, login string) (int, string, error)

Get Id and password by Login.

func (*UserModel) GetUser

func (um *UserModel) GetUser(id int) (*user.User, error)

Get user info from database.

func (*UserModel) LoginExists

func (um *UserModel) LoginExists(ctx context.Context, login string) (bool, error)

Сheck the existence of the login in the database.

func (*UserModel) SaveUser

func (um *UserModel) SaveUser(ctx context.Context, u *user.User) error

Save the user to the database.

Jump to

Keyboard shortcuts

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