user

package
v0.0.0-...-8bbec6a Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UserStore

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

UserStore ...

func New

func New(db *db.DB) UserStore

New returns a new UserStore

func (UserStore) DeleteUser

func (u UserStore) DeleteUser(id string) error

DeleteUser deletes a user from database.

func (UserStore) GetAllUsers

func (u UserStore) GetAllUsers() ([]entities.User, error)

GetAllUsers lists all users.

func (UserStore) GetUser

func (u UserStore) GetUser(id string) (user entities.User, err error)

GetUser returns a user from its ID.

func (UserStore) Login

func (u UserStore) Login(username, password string) (user entities.User, err error)

Login authenticate a user

func (UserStore) Register

func (u UserStore) Register(user *entities.User) error

Register creates a new user in database

func (UserStore) UpdateUser

func (u UserStore) UpdateUser(id string, userForm *entities.UserForm) (user entities.User, err error)

UpdateUser updates user information.

Jump to

Keyboard shortcuts

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