ingressgateway

package
v0.0.0-...-9e9d5c1 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// This environmental variable must hold address of ingress gateway which client should access.
	// Address may be IP or FQDN. If this variable is not present creator will fallback to output of `minikube ip`.
	ServiceNameEnv = "INGRESSGATEWAY_ADDRESS"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientCreator

type ClientCreator interface {
	// ServiceAddress returns address of ingress gateway read from environment. It does so by reading
	// service name from environmental variable and resolving it. If env variable is not set output of `minikube ip` will
	// be used as address to support local testing.
	ServiceAddress() (string, error)

	// Client returns http.Client which dials ingress gateway service address instead of the one provided in request
	// URL. For details how address is resolved see ServiceAddressFromEnv.
	Client() (*http.Client, error)
}

func FromEnv

func FromEnv() ClientCreator

FromEnv returns ClientCreator ready for production use.

type Dialer

type Dialer interface {
	DialContext(ctx context.Context, network, address string) (net.Conn, error)
}

dialer is an interface which abstracts net.dialer.

Jump to

Keyboard shortcuts

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