cloudstorage

package
v0.0.0-...-36f5383 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: OSL-3.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cloudstorage provides GCP Cloud Storage commitments client

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BillingService

type BillingService = skulist.BillingService

BillingService lists SKUs of one Cloud Billing service (enables mocking).

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client handles GCP Cloud Storage commitments.

func NewClient

func NewClient(ctx context.Context, projectID, region string, opts ...option.ClientOption) (*Client, error)

NewClient creates a new GCP Cloud Storage client.

func (*Client) GetExistingCommitments

func (c *Client) GetExistingCommitments(_ context.Context) ([]common.Commitment, error)

GetExistingCommitments returns an empty slice for Cloud Storage. GCP Cloud Storage has no commitment API: there is no committed-use discount purchase for GCS, and enumerating regional buckets does not represent a commitment -- it caused every bucket in a region to appear as a "commitment" in the UI (10-L2). Return empty until a proper commitment-detection path is available.

func (*Client) GetOfferingDetails

func (c *Client) GetOfferingDetails(ctx context.Context, rec common.Recommendation) (*common.OfferingDetails, error)

GetOfferingDetails retrieves Cloud Storage offering details from GCP Billing API.

func (*Client) GetRecommendations

func (c *Client) GetRecommendations(_ context.Context, _ *common.RecommendationParams) ([]common.Recommendation, error)

GetRecommendations always returns an error: Google has no commitment product for Cloud Storage (issue #78), so there is nothing to recommend. The error is explicit so callers do not read an empty result as "nothing to buy".

func (*Client) GetRegion

func (c *Client) GetRegion() string

GetRegion returns the region.

func (*Client) GetServiceType

func (c *Client) GetServiceType() common.ServiceType

GetServiceType returns the service type.

func (*Client) PurchaseCommitment

func (c *Client) PurchaseCommitment(ctx context.Context, rec common.Recommendation, opts common.PurchaseOptions) (common.PurchaseResult, error)

PurchaseCommitment is intentionally a no-op for Cloud Storage: GCP has no CUD or commitment purchase API for GCS at all. The previous implementation created a brand-new empty bucket, which is not a commitment and incurs ongoing cost, so a "purchase" silently provisioned billable infrastructure. Cloud Storage recommendations are therefore advisory only; this returns a clear not-supported error and never calls any resource-creation API (issue #640).

func (*Client) SetBillingService

func (c *Client) SetBillingService(svc BillingService)

SetBillingService sets the billing service (for testing).

func (*Client) SetRecommenderClient deprecated

func (c *Client) SetRecommenderClient(_ RecommenderClient)

SetRecommenderClient ignores the supplied client and does not close it.

Deprecated: Cloud Storage has no commitment recommender.

type RecommenderClient deprecated

type RecommenderClient interface {
	ListRecommendations(ctx context.Context, req *recommenderpb.ListRecommendationsRequest) RecommenderIterator
	Close() error
}

RecommenderClient preserves the legacy injection API for source compatibility.

Deprecated: Cloud Storage has no commitment recommender.

type RecommenderIterator deprecated

type RecommenderIterator interface {
	Next() (*recommenderpb.Recommendation, error)
}

RecommenderIterator preserves the legacy iteration API for source compatibility.

Deprecated: Cloud Storage has no commitment recommender.

type StoragePricing

type StoragePricing = catalogprice.Term

StoragePricing contains pricing information for Cloud Storage.

Jump to

Keyboard shortcuts

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