Documentation
¶
Overview ¶
Package cache provides Azure Cache for Redis Reserved Capacity client
Index ¶
- type AzureRetailPrice
- type Client
- func (c *Client) GetExistingCommitments(ctx context.Context) ([]common.Commitment, error)
- func (c *Client) GetOfferingDetails(ctx context.Context, rec common.Recommendation) (*common.OfferingDetails, error)
- func (c *Client) GetRecommendations(ctx context.Context, _ *common.RecommendationParams) ([]common.Recommendation, error)
- func (c *Client) GetRegion() string
- func (c *Client) GetServiceType() common.ServiceType
- func (c *Client) GetValidResourceTypes(ctx context.Context) ([]string, error)
- func (c *Client) PurchaseCommitment(ctx context.Context, rec common.Recommendation, opts common.PurchaseOptions) (common.PurchaseResult, error)
- func (c *Client) SetRecommendationsPager(pager RecommendationsPager)
- func (c *Client) SetRedisCachesPager(pager RedisCachesPager)
- func (c *Client) SetReservationsPager(pager ReservationsDetailsPager)
- func (c *Client) ValidateOffering(ctx context.Context, rec common.Recommendation) error
- type HTTPClient
- type RecommendationsPager
- type RedisCachesPager
- type RedisPricing
- type ReservationsDetailsPager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AzureRetailPrice ¶
type AzureRetailPrice = pricing.Page[pricing.RetailPriceItem]
AzureRetailPrice is the response envelope for the Azure Retail Prices API.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client handles Azure Cache for Redis Reserved Capacity.
func NewClient ¶
func NewClient(cred azcore.TokenCredential, subscriptionID, region string) *Client
NewClient creates a new Azure Cache client.
func NewClientWithHTTP ¶
func NewClientWithHTTP(cred azcore.TokenCredential, subscriptionID, region string, httpClient HTTPClient) *Client
NewClientWithHTTP creates a new Azure Cache client with a custom HTTP client (for testing).
func (*Client) GetExistingCommitments ¶
GetExistingCommitments retrieves existing Redis Cache reserved capacity.
func (*Client) GetOfferingDetails ¶
func (c *Client) GetOfferingDetails(ctx context.Context, rec common.Recommendation) (*common.OfferingDetails, error)
GetOfferingDetails retrieves Redis Cache reservation offering details from Azure Retail Prices API.
func (*Client) GetRecommendations ¶
func (c *Client) GetRecommendations(ctx context.Context, _ *common.RecommendationParams) ([]common.Recommendation, error)
GetRecommendations gets Redis Cache reservation recommendations from Azure Consumption API.
func (*Client) GetServiceType ¶
func (c *Client) GetServiceType() common.ServiceType
GetServiceType returns the service type.
func (*Client) GetValidResourceTypes ¶
GetValidResourceTypes returns valid Redis Cache SKUs from Azure API.
func (*Client) PurchaseCommitment ¶
func (c *Client) PurchaseCommitment(ctx context.Context, rec common.Recommendation, opts common.PurchaseOptions) (common.PurchaseResult, error)
PurchaseCommitment purchases Redis Cache reserved capacity using the two-step calculatePrice->purchase flow required by Azure's Reservations API (issue #677).
func (*Client) SetRecommendationsPager ¶
func (c *Client) SetRecommendationsPager(pager RecommendationsPager)
SetRecommendationsPager sets the recommendations pager (for testing).
func (*Client) SetRedisCachesPager ¶
func (c *Client) SetRedisCachesPager(pager RedisCachesPager)
SetRedisCachesPager sets the Redis caches pager (for testing).
func (*Client) SetReservationsPager ¶
func (c *Client) SetReservationsPager(pager ReservationsDetailsPager)
SetReservationsPager sets the reservations pager (for testing).
func (*Client) ValidateOffering ¶
ValidateOffering validates that a Redis Cache SKU exists.
type HTTPClient ¶
HTTPClient interface for HTTP operations (enables mocking).
type RecommendationsPager ¶
type RecommendationsPager interface {
More() bool
NextPage(ctx context.Context) (armconsumption.ReservationRecommendationsClientListResponse, error)
}
RecommendationsPager interface for recommendations pager (enables mocking).
type RedisCachesPager ¶
type RedisCachesPager interface {
More() bool
NextPage(ctx context.Context) (armredis.ClientListBySubscriptionResponse, error)
}
RedisCachesPager interface for Redis caches pager (enables mocking).
type RedisPricing ¶
type RedisPricing struct {
HourlyRate float64
ReservationPrice float64
OnDemandPrice float64
Currency string
SavingsPercentage float64
}
RedisPricing contains pricing information for Redis Cache.
type ReservationsDetailsPager ¶
type ReservationsDetailsPager interface {
More() bool
NextPage(ctx context.Context) (armconsumption.ReservationsDetailsClientListResponse, error)
}
ReservationsDetailsPager interface for reservations details pager (enables mocking).