mesh

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package mesh turns Envoy static route config and Istio VirtualServices into retry layers, and attaches them to outbound calls by URL.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnvoyLayer

func EnvoyLayer(path, port string) (model.Layer, error)

EnvoyLayer reads an Envoy static config and returns the retry layer of the first route on the listener bound to port (or the first listener).

func IstioDefault

func IstioDefault(version, why string) model.Layer

IstioDefault is the policy pilot applies when a route has no retries stanza. From pilot/pkg/networking/core/route/retry/retry.go: 2 retries on connect-failure,refused-stream,unavailable,cancelled,retriable-status-codes, with RetriableStatusCodes=[503] up to 1.26 and none from 1.27.

func IstioLayer

func IstioLayer(path, host, version string) (model.Layer, error)

IstioLayer finds the VirtualService for host and turns its first HTTP route into a layer.

Types

type Route

type Route struct {
	URL   string      `yaml:"url"`   // e.g. http://envoy:10000 ; matched as a prefix
	Envoy string      `yaml:"envoy"` // envoy static bootstrap/route config file
	Istio string      `yaml:"istio"` // file with VirtualService(s)
	Host  string      `yaml:"host"`  // Istio destination host, e.g. mid or mid.default.svc.cluster.local
	Layer model.Layer `yaml:"-"`
}

Route says which config governs calls to a URL prefix.

type Routes

type Routes struct {
	IstioVersion string  `yaml:"istio_version"`
	Routes       []Route `yaml:"routes"`
}

Routes is the routes file.

func LoadRoutes

func LoadRoutes(path, istioVersion string) (*Routes, error)

LoadRoutes reads the routes file and parses every referenced config.

func (*Routes) Attach

func (rs *Routes) Attach(f *model.Finding, hostOK bool)

Attach adds the mesh layer for the finding's host. With an unresolved host it takes the worst route and says so.

Jump to

Keyboard shortcuts

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