Documentation ¶
Overview ¶
The package serves as an interface to the player data storage (database, ORM, etc.)
Index ¶
- func Init()
- func SetUserSessionsErrorsHandle(e *usersessions.UserSessionsErrors)
- type UserDataStorage
- func (uds *UserDataStorage) AddUser(un, pwd, email string, errorsList usersessions.ErrorsList) error
- func (uds *UserDataStorage) Authenticate(un, pwd string) (usersessions.LoginSession, error)
- func (uds *UserDataStorage) GetUserId(un string) (int, error)
- func (uds *UserDataStorage) SetUpUserModel(dsn string) (*sql.DB, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetUserSessionsErrorsHandle ¶
func SetUserSessionsErrorsHandle(e *usersessions.UserSessionsErrors)
Types ¶
type UserDataStorage ¶
type UserDataStorage struct {
// contains filtered or unexported fields
}
func GetUserData ¶
func GetUserData() *UserDataStorage
func (*UserDataStorage) AddUser ¶
func (uds *UserDataStorage) AddUser(un, pwd, email string, errorsList usersessions.ErrorsList) error
AddUser() adds a new user entry to the data storage. Returns an error, if one occurs during the entry creation.
func (*UserDataStorage) Authenticate ¶
func (uds *UserDataStorage) Authenticate(un, pwd string) (usersessions.LoginSession, error)
Authenticate() verifies the login details and and returns the user information (on successful verification)
func (*UserDataStorage) GetUserId ¶
func (uds *UserDataStorage) GetUserId(un string) (int, error)
GetUserId() returns the id of a specified user
func (*UserDataStorage) SetUpUserModel ¶
func (uds *UserDataStorage) SetUpUserModel(dsn string) (*sql.DB, error)
Click to show internal directories.
Click to hide internal directories.