Documentation ¶
Index ¶
- Constants
- Variables
- func GetCachedGcpClient(ctx context.Context, saJsonKeyPath string) (*http.Client, error)
- func GetCachedProjectNumber(projectId string, crmService *cloudresourcemanager.Service) (int64, error)
- func GetCompleteServiceName(projectId string, serviceName GcpServiceName) string
- func GetConfigDuration(env abstractions.Environment, key string, defaultValue time.Duration) time.Duration
- func GetFilestoreInstancePath(projectId, location, instanceId string) string
- func GetFilestoreParentPath(projectId, location string) string
- func GetNetworkFilter(projectId, vpcId string) string
- func GetVPCPath(projectId, vpcId string) string
- type ClientProvider
- type FilestoreState
- type GcpConfig
- type GcpServiceName
- type OperationType
- type ServiceUsageClient
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 GetCachedProjectNumber ¶
func GetCachedProjectNumber(projectId string, crmService *cloudresourcemanager.Service) (int64, error)
GetCachedProjectNumber get project number from cloud resources manager for a given project id
func GetCompleteServiceName ¶ added in v0.1.4
func GetCompleteServiceName(projectId string, serviceName GcpServiceName) string
func GetConfigDuration ¶ added in v0.1.4
func GetConfigDuration(env abstractions.Environment, key string, defaultValue time.Duration) time.Duration
func GetFilestoreParentPath ¶
func GetNetworkFilter ¶
func GetVPCPath ¶
Types ¶
type ClientProvider ¶
func NewCachedClientProvider ¶
func NewCachedClientProvider[T comparable](p ClientProvider[T]) ClientProvider[T]
func NewServiceUsageClientProvider ¶ added in v0.1.4
func NewServiceUsageClientProvider() ClientProvider[ServiceUsageClient]
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 GcpConfig ¶ added in v0.1.4
func GetGcpConfig ¶ added in v0.1.4
func GetGcpConfig(env abstractions.Environment) *GcpConfig
type GcpServiceName ¶ added in v0.1.4
type GcpServiceName string
const ( ServiceNetworkingService GcpServiceName = "servicenetworking.googleapis.com" ComputeService GcpServiceName = "compute.googleapis.com" FilestoreService GcpServiceName = "file.googleapis.com" CloudResourceManagerService GcpServiceName = "cloudresourcemanager.googleapis.com" )
type ServiceUsageClient ¶ added in v0.1.4
type ServiceUsageClient interface { EnableService(ctx context.Context, projectId string, serviceName GcpServiceName) (*serviceusage.Operation, error) DisableService(ctx context.Context, projectId string, serviceName GcpServiceName) (*serviceusage.Operation, error) IsServiceEnabled(ctx context.Context, projectId string, serviceName GcpServiceName) (bool, error) GetServiceUsageOperation(ctx context.Context, operationName string) (*serviceusage.Operation, error) }
func NewServiceUsageClient ¶ added in v0.1.4
func NewServiceUsageClient(svcServiceUsage *serviceusage.Service) ServiceUsageClient
Click to show internal directories.
Click to hide internal directories.