provider

package
v0.53.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HostnameProvider

type HostnameProvider interface {
	// Metadata gets host metadata from provider.
	Hostname(ctx context.Context) (string, error)
}

HostnameProvider of a hostname from a given place.

func Chain

func Chain(logger *zap.Logger, providers map[string]HostnameProvider, priorityList []string) (HostnameProvider, error)

Chain providers into a single provider that returns the first available hostname.

func Config

func Config(hostname string) HostnameProvider

Config returns fixed hostname.

func Once

func Once(provider HostnameProvider) HostnameProvider

Once wraps a provider to call it only once.

Jump to

Keyboard shortcuts

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