instancetypes

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

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

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

func NewProvider

func NewProvider(directoryPath string, region string, ttl time.Duration, 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