# Functions
AttachApiClient attaches the application API client which allows routes to access server resources from the Panel easily.
AttachRequestID attaches a unique ID to the incoming HTTP request so that any errors that are generated or returned to the client will include this reference allowing for an easier time identifying the specific request that failed for the user.
AttachServerManager attaches the server manager to the request context which allows routes to access the underlying server collection.
CaptureAndAbort aborts the request and attaches the provided error to the gin context, so it can be reported properly.
CaptureErrors is custom handler function allowing for errors bubbled up by c.Error() to be returned in a standardized format with tracking UUIDs on them for easier log searching.
ExtractApiClient returns the API client defined for the routes.
ExtractLogger pulls the logger out of the request context and returns it.
ExtractManager returns the server manager instance set on the request context.
ExtractServer will return the server from the gin.Context or panic if it is not present.
NewError returns a new RequestError for the provided error.
RemoteDownloadEnabled checks if remote downloads are enabled for this instance and if not aborts the request.
RequireAuthorization authenticates the request token against the given permission string, ensuring that if it is a server permission, the token has control over that server.
ServerExists will ensure that the requested server exists in this setup.
SetAccessControlHeaders sets the access request control headers on all of the requests.
# Structs
RequestError is a custom error type returned when something goes wrong with any of the HTTP endpoints.