Documentation ¶
Overview ¶
Package resourceurl implements resource url parsing utilities.
Index ¶
Constants ¶
View Source
const ( // ResourcePrefix is the prefix of a resource URL. ResourcePrefix = "https://www.googleapis.com/" // NumParts is the number of parts in a resource URL. NumParts = 8 // ResourceCategoryIndex is the index of the resource category in resource URL parts. ResourceCategoryIndex = 0 // ProjectIndex is the index of the project in resource URL parts. ProjectIndex = 3 // LocationIndex is the index of the location in resource URL parts. LocationIndex = 5 // SubResourceIndex is the index of the sub resource in resource URL parts. SubResourceIndex = 6 // NameIndex is the index of the name in resource URL parts. NameIndex = 7 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ResourceURL ¶
type ResourceURL struct { // The resource category (e.g. compute) ResourceCategory string // The project where the resource lives in (e.g. my-project) Project string // The location where the resource lives in (e.g. us-central1-b) Location string // The sub-type of the resource (e.g. instanceGroupManagers) SubResource string // The name of the resource (e.g. gke-capg-gke-demo-mypool-aa1282e0-grp) Name string }
ResourceURL captures the individual fields of a GCP resource URL. An example of GCP resource URL: https://www.googleapis.com/compute/v1/projects/my-project/zones/us-central1-b/instanceGroupManagers/gke-capg-gke-demo-mypool-aa1282e0-grp
Click to show internal directories.
Click to hide internal directories.