Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Logger = logger.Logger.WithPrefix("Violet Serve Route")
Functions ¶
This section is empty.
Types ¶
type Flags ¶
type Flags uint64
func (Flags) NormaliseRedirectFlags ¶
NormaliseRedirectFlags returns only the bits used for redirects
func (Flags) NormaliseRouteFlags ¶
NormaliseRouteFlags returns only the bits used for routes
type Redirect ¶
type Redirect struct { Src string `json:"src"` // request source Dst string `json:"dst"` // redirect destination Desc string `json:"desc"` // description for admin panel use Flags Flags `json:"flags"` // extra flags Code int64 `json:"code"` // status code used to redirect }
Redirect is a target used by the router to manage redirecting the request using the specified configuration.
type RedirectWithActive ¶
type Route ¶
type Route struct { Src string `json:"src"` // request source Dst string `json:"dst"` // proxy destination Desc string `json:"desc"` // description for admin panel use Flags Flags `json:"flags"` // extra flags Headers http.Header `json:"-"` // extra headers Proxy *proxy.HybridTransport `json:"-"` // reverse proxy handler }
Route is a target used by the router to manage forwarding traffic to an internal server using the specified configuration.
func (Route) ServeHTTP ¶
func (r Route) ServeHTTP(rw http.ResponseWriter, req *http.Request)
ServeHTTP responds with the data proxied from the internal server to the response writer provided.
func (Route) UpdateHeaders ¶
UpdateHeaders takes an existing set of headers and overwrites them with the extra headers.
type RouteWithActive ¶
Click to show internal directories.
Click to hide internal directories.