pricing

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Price

type Price struct {
	// InstanceType is the instance type name
	InstanceType string

	// Zone is the availability zone
	Zone string

	// HourlyPrice is the cost per hour for the instance type
	HourlyPrice float64

	// Currency is the currency of the price (e.g., USD)
	Currency string
}

Price represents pricing information for an IBM Cloud instance type

type Provider

type Provider interface {
	// GetPrice returns the hourly price for the specified instance type in the given zone
	GetPrice(ctx context.Context, instanceType string, zone string) (float64, error)

	// GetPrices returns a map of instance type to price for all instance types in the given zone
	GetPrices(ctx context.Context, zone string) (map[string]float64, error)

	// Refresh updates the cached pricing information
	Refresh(ctx context.Context) error
}

Provider defines the interface for retrieving IBM Cloud pricing information

Jump to

Keyboard shortcuts

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