middleware

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MiddlewareList collections.List[IMiddleware]

MiddlewareList 已注册的中间件集合

Functions

func Init

func Init()

func InitMiddleware

func InitMiddleware()

InitMiddleware 初始化管道

func SetNextMiddleware

func SetNextMiddleware(curMiddleware, nextMiddleware IMiddleware)

SetNextMiddleware 设置下一个管道

Types

type ApiResponse

type ApiResponse struct {
	IMiddleware
}

func (*ApiResponse) Invoke

func (receiver *ApiResponse) Invoke(httpContext *context.HttpContext)

type Cors

type Cors struct {
	IMiddleware
}

func (*Cors) Invoke

func (receiver *Cors) Invoke(httpContext *context.HttpContext)

type IMiddleware

type IMiddleware interface {
	Invoke(httpContext *context.HttpContext)
}

IMiddleware 中间件

type Session

type Session struct {
	IMiddleware
}

func (*Session) Invoke

func (receiver *Session) Invoke(httpContext *context.HttpContext)

type UrlRewriting

type UrlRewriting struct {
	IMiddleware
}

func (*UrlRewriting) Invoke

func (receiver *UrlRewriting) Invoke(httpContext *context.HttpContext)

Jump to

Keyboard shortcuts

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