auth

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: May 20, 2019 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateToken

func CreateToken(SecretKey []byte, issuer string, Uid uint, isAdmin bool) (tokenString string, err error)

func Refresh

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

func Signin

func Signin(r *restful.Request, w *restful.Response)

func Signin(w http.ResponseWriter, r *http.Request) {

func Welcome

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

Types

type Claims

type Claims struct {
	Username string `json:"username"`
	jwt.StandardClaims
}

type Credentials

type Credentials struct {
	Password string `json:"password"`
	Username string `json:"username"`
}

Create a struct that models the structure of a user, both in the request body, and in the DB

Jump to

Keyboard shortcuts

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