canaryrouter

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2020 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// StatusCodeMain is the expected HTTP status code from sidecar service which will
	// route traffic to Main proxy
	StatusCodeMain = 204

	// StatusCodeCanary is the expected HTTP status code from sidecar service which will
	// route traffic to Canary proxy
	StatusCodeCanary = 200
)
View Source
const (

	// StatusSidecarError means there is an error when proceeding request forwarded to sidecar
	StatusSidecarError = http.StatusServiceUnavailable
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server holds necessary components as a proxy server

func NewServer

func NewServer(config config.Config, version string) (*Server, error)

NewServer initiates a new proxy server

func (*Server) IsCanaryErrorLimited

func (s *Server) IsCanaryErrorLimited() bool

IsCanaryErrorLimited checks if circuit breaker (canary error limiter) feature is enabled

func (*Server) IsCanaryRequestLimited

func (s *Server) IsCanaryRequestLimited() bool

IsCanaryRequestLimited checks if circuit breaker (canary request limiter) feature is enabled

func (*Server) Run

func (s *Server) Run() error

Run initialize a new HTTP server

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(res http.ResponseWriter, req *http.Request)

ServeHTTP handles incoming traffics via provided proxies

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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