middleware.go 711 B

12345678910111213141516171819202122232425262728
  1. // ================================================================================
  2. // Code generated by GoFrame CLI tool. DO NOT EDIT.
  3. // You can delete these comments if you wish manually maintain this interface file.
  4. // ================================================================================
  5. package service
  6. import (
  7. "github.com/gogf/gf/v2/net/ghttp"
  8. )
  9. type IMiddleware interface {
  10. Ctx(r *ghttp.Request)
  11. Auth(r *ghttp.Request)
  12. }
  13. var localMiddleware IMiddleware
  14. func Middleware() IMiddleware {
  15. if localMiddleware == nil {
  16. panic("implement not found for interface IMiddleware, forgot register?")
  17. }
  18. return localMiddleware
  19. }
  20. func RegisterMiddleware(i IMiddleware) {
  21. localMiddleware = i
  22. }