instance

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Instance added in v1.1.0

type Instance struct {
	*computepb.Instance
}

AbandonedInstance handles the instance struct

func (*Instance) GetInstanceCost added in v1.1.0

func (i *Instance) GetInstanceCost(skus *billingsku.BillingSKUs) float64

GetCost returns the instance cost

func (*Instance) GetInstanceLastStart added in v1.1.0

func (i *Instance) GetInstanceLastStart() string

func (*Instance) GetInstanceType added in v1.1.0

func (i *Instance) GetInstanceType() string

func (*Instance) GetInstanceZone added in v1.1.0

func (i *Instance) GetInstanceZone() string

type Instances added in v1.1.0

type Instances []*Instance

Instances handles the instances struct

func (*Instances) GetAbandoned added in v1.1.3

func (i *Instances) GetAbandoned(days int) (*Instances, error)

GetAbandoned returns a slice of abandoned Instances

func (Instances) GetCost added in v1.1.0

func (i Instances) GetCost(skus *billingsku.BillingSKUs) float64

GetCost returns the sum costs

func (Instances) GetCount added in v1.1.0

func (i Instances) GetCount() int

GetCount returns the number of instances

type Service

type Service interface {
	List(ctx context.Context, filter string) (*Instances, error)
	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