db

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckRefreshToken

func CheckRefreshToken(jti string) bool

CheckRefreshToken : is the refresh token valid?

func DeleteRefreshToken

func DeleteRefreshToken(jti string) error

DeleteRefreshToken : remove refresh token from db

func DeleteUser

func DeleteUser(uuid string)

DeleteUser : remove user

func FetchUserById

func FetchUserById(uuid string) (models.User, error)

FetchUserById : grab a user by their uuid

func FetchUserByUsername

func FetchUserByUsername(username string) (models.User, string, error)

FetchUserByUsername : returns the user and the userId or an error if not found

func InitDB

func InitDB()

InitDB : Build the "db"

func LogUserIn

func LogUserIn(username string, password string) (models.User, string, error)

LogUserIn : log user in with provided credentials

func StoreRefreshToken

func StoreRefreshToken() (jti string, err error)

StoreRefreshToken : create and add refresh token to our db

func StoreUser

func StoreUser(username string, password string, role string) (uuid string, err error)

StoreUser : add user. password is hashed before getting here

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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