vulcand

package
v0.0.0-...-c360844 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 5, 2016 License: MIT Imports: 19 Imported by: 2

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 New

func New(vulcanURL string, reg *plugin.Registry, ctx context.Context) (*vulcan, error)

func NewRoute

func NewRoute(rt *kubernetes.Route) *route

func NewRouteFromString

func NewRouteFromString(expr string) *route

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL