memorydb

package
v0.0.0-...-16b5795 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2026 License: OSL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package memorydb provides AWS MemoryDB Reserved Nodes client

Index

Constants

View Source
const ReservedNodeEngine = "redis"

ReservedNodeEngine is the engine recorded on MemoryDB reserved nodes and recommendations. DescribeReservedNodes returns no engine field, so both sides of the dedupe key use this constant.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	PurchaseReservedNodesOffering(ctx context.Context, params *memorydb.PurchaseReservedNodesOfferingInput, optFns ...func(*memorydb.Options)) (*memorydb.PurchaseReservedNodesOfferingOutput, error)
	DescribeReservedNodesOfferings(ctx context.Context, params *memorydb.DescribeReservedNodesOfferingsInput, optFns ...func(*memorydb.Options)) (*memorydb.DescribeReservedNodesOfferingsOutput, error)
	DescribeReservedNodes(ctx context.Context, params *memorydb.DescribeReservedNodesInput, optFns ...func(*memorydb.Options)) (*memorydb.DescribeReservedNodesOutput, error)
}

API defines the interface for MemoryDB operations (enables mocking).

type Client

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

Client handles AWS MemoryDB Reserved Nodes.

func NewClient

func NewClient(cfg aws.Config) *Client

NewClient creates a new MemoryDB client with purchase-path retry/timeout settings. See purchasecfg for rationale.

func (*Client) GetExistingCommitments

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

GetExistingCommitments retrieves existing MemoryDB Reserved Nodes.

func (*Client) GetOfferingDetails

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

GetOfferingDetails retrieves offering details. All prices are per ONE reservation (callers multiply by rec.Count): UpfrontCost is FixedPrice, RecurringCost the hourly rate, TotalCost upfront plus hourly over the offering duration.

func (*Client) GetRecommendations

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

GetRecommendations returns empty as MemoryDB uses centralized Cost Explorer recommendations.

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) GetValidResourceTypes

func (c *Client) GetValidResourceTypes(ctx context.Context) ([]string, error)

GetValidResourceTypes returns valid MemoryDB node types by querying the API.

func (*Client) PurchaseCommitment

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

PurchaseCommitment purchases a MemoryDB Reserved Node.

func (*Client) SetMemoryDBAPI

func (c *Client) SetMemoryDBAPI(api API)

SetMemoryDBAPI sets a custom MemoryDB API client (for testing).

func (*Client) ValidateOffering

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

ValidateOffering checks if an offering exists without purchasing.

Jump to

Keyboard shortcuts

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