hostnameresolver

package
v1.27.3 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2021 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HostResolver

type HostResolver interface {
	Subset() []corev1.EndpointSubset
}

HostResolver is used for getting endpoint subsets with resolved IPs.

type Provider

type Provider interface {
	HasSynced() bool
	Start(ctx context.Context)
	WithCallback(onUpdate func())
	HostResolver
}

Provider allows to start and attach callbacks for a specific host resolution updates.

func CreateForCluster

func CreateForCluster(client kubernetes.Interface, logger logrus.FieldLogger) (Provider, error)

CreateForCluster tries to use the hostname and port from the client to create the provider. If that fails, then tries to use the KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT environment variable. If that fails it fallbacks to NoOpProvider().

func NewNoOpProvider

func NewNoOpProvider() Provider

func NewProvider

func NewProvider(host string, port string, log logrus.FieldLogger, resync time.Duration) Provider

NewProvider returns a Provider for a specific host and port with resync indicating how often the hostname resolution is happening.

Jump to

Keyboard shortcuts

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