// ================================================================================
// Code generated by GoFrame CLI tool. DO NOT EDIT.
// You can delete these comments if you wish manually maintain this interface file.
// ================================================================================

package service

import (
	"context"

	"github.com/gogf/gf/v2/net/ghttp"
)

type (
	IMiddleware interface {
		AdminAuth(r *ghttp.Request)
		ApiAuth(r *ghttp.Request)
		HomeAuth(r *ghttp.Request)
		Ctx(r *ghttp.Request)
		CORS(r *ghttp.Request)
		DemoLimit(r *ghttp.Request)
		Addon(r *ghttp.Request)
		DeliverUserContext(r *ghttp.Request) (err error)
		IsExceptAuth(ctx context.Context, appName, path string) bool
		IsExceptLogin(ctx context.Context, appName, path string) bool
		Blacklist(r *ghttp.Request)
		Develop(r *ghttp.Request)
		GetFilterRoutes(r *ghttp.Request) map[string]ghttp.RouterItem
		GenFilterRouteKey(router *ghttp.Router) string
		PreFilter(r *ghttp.Request)
		ResponseHandler(r *ghttp.Request)
		WebSocketAuth(r *ghttp.Request)
	}
)

var (
	localMiddleware IMiddleware
)

func Middleware() IMiddleware {
	if localMiddleware == nil {
		panic("implement not found for interface IMiddleware, forgot register?")
	}
	return localMiddleware
}

func RegisterMiddleware(i IMiddleware) {
	localMiddleware = i
}
