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
- func AWSPublicIPv4(ctx context.Context) (string, error)
- func CanListenIPv6() bool
- func Collect(engineVersion string) *nodev1.NodeInfo
- func HasGlobalIPv6() bool
- func Hostname() string
- func IPAddresses() []string
- func MachineID() string
- func NofileHardLimit() uint64
- func OnlineCPUs() int
- func RaiseNofile()
Constants ¶
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
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 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 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.