proxy

package
v0.0.0-...-89061c5 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NextPlanStep      = 10
	FinishedPlanSteps = 20
	Abort             = 30
)

Codes are used to relay information from the application to the CLI about what actions are being taken.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventWriter

type EventWriter interface {
	Write(structuredlogs.Event)
}

type Plan

type Plan []PlanStep

type PlanStep

type PlanStep struct {
	// Percentage of requests to route to new route.
	Percentage int

	// Duration is the length of time that the step takes place before moving
	// on to the next. If this is the last step in the plan, then the planner
	// will recommend all the traffic go to the new route.
	Duration time.Duration
}

type Planner

type Planner interface {
	CurrentPercentage() int
}

type Predicate

type Predicate func() bool

type Proxy

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

func New

func New(
	oldRoute string,
	newRoute string,
	planner Planner,
	skipSSLValidation bool,
	log *log.Logger,
) *Proxy

func (*Proxy) ServeHTTP

func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request)

type RoutePlanner

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

func NewRoutePlanner

func NewRoutePlanner(plan Plan, p Predicate, w EventWriter, log *log.Logger) *RoutePlanner

func (*RoutePlanner) CurrentPercentage

func (p *RoutePlanner) CurrentPercentage() int

Jump to

Keyboard shortcuts

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