app

package
v0.0.0-...-e0e81d5 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// BasePath is the path to the project
	BasePath = os.Getenv("GOPATH") + "/src/github.com/kiketordera/basic-login"
)

Functions

This section is empty.

Types

type DB

type DB struct {
	DataBase *bolthold.Store
}

DB is the DataBase which contains the information.

func InitDatabase

func InitDatabase() DB

InitDatabase returns the DataBase of the project or creates a new DataBase if does not exists

func (*DB) Start

func (db *DB) Start(wg *sync.WaitGroup)

Start the web server for a Server object

type Role

type Role string

Role is the close list of different roles that the users can have

const (
	Admin    Role = "admin"
	Manager  Role = "manager"
	Customer Role = "customer"
)

The options for RoleType

type TokenClaims

type TokenClaims struct {
	Username string `json:"usr,omitempty"`
	Role     string `json:"rol,omitempty"`
	jwt.StandardClaims
}

TokenClaims is the token that we store in the cookies

type User

type User struct {
	ID       bson.ObjectId `json:"id"`
	Name     string        `json:"name"`
	Surname  string        `json:"surname"`
	Email    string        `json:"email"`
	Password string        `json:"password"`
	Role     Role          `json:"role"`
}

User is the user of the system

Jump to

Keyboard shortcuts

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