googleurl

package
v0.0.0-...-c7d747a Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Link struct {
	// Service is the service name e.g. container.googleapis.com
	Service string
	// Version is the version in the link
	Version string

	// Project is the GCP project ID in the link
	Project string

	// Zone is the GCP zone found in the link
	Zone string

	// Location is the GCP location (region or zone) found in the link
	Location string

	// Extra holds any additional named fields found in the link
	Extra map[string]string
}

Link holds the results of parsing a google selfLink URL.

func Parse

func Parse(selfLink string) (*Link, error)

Parse parses the selfLink into fields in a Link object. A selfLink is expected to have a version as the first path token, otherwise use ParseUnversioned.

func ParseUnversioned

func ParseUnversioned(selfLink string) (*Link, error)

ParseUnversioned parses the unversioned selfLink into fields in a Link object. An unversioned reference differs from a normal selfLink in that it doesn't have a version, for example "//container.googleapis.com/projects/example-project/locations/us-central1/clusters/example-cluster"

Jump to

Keyboard shortcuts

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