// Pacakage resource provides basic utilities for working with Google Cloud Platform // resource strings. package resource import "path" const ( Global = "global" ) // Ref produces a reference to a GCP resource that can be used when interacting with // the GCP API, either directly or with K8s Config Connector func Ref(projectID string, location string, resourceType string, resourceName string) string { e := []string{"projects", projectID} if location == Global { e = append(e, Global) } else { e = append(e, "locations", location) } e = append(e, resourceType, resourceName) return path.Join(e...) }