utils

package
v0.0.0-...-eb64f0e Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2018 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClaimUID = "uid"
)

Variables

This section is empty.

Functions

func ActiveFilter

func ActiveFilter(ctx *context.Context)

ActiveFilter check whether the user is active.

func JWTFilter

func JWTFilter(ctx *context.Context)

JWTFilter check whether the token is valid, and if the token is valid, bind it to the context.

func LoginFilter

func LoginFilter(ctx *context.Context)

LoginFilter check if the user is logged in.

func NewToken

func NewToken(uid int32) (string, string, error)

NewToken generates a JWT token.

func PermissionFilter

func PermissionFilter(ctx *context.Context)

IsPermissionMatch check whether the user permissions match the URL permissions.

Types

This section is empty.

Jump to

Keyboard shortcuts

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