config

package
v0.0.0-...-c49be44 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Strategies []Strategy
}

Config contains the configuration for the application.

func (Config) Validate

func (config Config) Validate() error

Validate checks if the configuration is valid.

type HealthCriterion

type HealthCriterion struct {
	Metric     MetricsCheck
	Percentile float64
	Threshold  float64
}

HealthCriterion is a metrics threshold that should be met to consider a candidate healthy.

type MetricsCheck

type MetricsCheck string

MetricsCheck is the metrics check type.

const (
	RequestCountMetricsCheck MetricsCheck = "request-count"
	LatencyMetricsCheck      MetricsCheck = "request-latency"
	ErrorRateMetricsCheck    MetricsCheck = "error-rate-percent"
)

Supported metrics checks.

type Strategy

type Strategy struct {
	Target              Target
	Steps               []int64
	HealthCriteria      []HealthCriterion
	HealthCheckOffset   time.Duration
	TimeBetweenRollouts time.Duration
}

Strategy is a rollout configuration for the targeted services.

func NewStrategy

func NewStrategy(target Target, steps []int64, healthOffset, timeBetweenRollouts time.Duration, healthCriteria []HealthCriterion) Strategy

NewStrategy initializes a strategy.

func (Strategy) Validate

func (strategy Strategy) Validate() error

Validate checks if the strategy is valid.

type Target

type Target struct {
	Project       string
	Regions       []string
	LabelSelector string
}

Target is the configuration to filter services.

A target might have the following form

{
  "project": "myproject"
  "regions": [us-east1, us-central1]
  "labelSelector": "team=backend"
}

func NewTarget

func NewTarget(project string, regions []string, labelSelector string) Target

NewTarget initializes a target to filter services by label.

Jump to

Keyboard shortcuts

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