stubs

package
v0.0.0-...-f733b5b Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package stubs provides testable stubs for clients.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComputeStub

type ComputeStub struct {
	SavedFirewallRule           *compute.Firewall
	SavedCreateSnapshots        map[string]compute.Snapshot
	StubbedListProjectSnapshots *compute.SnapshotList
	StubbedListDisks            *compute.DiskList
}

ComputeStub provides a stub for the compute client.

func (*ComputeStub) CreateSnapshot

func (c *ComputeStub) CreateSnapshot(ctx context.Context, _, _, disk string, rb *compute.Snapshot) (*compute.Operation, error)

CreateSnapshot creates a snapshot of a specified persistent disk.

func (*ComputeStub) DeleteDiskSnapshot

func (c *ComputeStub) DeleteDiskSnapshot(_, _ string) (*compute.Operation, error)

DeleteDiskSnapshot deletes a snapshot.

func (*ComputeStub) ListDisks

func (c *ComputeStub) ListDisks(ctx context.Context, _, _ string) (*compute.DiskList, error)

ListDisks returns a list of disks.

func (*ComputeStub) ListProjectSnapshots

func (c *ComputeStub) ListProjectSnapshots(context.Context, string) (*compute.SnapshotList, error)

ListProjectSnapshots returns a list of snapshot resources.

func (*ComputeStub) PatchFirewallRule

func (c *ComputeStub) PatchFirewallRule(_, _ string, rb *compute.Firewall) (*compute.Operation, error)

PatchFirewallRule updates the firewall rule for the given project.

func (*ComputeStub) SetLabels

SetLabels sets the labels on a snapshot.

func (*ComputeStub) WaitGlobal

func (c *ComputeStub) WaitGlobal(_ string, _ *compute.Operation) []error

WaitGlobal waits globally.

func (*ComputeStub) WaitZone

func (c *ComputeStub) WaitZone(_, _ string, _ *compute.Operation) []error

WaitZone zone waits at the zone level.

type ResourceManagerStub

type ResourceManagerStub struct {
	GetPolicyResponse   *crm.Policy
	GetAncestryResponse *crm.GetAncestryResponse
	SavedSetPolicy      *crm.Policy
}

ResourceManagerStub provides a stub for the CRM client.

func (*ResourceManagerStub) GetAncestry

GetProjectAncestry is a stub of Cloud Resource Manager's GetAncestry.

func (*ResourceManagerStub) GetPolicyProject

func (s *ResourceManagerStub) GetPolicyProject(ctx context.Context, projectID string) (*crm.Policy, error)

GetPolicyProject is a stub of Cloud Resource Manager's GetIamPolicy.

func (*ResourceManagerStub) SetPolicyProject

func (s *ResourceManagerStub) SetPolicyProject(ctx context.Context, projectID string, p *crm.Policy) (*crm.Policy, error)

SetPolicyProject is a stub of Cloud Resource Manager's SetIamPolicy.

type StorageStub

type StorageStub struct {
	RemovedBucketUsers storage.ACLEntity
	// contains filtered or unexported fields
}

StorageStub provides a stub for the Storage client.

func (*StorageStub) RemoveBucketUsers

func (s *StorageStub) RemoveBucketUsers(ctx context.Context, bucketName string, entity storage.ACLEntity) error

RemoveBucketUsers removes the users from the given bucket.

Jump to

Keyboard shortcuts

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