hostnameinterface

package module
v0.86.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 1 Imported by: 8 modules, 9 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package hostnameinterface describes the interface for hostname methods

Index

Constants

View Source
const (
	// ConfigProvider is the default provider value from the configuration file
	ConfigProvider = "configuration"

	// FargateProvider is the default provider value from Fargate
	FargateProvider = "fargate"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

type Component interface {
	// Get returns the host name for the agent.
	Get(context.Context) (string, error)
	// GetWithProvider returns the hostname for the Agent and the provider that was use to retrieve it.
	GetWithProvider(ctx context.Context) (Data, error)
	// GetSafe is Get(), but it returns 'unknown host' if anything goes wrong.
	GetSafe(context.Context) string
}

Component is the type for hostname methods.

type Data

type Data struct {
	Hostname string
	Provider string
}

Data contains hostname and the hostname provider

func (Data) FromConfiguration

func (h Data) FromConfiguration() bool

FromConfiguration returns true if the hostname was found through the configuration file

func (Data) FromFargate

func (h Data) FromFargate() bool

FromFargate returns true if the hostname was found through Fargate

Jump to

Keyboard shortcuts

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