client

package
v0.0.0-...-fd237a5 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NetworkTierPremium  networkTier = "PREMIUM"
	NetworkTierStandard networkTier = "STANDARD"
)
View Source
const (
	IpVersionIpV4 ipVersion = "IPV4"
	IpVersionIpV6 ipVersion = "IPV6"
)
View Source
const (
	AddressTypeExternal addressType = "EXTERNAL"
	AddressTypeInternal addressType = "INTERNAL"
)
View Source
const (
	IpRangePurposeVPCPeering            ipRangePurpose = "VPC_PEERING"
	IpRangePurposePrivateServiceConnect ipRangePurpose = "PRIVATE_SERVICE_CONNECT"
)
View Source
const (
	Ipv6EndpointTypeVm    ipv6EndpointType = "VM"
	Ipv6EndpointTypeNetlb ipv6EndpointType = "NETLB"
)
View Source
const (
	//Common States
	Deleted v1beta1.StatusState = "Deleted"

	//IPRange States
	SyncAddress         v1beta1.StatusState = "SyncAddress"
	SyncPsaConnection   v1beta1.StatusState = "SyncPSAConnection"
	DeletePsaConnection v1beta1.StatusState = "DeletePSAConnection"
	DeleteAddress       v1beta1.StatusState = "DeleteAddress"

	//Filestore States
	SyncFilestore   v1beta1.StatusState = "SyncFilestore"
	DeleteFilestore v1beta1.StatusState = "DeleteFilestore"
)
View Source
const GcpOperationWaitTime = time.Second * 5
View Source
const GcpRetryWaitTime = time.Second * 3
View Source
const PsaPeeringName = "servicenetworking-googleapis-com"
View Source
const ServiceNetworkingServiceConnectionName = "services/servicenetworking.googleapis.com/connections/servicenetworking-googleapis-com"
View Source
const ServiceNetworkingServicePath = "services/servicenetworking.googleapis.com"

Variables

View Source
var FilestoreInstanceRegEx *regexp.Regexp = regexp.MustCompile(`^projects\/([^/]+)\/locations\/([^/]+)\/instances\/([^/]+)$`)

Functions

func GetCachedGcpClient

func GetCachedGcpClient(ctx context.Context, saJsonKeyPath string) (*http.Client, error)

func GetCachedProjectNumber

func GetCachedProjectNumber(ctx context.Context, projectId string, httpClient *http.Client) (int64, error)

GetCachedProjectNumber get project number from cloud resources manager for a given project id

func GetFilestoreInstancePath

func GetFilestoreInstancePath(projectId, location, instanceId string) string

func GetFilestoreParentPath

func GetFilestoreParentPath(projectId, location string) string

func GetNetworkFilter

func GetNetworkFilter(projectId, vpcId string) string

func GetVPCPath

func GetVPCPath(projectId, vpcId string) string

Types

type ClientProvider

type ClientProvider[T any] func(ctx context.Context, httpClient *http.Client) (T, error)

func NewCachedClientProvider

func NewCachedClientProvider[T comparable](p ClientProvider[T]) ClientProvider[T]

type FilestoreState

type FilestoreState string
const (
	CREATING   FilestoreState = "CREATING"
	READY      FilestoreState = "READY"
	REPAIRING  FilestoreState = "REPAIRING"
	DELETING   FilestoreState = "DELETING"
	ERROR      FilestoreState = "ERROR"
	RESTORING  FilestoreState = "RESTORING"
	SUSPENDED  FilestoreState = "SUSPENDED"
	SUSPENDING FilestoreState = "SUSPENDING"
	RESUMING   FilestoreState = "RESUMING"
	REVERTING  FilestoreState = "REVERTING"
)

type OperationType

type OperationType int
const (
	NONE OperationType = iota
	ADD
	MODIFY
	DELETE
)

Jump to

Keyboard shortcuts

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