Documentation
¶
Overview ¶
Package memorystore provides GCP Memorystore (Redis) commitments client
Index ¶
- type BillingService
- type CreateInstanceOperation
- type MemorystoreClient
- func (c *MemorystoreClient) GetExistingCommitments(ctx context.Context) ([]common.Commitment, error)
- func (c *MemorystoreClient) GetOfferingDetails(ctx context.Context, rec common.Recommendation) (*common.OfferingDetails, error)
- func (c *MemorystoreClient) GetRecommendations(ctx context.Context, params common.RecommendationParams) ([]common.Recommendation, error)
- func (c *MemorystoreClient) GetRegion() string
- func (c *MemorystoreClient) GetServiceType() common.ServiceType
- func (c *MemorystoreClient) GetValidResourceTypes(ctx context.Context) ([]string, error)
- func (c *MemorystoreClient) PurchaseCommitment(ctx context.Context, rec common.Recommendation) (common.PurchaseResult, error)
- func (c *MemorystoreClient) SetBillingService(svc BillingService)
- func (c *MemorystoreClient) SetRecommenderClient(client RecommenderClient)
- func (c *MemorystoreClient) SetRedisService(svc RedisService)
- func (c *MemorystoreClient) ValidateOffering(ctx context.Context, rec common.Recommendation) error
- type RecommenderClient
- type RecommenderIterator
- type RedisIterator
- type RedisPricing
- type RedisService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BillingService ¶
type BillingService interface {
ListSKUs(serviceID string) (*cloudbilling.ListSkusResponse, error)
}
BillingService interface for Cloud Billing operations
type CreateInstanceOperation ¶
type CreateInstanceOperation interface {
Wait(ctx context.Context, opts ...gax.CallOption) (*redispb.Instance, error)
}
CreateInstanceOperation interface for create instance operation
type MemorystoreClient ¶
type MemorystoreClient struct {
// contains filtered or unexported fields
}
MemorystoreClient handles GCP Memorystore (Redis) commitments
func NewClient ¶
func NewClient(ctx context.Context, projectID, region string, opts ...option.ClientOption) (*MemorystoreClient, error)
NewClient creates a new GCP Memorystore client
func (*MemorystoreClient) GetExistingCommitments ¶
func (c *MemorystoreClient) GetExistingCommitments(ctx context.Context) ([]common.Commitment, error)
GetExistingCommitments retrieves existing Memorystore Redis commitments
func (*MemorystoreClient) GetOfferingDetails ¶
func (c *MemorystoreClient) GetOfferingDetails(ctx context.Context, rec common.Recommendation) (*common.OfferingDetails, error)
GetOfferingDetails retrieves Memorystore offering details from GCP Billing API
func (*MemorystoreClient) GetRecommendations ¶
func (c *MemorystoreClient) GetRecommendations(ctx context.Context, params common.RecommendationParams) ([]common.Recommendation, error)
GetRecommendations gets Memorystore Redis recommendations from GCP Recommender API
func (*MemorystoreClient) GetRegion ¶
func (c *MemorystoreClient) GetRegion() string
GetRegion returns the region
func (*MemorystoreClient) GetServiceType ¶
func (c *MemorystoreClient) GetServiceType() common.ServiceType
GetServiceType returns the service type
func (*MemorystoreClient) GetValidResourceTypes ¶
func (c *MemorystoreClient) GetValidResourceTypes(ctx context.Context) ([]string, error)
GetValidResourceTypes returns valid Memorystore tiers
func (*MemorystoreClient) PurchaseCommitment ¶
func (c *MemorystoreClient) PurchaseCommitment(ctx context.Context, rec common.Recommendation) (common.PurchaseResult, error)
PurchaseCommitment purchases a Memorystore Redis commitment
func (*MemorystoreClient) SetBillingService ¶
func (c *MemorystoreClient) SetBillingService(svc BillingService)
SetBillingService sets the billing service (for testing)
func (*MemorystoreClient) SetRecommenderClient ¶
func (c *MemorystoreClient) SetRecommenderClient(client RecommenderClient)
SetRecommenderClient sets the recommender client (for testing)
func (*MemorystoreClient) SetRedisService ¶
func (c *MemorystoreClient) SetRedisService(svc RedisService)
SetRedisService sets the Redis service (for testing)
func (*MemorystoreClient) ValidateOffering ¶
func (c *MemorystoreClient) ValidateOffering(ctx context.Context, rec common.Recommendation) error
ValidateOffering validates that a Redis tier exists
type RecommenderClient ¶
type RecommenderClient interface {
ListRecommendations(ctx context.Context, req *recommenderpb.ListRecommendationsRequest) RecommenderIterator
Close() error
}
RecommenderClient interface for recommender operations
type RecommenderIterator ¶
type RecommenderIterator interface {
Next() (*recommenderpb.Recommendation, error)
}
RecommenderIterator interface for iterating recommendations
type RedisIterator ¶
RedisIterator interface for iterating Redis instances
type RedisPricing ¶
type RedisPricing struct {
HourlyRate float64
CommitmentPrice float64
OnDemandPrice float64
Currency string
SavingsPercentage float64
}
RedisPricing contains pricing information for Memorystore Redis
type RedisService ¶
type RedisService interface {
ListInstances(ctx context.Context, req *redispb.ListInstancesRequest) RedisIterator
CreateInstance(ctx context.Context, req *redispb.CreateInstanceRequest) (CreateInstanceOperation, error)
Close() error
}
RedisService interface for Redis operations