Documentation
¶
Index ¶
- Variables
- type UserCredentials
- func (d *UserCredentials) GetAllIds(ctx context.Context) ([]int, error)
- func (d *UserCredentials) GetSaltAndHash(ctx context.Context, username string) (salt, hash string, err error)
- func (d *UserCredentials) GetUserID(ctx context.Context, username string) (int64, error)
- func (d *UserCredentials) GetUserInfo(ctx context.Context, userId int) (string, string, error)
- func (d *UserCredentials) HasEmailOrUsername(ctx context.Context, username, email string) (bool, error)
- func (d *UserCredentials) ImportGoldenWords(ctx context.Context, userId int) error
- func (d *UserCredentials) ImportGoldenWordsForOld(ctx context.Context) error
- func (d *UserCredentials) InsertUser(ctx context.Context, username, salt, hash, email string) (int, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUserNotFound = fmt.Errorf("user not found")
Functions ¶
This section is empty.
Types ¶
type UserCredentials ¶
type UserCredentials struct {
// contains filtered or unexported fields
}
UserCredentials is a struct that represents database.
func (*UserCredentials) GetAllIds ¶
func (d *UserCredentials) GetAllIds(ctx context.Context) ([]int, error)
func (*UserCredentials) GetSaltAndHash ¶
func (d *UserCredentials) GetSaltAndHash(ctx context.Context, username string) (salt, hash string, err error)
GetSaltAndHash returns salt and hash for the given username.
func (*UserCredentials) GetUserInfo ¶
GetUserInfo returns username, email and error by given userId.
func (*UserCredentials) HasEmailOrUsername ¶
func (d *UserCredentials) HasEmailOrUsername(ctx context.Context, username, email string) (bool, error)
HasEmailOrUsername checks whether a user with the given username or email exists.
func (*UserCredentials) ImportGoldenWords ¶
func (d *UserCredentials) ImportGoldenWords(ctx context.Context, userId int) error
func (*UserCredentials) ImportGoldenWordsForOld ¶
func (d *UserCredentials) ImportGoldenWordsForOld(ctx context.Context) error
func (*UserCredentials) InsertUser ¶
func (d *UserCredentials) InsertUser(ctx context.Context, username, salt, hash, email string) (int, error)
InsertUser inserts a new user into the database.
Click to show internal directories.
Click to hide internal directories.