localhostgate

package
v0.100.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

package localhostgate defines a feature gate that controls whether server-like receivers and extensions use localhost as the default host for their endpoints. This package is duplicated across core and contrib to avoid exposing the feature gate as part of the public API. To do this we define a `registerOrLoad` helper and try to register the gate in both modules. IMPORTANT NOTE: ANY CHANGES TO THIS PACKAGE MUST BE MIRRORED IN THE CONTRIB COUNTERPART.

Index

Constants

View Source
const UseLocalHostAsDefaultHostID = "component.UseLocalHostAsDefaultHost"

Variables

View Source
var UseLocalHostAsDefaultHostfeatureGate = mustRegisterOrLoad(
	featuregate.GlobalRegistry(),
	UseLocalHostAsDefaultHostID,
	featuregate.StageAlpha,
	featuregate.WithRegisterDescription("controls whether server-like receivers and extensions such as the OTLP receiver use localhost as the default host for their endpoints"),
)

UseLocalHostAsDefaultHostfeatureGate is the feature gate that controls whether server-like receivers and extensions such as the OTLP receiver use localhost as the default host for their endpoints.

Functions

func EndpointForPort

func EndpointForPort(port int) string

EndpointForPort gets the endpoint for a given port using localhost or 0.0.0.0 depending on the feature gate.

func LogAboutUseLocalHostAsDefault

func LogAboutUseLocalHostAsDefault(logger *zap.Logger)

LogAboutUseLocalHostAsDefault logs about the upcoming change from 0.0.0.0 to localhost on server-like components.

Types

This section is empty.

Jump to

Keyboard shortcuts

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