api

package
v0.0.0-...-ad3dd47 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2021 License: AGPL-3.0-or-later Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateToken

func GenerateToken(seed string) string

GenerateToken : generate user token based on the seed (eg : email)

func HashPassword

func HashPassword(password string) (string, error)

HashPassword : just bcrypt stuff.

func JwtVerify

func JwtVerify(a *Server) func(http.Handler) http.Handler

JwtVerify : Token verification

Types

type Response

type Response struct {
	HTTPCode int    `example:"403"`
	Content  string `example:"Token invalid."`
}

Response : Used to reply to http query

type Server

type Server struct {
	Router    *mux.Router
	APIRouter *mux.Router
	DB        *gorm.DB
	Conf      *utils.Conf
}

Server : Struct for App (http server) configuration in the config.ini file

func (*Server) Initialize

func (a *Server) Initialize(conf *utils.Conf)

Initialize : Initialize the mux router and the routes

func (*Server) Run

func (a *Server) Run(conf *utils.Conf)

Run : Start the HTTP Server

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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