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(_ context.Context, _ *common.RecommendationParams) ([]common.Recommendation, error)
- func (c *Client) GetRegion() string
- func (c *Client) GetServiceType() common.ServiceType
- func (c *Client) PurchaseCommitment(_ context.Context, rec common.Recommendation, _ common.PurchaseOptions) (common.PurchaseResult, error)
- func (c *Client) SetReservationsPager(pager ReservationsDetailsPager)
- type HTTPClient
- 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). When httpClient is nil, the SSRF-hardened httpclient.New() is used so the nil fallback also blocks IMDS connections. A non-nil httpClient is used as-is and bypasses that guard: metadata, NAT64/6to4 and unspecified addresses are dialable unless the caller's client blocks them itself.
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(_ context.Context, _ *common.RecommendationParams) ([]common.Recommendation, error)
GetRecommendations returns an empty slice: Azure Redis recommendations are collected, labeled ServiceMemoryDB, by the managedredis client. Collecting them here too would list every Redis recommendation twice, and a ServiceCache label routes the purchase to a client that must not buy Redis.
func (*Client) GetServiceType ¶
func (c *Client) GetServiceType() common.ServiceType
GetServiceType returns the service type.
func (*Client) PurchaseCommitment ¶
func (c *Client) PurchaseCommitment(_ context.Context, rec common.Recommendation, _ common.PurchaseOptions) (common.PurchaseResult, error)
PurchaseCommitment refuses: managedredis (ServiceMemoryDB) is the only Azure service that buys RedisCache reservations (#538), so one Redis recommendation cannot be bought twice.
func (*Client) SetReservationsPager ¶
func (c *Client) SetReservationsPager(pager ReservationsDetailsPager)
SetReservationsPager sets the reservations pager (for testing).
type HTTPClient ¶
HTTPClient interface for HTTP operations (enables mocking).
type RedisPricing ¶
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).