usermysql

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 16, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

The package serves as an interface to the player data storage (database, ORM, etc.)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init()

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)

Jump to

Keyboard shortcuts

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