util

package
v0.0.0-...-d8a8f93 Latest Latest
Warning

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

Go to latest
Published: May 2, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BlackHoleCluster to catch traffic from routes with unresolved clusters. Traffic arriving here goes nowhere.
	BlackHoleCluster = "BlackHoleCluster"
)

Variables

This section is empty.

Functions

func BuildAddress

func BuildAddress(ip string, port uint32) core.Address

BuildAddress returns a SocketAddress with the given ip and port.

func ConvertAddressToCidr

func ConvertAddressToCidr(addr string) *core.CidrRange

ConvertAddressToCidr converts from string to CIDR proto

func GetByAddress

func GetByAddress(listeners []*xdsapi.Listener, addr string) *xdsapi.Listener

GetByAddress returns a listener by its address TODO(mostrowski): consider passing map around to save iteration.

func GetNetworkEndpointAddress

func GetNetworkEndpointAddress(n *model.NetworkEndpoint) core.Address

GetNetworkEndpointAddress returns an Envoy v2 API `Address` that represents this NetworkEndpoint

func GogoDurationToDuration

func GogoDurationToDuration(d *types.Duration) time.Duration

GogoDurationToDuration converts from gogo proto duration to time.duration

func MessageToStruct

func MessageToStruct(msg proto.Message) *types.Struct

MessageToStruct converts from proto message to proto Struct

func SortVirtualHosts

func SortVirtualHosts(hosts []route.VirtualHost)

SortVirtualHosts sorts a slice of virtual hosts by name.

Envoy computes a hash of the listener which is affected by order of elements in the filter. Therefore we sort virtual hosts by name before handing them back so the ordering is stable across HTTP Route Configs.

Types

This section is empty.

Jump to

Keyboard shortcuts

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