location

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package location provides validators for Google Cloud location identifiers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidLocation

func IsValidLocation(loc string) bool

IsValidLocation validates a Google Cloud location identifier.

A valid location must be either:

  • A valid region (validated by IsValidRegion)
  • A valid zone (validated by IsValidZone)
  • The literal string "global"

Note: This validates syntax only, not whether the location currently exists or is available for a given service.

func IsValidRegion

func IsValidRegion(region string) bool

IsValidRegion validates a Google Cloud region identifier.

A valid region must:

  • Be non-empty
  • Contain only lowercase letters, digits, and hyphens
  • Match the general region code style (e.g., us-central1, europe-west4)
  • Be no longer than 100 characters (internal safety bound)

Note: This validates syntax only, not whether the region currently exists or is available for a given service.

func IsValidZone

func IsValidZone(zone string) bool

IsValidZone validates a Google Cloud zone identifier.

A valid zone must:

  • Be non-empty
  • Follow the zone naming pattern: <region>-<zone-letter> (e.g., us-central1-a)
  • Be no longer than 100 characters (internal safety bound)

Note: This validates syntax only, not whether the zone currently exists.

Types

This section is empty.

Jump to

Keyboard shortcuts

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