shared

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FQDN added in v1.10.0

func FQDN() (string, error)

FQDN just calls FQDNWithContext with a background context. Deprecated.

func FQDNWithContext added in v1.12.0

func FQDNWithContext(ctx context.Context) (string, error)

FQDNWithContext attempts to lookup the host's fully-qualified domain name and returns it. It does so using the following algorithm:

  1. It gets the hostname from the OS. If this step fails, it returns an error.

  2. It tries to perform a CNAME DNS lookup for the hostname. If this succeeds, it returns the CNAME (after trimming any trailing period) as the FQDN.

  3. It tries to perform an IP lookup for the hostname. If this succeeds, it tries to perform a reverse DNS lookup on the returned IPs and returns the first successful result (after trimming any trailing period) as the FQDN.

  4. If steps 2 and 3 both fail, an empty string is returned as the FQDN along with errors from those steps.

func Network

func Network() (ips, macs []string, err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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