middleware

package
v0.0.0-...-d8a4e70 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProviderSet = wire.NewSet(NewMiddlewares)

Functions

func Entrance

func Entrance(conf *koanf.Koanf, session *sessions.Manager) func(next http.Handler) http.Handler

Entrance 确保通过正确的入口访问

func MustInstall

func MustInstall(app biz.AppRepo) func(next http.Handler) http.Handler

MustInstall 确保已安装应用

func MustLogin

func MustLogin(session *sessions.Manager) func(next http.Handler) http.Handler

MustLogin 确保已登录

func Status

func Status(next http.Handler) http.Handler

Status 检查程序状态

func Throttle

func Throttle(tokens uint64, interval time.Duration) func(next http.Handler) http.Handler

Throttle 限流器

Types

type Middlewares

type Middlewares struct {
	// contains filtered or unexported fields
}

func NewMiddlewares

func NewMiddlewares(conf *koanf.Koanf, log *slog.Logger, session *sessions.Manager, app biz.AppRepo) *Middlewares

func (*Middlewares) Globals

func (r *Middlewares) Globals(mux *chi.Mux) []func(http.Handler) http.Handler

Globals is a collection of global middleware that will be applied to every request.

Jump to

Keyboard shortcuts

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