internal

package
v1.6.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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHostName

func GetHostName() string

GetHostName returns the hostname reported by the kernel. If resolution fails, 'unknown' is returned.

func GetHostNameOrIP

func GetHostNameOrIP() string

GetHostNameOrIP returns the hostname reported by the kernel falling back to outbound ip if hostname could not be resolved If resolution fails, 'unknown' is returned.

func GetOutboundIP

func GetOutboundIP() string

GetOutboundIP returns the preferred outbound ip of this node If resolution fails, 'unknown' is returned.

func Sprintt

func Sprintt(format string, params map[string]interface{}) string

Sprintt is like fmt.Sprintf, but accepts named parameters from a map.

Example:

params := map[string]interface{}{
  "hello": "world",
  "num":   42,
}

result := internal.Sprintt("Hello %{hello}s. The answer is %{num}d", params)

Result will then be: 'Hello world. The answer is 42'

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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