published

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 7 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 published chooses the Published ports (ADR 0012) a Containerized Instance serves host clients on: the ports its own container publishes to the host. GKE LoadBalancer Services (on a VM runtime) and forwarding rules (on any runtime) share them, and whoever binds a port first wins.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Candidates

func Candidates(name string, port int, published map[int]string, lo, hi int, ranged bool) []int

Candidates lists the container ports to try serving port on, in order: port itself when the container publishes it at the same host port, then the published ports of --port-range lo-hi (when ranged), from a hash of name onwards, so that name keeps its port across syncs and restarts where it can. published maps each published container port to its host address (runtime.Client.SelfPorts).

func Hint

func Hint(portRange string, port int, what string) string

Hint says what to publish so that port, the port of what ("the Service", "the forwarding rule"), can be served, given the Instance's --port-range ("" for none).

func ListenShared

func ListenShared(addr string) (net.Listener, error)

ListenShared listens on addr like net.Listen, but lets a listener on the wildcard address and one on a specific address share a port (Linux refuses that otherwise), when both are opened with it. A forwarding rule's loopback listener and a Published port listener on the rule's own port need that in a Containerized Instance. Sharing also lets two wildcard listeners share a port, so callers must keep track of the ports they hold themselves; a plain listener (another process, or a GKE LoadBalancer Service) still refuses it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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