common

package
v0.0.0-...-1a56975 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallEcho

func CallEcho(client *appEcho.Client, opts *echo.CallOptions, outboundPortSelector OutboundPortSelectorFunc) (appEcho.ParsedResponses, error)

func CheckOutboundConfig

func CheckOutboundConfig(target echo.Instance, port echo.Port, validator *structpath.Instance) error

CheckOutboundConfig checks the Envoy config dump for outbound configuration to the given target.

func FillInDefaults

func FillInDefaults(ctx resource.Context, defaultDomain string, c *echo.Config) (err error)

func GetGRPCPort

func GetGRPCPort(c *echo.Config) *echo.Port

func WaitForConfig

func WaitForConfig(fetch ConfigFetchFunc, accept ConfigAcceptFunc, options ...retry.Option) error

Types

type ConfigAcceptFunc

type ConfigAcceptFunc func(*envoyAdmin.ConfigDump) (bool, error)

ConfigAcceptFunc evaluates the Envoy config dump and either accept/reject it. This is used by WaitForConfig to control the retry loop. If an error is returned, a retry will be attempted. Otherwise the loop is immediately terminated with an error if rejected or none if accepted.

func OutboundConfigAcceptFunc

func OutboundConfigAcceptFunc(outboundInstances ...echo.Instance) ConfigAcceptFunc

OutboundConfigAcceptFunc returns a function that accepts Envoy configuration if it contains outbound configuration for all of the given instances.

type ConfigFetchFunc

type ConfigFetchFunc func() (*envoyAdmin.ConfigDump, error)

ConfigFetchFunc retrieves the config dump from Envoy.

type OutboundPortSelectorFunc

type OutboundPortSelectorFunc func(servicePort int) (int, error)

OutboundPortSelectorFunc is a function that selects the appropriate outbound port for sending requests to a target service.

var (
	// IdentityOutboundPortSelector is an OutboundPortSelectorFunc that always returns the original service port.
	IdentityOutboundPortSelector OutboundPortSelectorFunc = func(servicePort int) (int, error) {
		return servicePort, nil
	}
)

Jump to

Keyboard shortcuts

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