wings/router/middleware.go

18 lines
504 B
Go
Raw Normal View History

2020-04-06 01:00:33 +00:00
package router
import (
"github.com/gin-gonic/gin"
2021-01-26 04:28:24 +00:00
"github.com/pterodactyl/wings/router/middleware"
2020-04-06 01:00:33 +00:00
"github.com/pterodactyl/wings/server"
)
2021-01-26 04:28:24 +00:00
// ExtractServer returns the server instance from the gin context. If there is
// no server set in the context (e.g. calling from a controller not protected
// by ServerExists) this function will panic.
//
// This function is deprecated. Use middleware.ExtractServer.
2020-12-16 04:19:09 +00:00
func ExtractServer(c *gin.Context) *server.Server {
2021-01-26 04:28:24 +00:00
return middleware.ExtractServer(c)
}