Documentation ¶
Index ¶
- Constants
- func NewComputeService(oauthClient *http.Client) (*computeService, error)
- type GCPComputeService
- type GCPComputeServiceMock
- func (c *GCPComputeServiceMock) BasePath() string
- func (c *GCPComputeServiceMock) InstancesDelete(requestId string, project string, zone string, instance string) (*compute.Operation, error)
- func (c *GCPComputeServiceMock) InstancesGet(project string, zone string, instance string) (*compute.Instance, error)
- func (c *GCPComputeServiceMock) InstancesInsert(project string, zone string, instance *compute.Instance) (*compute.Operation, error)
- func (c *GCPComputeServiceMock) TargetPoolsAddInstance(project string, region string, name string, instance string) (*compute.Operation, error)
- func (c *GCPComputeServiceMock) TargetPoolsGet(project string, region string, name string) (*compute.TargetPool, error)
- func (c *GCPComputeServiceMock) TargetPoolsRemoveInstance(project string, region string, name string, instance string) (*compute.Operation, error)
- func (c *GCPComputeServiceMock) ZoneOperationsGet(project string, zone string, operation string) (*compute.Operation, error)
- func (c *GCPComputeServiceMock) ZonesGet(project string, zone string) (*compute.Zone, error)
Constants ¶
View Source
const ( NoMachinesInPool = "NoMachinesInPool" WithMachineInPool = "WithMachineInPool" )
Variables ¶
This section is empty.
Functions ¶
func NewComputeService ¶
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 (*GCPComputeServiceMock) InstancesGet ¶
func (*GCPComputeServiceMock) InstancesInsert ¶
func (*GCPComputeServiceMock) TargetPoolsAddInstance ¶
func (*GCPComputeServiceMock) TargetPoolsGet ¶
func (c *GCPComputeServiceMock) TargetPoolsGet(project string, region string, name string) (*compute.TargetPool, error)
func (*GCPComputeServiceMock) TargetPoolsRemoveInstance ¶
func (*GCPComputeServiceMock) ZoneOperationsGet ¶
Click to show internal directories.
Click to hide internal directories.