locations

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: 3 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 locations embeds the real Google Cloud regions and zones (FR-CORE-021) so every service validates locations the same way. It also records each region's auto-mode VPC subnet range (SRS 1.2, compute).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsLocation

func IsLocation(loc string) bool

IsLocation reports whether loc is a region or a zone.

func IsRegion

func IsRegion(name string) bool

IsRegion reports whether name is a real region.

func IsZone

func IsZone(name string) bool

IsZone reports whether name is a real zone.

func RegionOf

func RegionOf(loc string) (string, bool)

RegionOf returns the region of a region or zone name.

func ZoneID

func ZoneID(zone string) uint64

ZoneID returns a stable numeric ID for a zone.

func ZoneRegion

func ZoneRegion(zone string) (string, bool)

ZoneRegion returns the region of a zone.

func Zones

func Zones() []string

Zones returns every zone sorted by name.

Types

type Region

type Region struct {
	Name string
	// Description is the human-readable location ("Iowa").
	Description string

	// AutoCIDR is the subnet range an auto-mode VPC network creates in the
	// region (e.g. 10.128.0.0/20 in us-central1).
	AutoCIDR string
	// contains filtered or unexported fields
}

Region is one GCP region.

func Lookup

func Lookup(name string) (Region, bool)

Lookup returns a region by name.

func Regions

func Regions() []Region

Regions returns every region sorted by name.

func (Region) ID

func (r Region) ID() uint64

ID returns a stable numeric ID for the region (the compute API exposes one).

func (Region) ZoneNames

func (r Region) ZoneNames() []string

ZoneNames returns the region's zones ("us-central1-a", ...).

Jump to

Keyboard shortcuts

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