middleware

package
v0.0.0-...-4ff501c Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authn

func Authn() gin.HandlerFunc

func Authz

func Authz(a Auther) gin.HandlerFunc

func Cors

func Cors(c *gin.Context)

func NoCache

func NoCache(c *gin.Context)

func RequestID

func RequestID() gin.HandlerFunc

RequestID 是一个 Gin 中间件,在每个 http 请求的 context response 中注入 ID.

func Secure

func Secure(c *gin.Context)

Types

type Auther

type Auther interface {
	Authorize(sub, obj, act string) (bool, error)
}

Jump to

Keyboard shortcuts

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