auth

package
v0.0.0-...-a60b5f4 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JwtAuthDriverKey    = "jwt"
	CookieAuthDriverKey = "cookie"
)

Variables

This section is empty.

Functions

func GetCurUser

func GetCurUser(c *gin.Context, key string) map[string]interface{}

func Middleware

func Middleware(authKey string) gin.HandlerFunc

func RegisterGlobalAuthDriver

func RegisterGlobalAuthDriver(authKey string, key string) gin.HandlerFunc

Types

type Auth

type Auth interface {
	Check(c *gin.Context) bool
	User(c *gin.Context) interface{}
	Login(http *http.Request, w http.ResponseWriter, user map[string]interface{}) interface{}
	Logout(http *http.Request, w http.ResponseWriter) bool
}

func GenerateAuthDriver

func GenerateAuthDriver(string string) Auth

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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