global

package
v0.0.0-...-9f95571 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

DB holds database connection

Functions

func ConnectToTestDB

func ConnectToTestDB()

ConnectToTestDB overwrites DB with Test Database

func NewDBContext

func NewDBContext(d time.Duration) (context.Context, context.CancelFunc)

NewDBContext returns a new Context according to app performance

Types

type User

type User struct {
	ID       primitive.ObjectID `bson:"_id"`
	Username string             `bson:"username"`
	Email    string             `bson:"email"`
	Password string             `bson:"password"`
}

User is the default user struct

var NilUser User

NilUser is the nil value for User

func UserFromToken

func UserFromToken(token string) User

UserFromToken returns the User which is authenticated with this Token

func (User) GetToken

func (u User) GetToken() string

GetToken returns the User's JWT

Jump to

Keyboard shortcuts

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