hostinfo

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: AGPL-3.0 Imports: 18 Imported by: 0 modules, 0 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 hostinfo collects the NodeInfo reported to the console. It only describes this host (name, addresses, software versions) and is sent to the operator's own console; nothing is sent anywhere else.

Index

Constants

View Source
const Engine = "openresty"

Engine is the data plane engine name reported to the console.

Variables

This section is empty.

Functions

func AWSPublicIPv4 added in v1.8.1

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

AWSPublicIPv4 reads the instance's own NAT mapping, never an external echo service or proxy.

func CanListenIPv6

func CanListenIPv6() bool

CanListenIPv6 reports whether the host can bind IPv6 sockets, used to decide whether to render `listen [::]:port`.

func Collect

func Collect(engineVersion string) *nodev1.NodeInfo

Collect builds the NodeInfo message.

func HasGlobalIPv6

func HasGlobalIPv6() bool

HasGlobalIPv6 reports whether any interface has a global IPv6 address, used to decide whether the nginx resolver should query AAAA records.

func Hostname

func Hostname() string

Hostname returns the host name, or "unknown".

func IPAddresses

func IPAddresses() []string

IPAddresses returns the host's unicast addresses, excluding loopback and link-local ones, sorted for stable reports.

func MachineID added in v1.7.0

func MachineID() string

MachineID is the app-specific machine id the console uses to notice a host that already is a node (NodeInfo.machine_id): the hex SHA-256 of "edgeweir-node:" and the host's machine id, so that the id itself is not disclosed. Empty when the host has none (containers).

func NofileHardLimit

func NofileHardLimit() uint64

NofileHardLimit returns the hard RLIMIT_NOFILE of this process, or 0 if unknown. nginx workers may raise their soft limit up to it (worker_rlimit_nofile); os/exec children otherwise inherit the original soft limit, often only 1024.

func OnlineCPUs added in v1.0.0

func OnlineCPUs() int

OnlineCPUs is an upper bound of the CPUs nginx counts for `worker_processes auto`: the online CPUs of the host (Linux), at least the CPUs this process may run on.

func RaiseNofile added in v1.0.0

func RaiseNofile()

RaiseNofile sets the soft RLIMIT_NOFILE of this process to its hard limit. Go raises it at start-up but gives os/exec children the original soft limit back unless the program sets the limit itself: the nginx master opens every listening socket (layer-4 port ranges: one per port, one per worker with reuseport) under its own soft limit.

Types

This section is empty.

Jump to

Keyboard shortcuts

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