hostnameinterface

package module
v0.52.1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 1 Imported by: 4

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