traffic

package
v1.4.89 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StackTrafficWeightsAnnotationKey   = "zalando.org/stack-traffic-weights"
	DefaultBackendWeightsAnnotationKey = "zalando.org/backend-weights"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type StackTrafficWeight

type StackTrafficWeight struct {
	Name         string
	Weight       float64
	ActualWeight float64
}

type Switcher

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

Switcher is able to switch traffic between stacks.

func NewSwitcher

func NewSwitcher(client clientset.Interface, backendWeightsAnnotationKey string) *Switcher

NewSwitcher initializes a new traffic switcher.

func (*Switcher) Switch

func (t *Switcher) Switch(ctx context.Context, stackset, stack, namespace string, weight float64) ([]StackTrafficWeight, error)

Switch changes traffic weight for a stack.

func (*Switcher) TrafficWeights

func (t *Switcher) TrafficWeights(ctx context.Context, stackset, namespace string) ([]StackTrafficWeight, error)

TrafficWeights returns a list of stacks with their current traffic weight.

Jump to

Keyboard shortcuts

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