user

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

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

Go to latest
Published: Apr 9, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

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

User handles user data

func New

func New() *User

New returns new user data manager

func (User) Add

func (user User) Add(main types.Main, extra types.Extra) (string, string)

Add adds user to database and returns userID

func (User) Auth

func (user User) Auth(username, email, password string) bool

Auth is used to authenticate username, email or password

func (User) GetFromID

func (user User) GetFromID(userID, dataType string) (main types.Main, extra types.Extra, meta types.Meta)

GetFromID gets the user data (either main, meta or extra) based on userID then returns it

func (User) GetUserID

func (user User) GetUserID(username, email string) string

GetUserID returns user's id based on email or username

func (User) UpdateExtra

func (user User) UpdateExtra(userID string, update types.Extra) string

UpdateExtra updates user's extra data

func (User) UpdateMain

func (user User) UpdateMain(userID, username, email string, update types.Main) string

UpdateMain updates user's main data

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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