instance

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AbandonedInstance

type AbandonedInstance struct {
	*computepb.Instance
}

AbandonedInstance handles the instance struct

func (*AbandonedInstance) DaysAgoCreated

func (a *AbandonedInstance) DaysAgoCreated() int64

func (*AbandonedInstance) DaysAgoStarted

func (a *AbandonedInstance) DaysAgoStarted() int64

func (*AbandonedInstance) DaysAgoStopped

func (a *AbandonedInstance) DaysAgoStopped() int64

func (*AbandonedInstance) GetCost

func (a *AbandonedInstance) GetCost(skus *catalogue.SKUs) float64

GetCost returns the instance cost

type AbandonedInstances

type AbandonedInstances []*AbandonedInstance

AbandonedInstances handles the instances struct

func (AbandonedInstances) GetCost

func (i AbandonedInstances) GetCost(skus *catalogue.SKUs) float64

GetCost returns the sum of the disks' cost

func (AbandonedInstances) GetCount

func (i AbandonedInstances) GetCount() int

GetCount returns the number of instances

type Service

type Service interface {
	List(ctx context.Context, filter string) (*AbandonedInstances, error)
	FilterAbandoned(instances *AbandonedInstances, days int) error
	Table(instances *AbandonedInstances, skus *catalogue.SKUs) table.Writer
	Close() error
}

Service Implements the instance service

func New

func New(ctx context.Context, project string, options []*option.ClientOption) (Service, error)

New returns a new instance service

Jump to

Keyboard shortcuts

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