tools

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

View Source
const (
	AlibabaCloudProvider = "alibabacloud"
	AWSCloudProvider     = "aws"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HandlerFunc

type HandlerFunc func(paras ...interface{})

type ParallelTask

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

func NewParallelTask

func NewParallelTask(handlerFunc HandlerFunc) *ParallelTask

func (*ParallelTask) Add

func (p *ParallelTask) Add(params []interface{})

func (*ParallelTask) Process

func (p *ParallelTask) Process()

type QueryClientImpl

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

func (*QueryClientImpl) GetInstanceDetails

func (q *QueryClientImpl) GetInstanceDetails(region, instanceType string) *apis.InstanceTypePrice

func (*QueryClientImpl) ListInstancesDetails

func (q *QueryClientImpl) ListInstancesDetails(region string) *apis.RegionalInstancePrice

func (*QueryClientImpl) ListRegions

func (q *QueryClientImpl) ListRegions() []string

func (*QueryClientImpl) Run

func (q *QueryClientImpl) Run(ctx context.Context)

func (*QueryClientImpl) Sync

func (q *QueryClientImpl) Sync() error

type QueryClientInterface

type QueryClientInterface interface {
	// Run is used to sync the data periodically
	Run(ctx context.Context)
	// Sync is used to sync the data manually if want to work with your own scheduling mechanism
	Sync() error
	// ListRegions returns a list of the supported regions
	ListRegions() []string
	// ListInstancesDetails returns the details of the supported instances in one region
	ListInstancesDetails(region string) *apis.RegionalInstancePrice
	// GetInstanceDetails returns the details of the specified instance
	GetInstanceDetails(region, instanceType string) *apis.InstanceTypePrice
}

func NewQueryClient

func NewQueryClient(endpoint, cloudProvider, region string) (QueryClientInterface, error)

Jump to

Keyboard shortcuts

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