handles

package
v0.0.0-...-7cc17c7 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2020 License: Unlicense Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const COOKIE_NAME = "Eclair-+-Token"
View Source
const SECRET = "Eclair-#&#-Secret"

Variables

This section is empty.

Functions

func CheckJWToken

func CheckJWToken(w http.ResponseWriter, r *http.Request)

CheckJWToken проверяет валидность пользователя

func CreateJWT

func CreateJWT(claims *JWTCustomClaims, expirationTime *time.Time, jwtKey []byte) (string, error)

CreateJWT create new JWT

func SetHandles

func SetHandles()

SetHandles устанавливает все обработчики запросов к Web-серверу, вызывается из main()

Types

type JWTCustomClaims

type JWTCustomClaims struct {
	Login string `json:"login"`
	Role  int    `json:"role"`
	jwt.StandardClaims
}

JWTCustomClaims is a struct Public part of claims.

Jump to

Keyboard shortcuts

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