Documentation ¶
Index ¶
Constants ¶
View Source
const ( HostPart = "Host" HostRegexPart = "HostRegexp" PathPart = "Path" PathRegexPart = "PathRegexp" MethodPart = "Method" MethodRegexPart = "MethodRegexp" HeaderPart = "Header" HeaderRegexPart = "HeaderRegexp" )
View Source
const ( DefaultRoute = "Path(`/`)" DefaultFailoverPredicate = `IsNetworkError() && Attempts() <= 2` DailTimeoutKey = "dial_timeout" ReadTimeoutKey = "read_timeout" MaxIdleConnsKey = "max_idle_conns_per_host" CustomMiddlewareKeyPattern = `^middleware\.([^\.]+)` HTTP = "http" Enabled = "enabled" RedirectSSLID = "redirect_to_ssl" TraceID = "trace" AuthID = "auth" MaintenanceID = "maintenance" )
Variables ¶
View Source
var DefaultMiddleware = map[string]string{
RedirectSSLID: `{
"Priority": 1,
"Type": "rewrite",
"Middleware": {
"Regexp": "^http://(.*)",
"Replacement": "https://$1",
"Rewritebody": false,
"Redirect": true
}
}`,
TraceID: `{
"Priority": 1,
"Type": "trace",
"Middleware": {
"ReqHeaders": %s,
"RespHeaders": %s,
"Addr": "syslog://127.0.0.1:514",
"Prefix": "@app"
}
}`,
AuthID: `{
"Priority": 1,
"Type": "auth",
"Middleware": {
"User": "%s",
"Pass": "%s"
}
}`,
MaintenanceID: `{
"Priority": 1,
"Type": "cbreaker",
"Middleware": {
"Condition": "ResponseCodeRatio(500, 600, 0, 600) > 0.9",
"Fallback": {
"Type": "response",
"Action": {
"StatusCode": 503,
"Body": %q
}
},
"FallbackDuration": 1000000000,
"RecoveryDuration": 1000000000,
"CheckPeriod": 100000000
}
}`,
}
Functions ¶
func NewRoute ¶
func NewRoute(rt *kubernetes.Route) *route
func NewRouteFromString ¶
func NewRouteFromString(expr string) *route
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.