xgin

package
v0.0.0-...-cbc6a02 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearAllSession

func ClearAllSession(ctx *gin.Context)

func ContextBindQueryWithValid

func ContextBindQueryWithValid(ctx *gin.Context, obj interface{}) (err error)

func ContextBindWithValid

func ContextBindWithValid(ctx *gin.Context, obj interface{}) (err error)

func CorsMiddleware

func CorsMiddleware() gin.HandlerFunc

func GetSession

func GetSession(ctx *gin.Context, k string) interface{}

func HandleNotFound

func HandleNotFound(c *gin.Context)

func LoggerWriter

func LoggerWriter() gin.HandlerFunc

LoggerWithWriter instance a Logger middleware with the specified writter buffer. Example: os.Stdout, a file opened in write mode, a socket...

func New

func New(middleware ...gin.HandlerFunc) *gin.Engine

func NewMemStore

func NewMemStore() sessions.Store

func NewRedisStore

func NewRedisStore(uri string, db int, password string) (sessions.Store, error)

func RecoveryWriter

func RecoveryWriter() gin.HandlerFunc

RecoveryWithWriter returns a middleware for a given writer that recovers from any panics and writes a 500 if there was one.

func SetSession

func SetSession(ctx *gin.Context, k string, o interface{})

func SkipHandler

func SkipHandler(c *gin.Context, skippers ...SkipperFunc) bool

SkipHandler 统一处理跳过函数

func TelephoneValid

func TelephoneValid(phone string) bool

func UseSession

func UseSession(router *gin.Engine, store sessions.Store)

Types

type SkipperFunc

type SkipperFunc func(*gin.Context) bool

SkipperFunc 定义中间件跳过函数

Jump to

Keyboard shortcuts

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