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)
|
2020-04-06 19:49:49 +00:00
|
|
|
}
|