Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IgnoreErrorCodes ¶ added in v1.24.0
IgnoreErrorCodes returns nil if the error matches one of the provided HTTP status codes.
func IgnoreNotFoundError ¶ added in v1.27.0
IgnoreNotFoundError returns nil if the error is a NotFound error. Otherwise, it returns the original error.
func IsErrorCode ¶ added in v1.24.0
IsErrorCode checks if the error is of type googleapi.Error and the HTTP status matches one of the provided list of codes.
Types ¶
type ComputeClient ¶ added in v1.19.0
type ComputeClient interface { // GetExternalAddresses returns a list of all external IP addresses mapped to the names of their users. GetExternalAddresses(ctx context.Context, region string) (map[string][]string, error) // GetVPC returns a name of VPC GetVPC(ctx context.Context, network string) (*compute.Network, error) // GetSubnet returns a subnet info. GetSubnet(ctx context.Context, region, subnet string) (*compute.Subnetwork, error) }
ComputeClient is an interface which must be implemented by GCP compute clients.
func NewComputeClientFromSecretRef ¶ added in v1.19.0
func NewComputeClientFromSecretRef(ctx context.Context, c client.Client, secretRef corev1.SecretReference) (ComputeClient, error)
NewComputeClientFromSecretRef creates a new compute client from the given client and secret reference.
type DNSClient ¶ added in v1.18.0
type DNSClient interface { GetManagedZones(ctx context.Context) (map[string]string, error) CreateOrUpdateRecordSet(ctx context.Context, managedZone, name, recordType string, rrdatas []string, ttl int64) error DeleteRecordSet(ctx context.Context, managedZone, name, recordType string) error }
DNSClient is an interface which must be implemented by GCP DNS clients.
func NewDNSClientFromSecretRef ¶ added in v1.18.0
func NewDNSClientFromSecretRef(ctx context.Context, c client.Client, secretRef corev1.SecretReference) (DNSClient, error)
NewDNSClientFromSecretRef creates a new DNS client from the given client and secret reference.
type Factory ¶ added in v1.18.0
type Factory interface { NewDNSClient(context.Context, client.Client, corev1.SecretReference) (DNSClient, error) NewStorageClient(context.Context, client.Client, corev1.SecretReference) (StorageClient, error) NewComputeClient(context.Context, client.Client, corev1.SecretReference) (ComputeClient, error) NewIAMClient(context.Context, client.Client, corev1.SecretReference) (IAMClient, error) }
Factory is a factory that can produce clients for various GCP Services.
func NewFactory ¶ added in v1.18.0
func NewFactory() Factory
NewFactory returns a new factory to produce clients for various GCP services.
type IAMClient ¶ added in v1.24.0
type IAMClient interface {
GetServiceAccount(ctx context.Context, name string) (*iam.ServiceAccount, error)
}
IAMClient is the client interface for the IAM API.
func NewIAMClient ¶ added in v1.24.0
NewIAMClient returns a new IAM client.
func NewIAMClientFromSecretRef ¶ added in v1.24.0
func NewIAMClientFromSecretRef(ctx context.Context, c client.Client, secretRef corev1.SecretReference) (IAMClient, error)
NewIAMClientFromSecretRef creates a new compute client from the given client and secret reference.
type StorageClient ¶
type StorageClient interface { // GCS wrappers CreateBucketIfNotExists(ctx context.Context, bucketName, region string) error DeleteBucketIfExists(ctx context.Context, bucketName string) error DeleteObjectsWithPrefix(ctx context.Context, bucketName, prefix string) error }
StorageClient is an interface which must be implemented by GCS clients.
func NewStorageClient ¶
func NewStorageClient(ctx context.Context, serviceAccount *gcp.ServiceAccount) (StorageClient, error)
NewStorageClient creates a new storage client from the given serviceAccount.
func NewStorageClientFromSecretRef ¶
func NewStorageClientFromSecretRef(ctx context.Context, c client.Client, secretRef corev1.SecretReference) (StorageClient, error)
NewStorageClientFromSecretRef creates a new storage client from the given <secretRef>.