instancetypes

package
v3.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: Apache-2.0 Imports: 13 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CacheFileName = "ec2-instance-types.json"

Functions

This section is empty.

Types

type Details

type Details struct {
	ec2types.InstanceTypeInfo
	OndemandPricePerHour *float64
	SpotPrice            *float64
}

Details hold all the information on an ec2 instance type.

type Provider

type Provider struct {
	Region         string
	DirectoryPath  string
	FullRefreshTTL time.Duration
	// contains filtered or unexported fields
}

func LoadFromOrNew

func LoadFromOrNew(directoryPath string, region string, ttl time.Duration, ec2Client ec2.DescribeInstanceTypesAPIClient) (*Provider, error)

NewProvider creates a new Instance Types provider used to fetch Instance Type information from EC2 and optionally cache.

func NewProvider

func NewProvider(region string, ec2Client ec2.DescribeInstanceTypesAPIClient) *Provider

NewProvider creates a new Instance Types provider used to fetch Instance Type information from EC2.

func (*Provider) CacheCount

func (p *Provider) CacheCount() int

func (*Provider) Clear

func (p *Provider) Clear() error

func (*Provider) Get

func (p *Provider) Get(ctx context.Context, instanceTypes []ec2types.InstanceType) ([]*Details, error)

func (*Provider) Save

func (p *Provider) Save() error

func (*Provider) SetLogger

func (p *Provider) SetLogger(logger *log.Logger)

Jump to

Keyboard shortcuts

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