profile

package
v0.0.0-...-2fe0e47 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IUserRepo

type IUserRepo interface {
	GetUser(login string, password string) (*models.UserItem, bool, error)
	GetUserProfileId(login string) (int64, error)
	FindUser(login string) (bool, error)
	CreateUser(login string, password string, name string, birthDate string, email string) error
	GetUserProfile(login string) (*models.UserItem, error)
	EditProfile(prevLogin string, login string, password string, email string, birthDate string, photo string) error
	GetNamesAndPaths(ids []int32) ([]string, []string, error)
	CheckUserPassword(login string, password string) (bool, error)
	GetUserRole(login string) (string, error)
	IsSubscribed(login string) (bool, error)
	ChangeSubsribe(login string, isSubscribed bool) error
	FindUsers(login string, role string, first, limit uint64) ([]models.UserItem, error)
	ChangeUsersRole(login string, role string) error
}

type RepoPostgre

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

func GetUserRepo

func GetUserRepo(config *configs.DbDsnCfg, lg *slog.Logger) (*RepoPostgre, error)

func (*RepoPostgre) ChangeSubsribe

func (repo *RepoPostgre) ChangeSubsribe(login string, isSubscribed bool) error

func (*RepoPostgre) ChangeUsersRole

func (repo *RepoPostgre) ChangeUsersRole(login string, role string) error

func (*RepoPostgre) CheckUserPassword

func (repo *RepoPostgre) CheckUserPassword(login string, password string) (bool, error)

func (*RepoPostgre) CreateUser

func (repo *RepoPostgre) CreateUser(login string, password string, name string, birthDate string, email string) error

func (*RepoPostgre) EditProfile

func (repo *RepoPostgre) EditProfile(prevLogin string, login string, password string, email string, birthDate string, photo string) error

func (*RepoPostgre) FindUser

func (repo *RepoPostgre) FindUser(login string) (bool, error)

func (*RepoPostgre) FindUsers

func (repo *RepoPostgre) FindUsers(login string, role string, first, limit uint64) ([]models.UserItem, error)

func (*RepoPostgre) GetNamesAndPaths

func (repo *RepoPostgre) GetNamesAndPaths(ids []int32) ([]string, []string, error)

func (*RepoPostgre) GetUser

func (repo *RepoPostgre) GetUser(login string, password string) (*models.UserItem, bool, error)

func (*RepoPostgre) GetUserProfile

func (repo *RepoPostgre) GetUserProfile(login string) (*models.UserItem, error)

func (*RepoPostgre) GetUserProfileId

func (repo *RepoPostgre) GetUserProfileId(login string) (int64, error)

func (*RepoPostgre) GetUserRole

func (repo *RepoPostgre) GetUserRole(login string) (string, error)

func (*RepoPostgre) IsSubscribed

func (repo *RepoPostgre) IsSubscribed(login string) (bool, error)

Jump to

Keyboard shortcuts

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