computeservice

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2019 License: Apache-2.0 Imports: 2 Imported by: 6

Documentation

Index

Constants

View Source
const (
	NoMachinesInPool  = "NoMachinesInPool"
	WithMachineInPool = "WithMachineInPool"
)

Variables

This section is empty.

Functions

func NewComputeService

func NewComputeService(oauthClient *http.Client) (*computeService, error)

NewComputeService return a new computeService

Types

type GCPComputeService

type GCPComputeService interface {
	InstancesDelete(requestId string, project string, zone string, instance string) (*compute.Operation, error)
	InstancesInsert(project string, zone string, instance *compute.Instance) (*compute.Operation, error)
	InstancesGet(project string, zone string, instance string) (*compute.Instance, error)
	ZonesGet(project string, zone string) (*compute.Zone, error)
	ZoneOperationsGet(project string, zone string, operation string) (*compute.Operation, error)
	BasePath() string
	TargetPoolsGet(project string, region string, name string) (*compute.TargetPool, error)
	TargetPoolsAddInstance(project string, region string, name string, instance string) (*compute.Operation, error)
	TargetPoolsRemoveInstance(project string, region string, name string, instance string) (*compute.Operation, error)
}

GCPComputeService is a pass through wrapper for google.golang.org/api/compute/v1/compute to enable tests to mock this struct and control behavior.

type GCPComputeServiceMock

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

func NewComputeServiceMock

func NewComputeServiceMock() (*compute.Instance, *GCPComputeServiceMock)

func (*GCPComputeServiceMock) BasePath

func (c *GCPComputeServiceMock) BasePath() string

func (*GCPComputeServiceMock) InstancesDelete

func (c *GCPComputeServiceMock) InstancesDelete(requestId string, project string, zone string, instance string) (*compute.Operation, error)

func (*GCPComputeServiceMock) InstancesGet

func (c *GCPComputeServiceMock) InstancesGet(project string, zone string, instance string) (*compute.Instance, error)

func (*GCPComputeServiceMock) InstancesInsert

func (c *GCPComputeServiceMock) InstancesInsert(project string, zone string, instance *compute.Instance) (*compute.Operation, error)

func (*GCPComputeServiceMock) TargetPoolsAddInstance

func (c *GCPComputeServiceMock) TargetPoolsAddInstance(project string, region string, name string, instance string) (*compute.Operation, error)

func (*GCPComputeServiceMock) TargetPoolsGet

func (c *GCPComputeServiceMock) TargetPoolsGet(project string, region string, name string) (*compute.TargetPool, error)

func (*GCPComputeServiceMock) TargetPoolsRemoveInstance

func (c *GCPComputeServiceMock) TargetPoolsRemoveInstance(project string, region string, name string, instance string) (*compute.Operation, error)

func (*GCPComputeServiceMock) ZoneOperationsGet

func (c *GCPComputeServiceMock) ZoneOperationsGet(project string, zone string, operation string) (*compute.Operation, error)

func (*GCPComputeServiceMock) ZonesGet

func (c *GCPComputeServiceMock) ZonesGet(project string, zone string) (*compute.Zone, error)

Jump to

Keyboard shortcuts

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