lbenv

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: Apache-2.0 Imports: 2 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 lbenv derives the `gcpemu env` variables of load balancing endpoints (ADR 0013): forwarding rules' GCPEMU_LB_* and GKE LoadBalancer Service ports' GCPEMU_GKE_*, from their Service endpoint names. A front Instance derives them over its own endpoints and its Linked Instances' together (ADR 0027, #715), so that uniqueness and withholding span Instances.

A forwarding rule's endpoint is "lb:<project>/<region|global>/<name>", printed as GCPEMU_LB_<PROJECT>_<REGION|GLOBAL>_<NAME>, and as GCPEMU_LB_<NAME> while the name is unique. A Service port's is "gke:<cluster>/<namespace>/<service>/<port>", printed as GCPEMU_GKE_<CLUSTER>_<NAMESPACE>_<SERVICE>_<PORT>. A variable more than one endpoint would print (a shared name, a cluster name used on two Instances, or two names that flatten alike) is withheld, never pointed at either.

Index

Constants

View Source
const (
	RulePrefix    = "lb:"
	ServicePrefix = "gke:"
)

Prefixes of the endpoint names that print variables.

Variables

This section is empty.

Functions

func EnvName

func EnvName(s string) string

EnvName upper-cases a name for an env var, replacing other characters with '_'.

func Linked

func Linked(name, link string) string

Linked is the name under which a front Instance lists the endpoint name of the Linked Instance link, beside its own.

func Qualified

func Qualified(key string) string

Qualified is GCPEMU_LB_<PROJECT>_<REGION|GLOBAL>_<NAME> for a forwarding rule's endpoint name.

func Short

func Short(key string) (string, bool)

Short is GCPEMU_LB_<NAME> for a forwarding rule's endpoint name, and false for any other endpoint.

func Unlinked

func Unlinked(key string) (name, link string)

Unlinked returns the endpoint name and link of a name Linked made, and a name of this Instance's own with link "".

Types

type Withheld

type Withheld struct {
	Name string
	Keys []string
}

Withheld is a variable more than one endpoint would print, with their names (Keys, as in the endpoints given) in order.

func Vars

func Vars(endpoints map[string]string) (map[string]string, []Withheld)

Vars returns the variables of the Load balancing frontends in endpoints, and those withheld as ambiguous, sorted by variable. Other endpoints are ignored.

Jump to

Keyboard shortcuts

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