driver

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: MPL-2.0 Imports: 25 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DiskForExportName = "disk-for-export"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Project                         string
	BaseEndpoint                    string
	ServiceAccountAuthorizedKeyPath string
	Token                           string
	CleanupTimeout                  time.Duration
}

type CreateDiskParams

type CreateDiskParams struct {
	DiskName    string
	DiskType    string
	Size        bytesize.ByteSize
	Iops        int64
	ImageRef    *computeref.ImageRef
	SnapshotRef *computeref.SnapshotRef
	Zone        string
}

type CreateExternalAddressParams

type CreateExternalAddressParams struct {
	ExternalAddressName string
}

type CreateFirewallRuleParams

type CreateFirewallRuleParams struct {
	NetworkName                   string
	FirewallRuleName              string
	VirtualMachineInternalAddress string
}

type CreateImageParams

type CreateImageParams struct {
	ImageName        string
	ImageDisplayName string
	ImageDescription string
	DiskRef          *computeref.DiskRef
}

type CreateNetworkParams

type CreateNetworkParams struct {
	NetworkName string
}

type CreateSubnetParams

type CreateSubnetParams struct {
	NetworkName string
	SubnetName  string
	SubnetCidr  cidraddress.CIDR4Address
}

type CreateVirtualMachineParams

type CreateVirtualMachineParams struct {
	VirtualMachineName string
	VMType             string
	Zone               string
	SSHUsername        string
	SSHPublicKey       string
	CloudConfig        string
	ServiceAccountRef  *iamref.ServiceAccountRef
	DiskRef            *computeref.DiskRef
	ExternalAddressRef *vpcref.ExternalAddressRef
	SubnetRef          *vpcref.SubnetRef
}

type Driver

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

func NewDriver

func NewDriver(ctx context.Context, c Config) (*Driver, error)

func (*Driver) AttachDiskToVirtualMachine

func (d *Driver) AttachDiskToVirtualMachine(ctx context.Context, vmName string, diskRef computeref.DiskRef) error

func (*Driver) CreateDisk

func (d *Driver) CreateDisk(ctx context.Context, params CreateDiskParams) error

func (*Driver) CreateExternalAddress

func (d *Driver) CreateExternalAddress(ctx context.Context, params CreateExternalAddressParams) (*ipaddress.IPAddress, error)

func (*Driver) CreateFirewallRule

func (d *Driver) CreateFirewallRule(ctx context.Context, params CreateFirewallRuleParams) error

func (*Driver) CreateHMACKey

func (d *Driver) CreateHMACKey(ctx context.Context, serviceAccount, name string) (string, string, error)

func (*Driver) CreateImage

func (*Driver) CreateNetwork

func (d *Driver) CreateNetwork(ctx context.Context, params CreateNetworkParams) error

func (*Driver) CreateSubnet

func (d *Driver) CreateSubnet(ctx context.Context, params CreateSubnetParams) error

func (*Driver) CreateVirtualMachine

func (d *Driver) CreateVirtualMachine(ctx context.Context, params CreateVirtualMachineParams) (*ipaddress.IPAddress, error)

func (*Driver) DeleteDisk

func (d *Driver) DeleteDisk(ctx context.Context, diskName string) error

func (*Driver) DeleteExternalAddress

func (d *Driver) DeleteExternalAddress(ctx context.Context, externalAddressName string) error

func (*Driver) DeleteFirewallRule

func (d *Driver) DeleteFirewallRule(ctx context.Context, networkName, firewallRuleName string) error

func (*Driver) DeleteHMACKey

func (d *Driver) DeleteHMACKey(ctx context.Context, serviceAccount string, name string) error

func (*Driver) DeleteImage

func (d *Driver) DeleteImage(ctx context.Context, imageName string) error

func (*Driver) DeleteNetwork

func (d *Driver) DeleteNetwork(ctx context.Context, networkName string) error

func (*Driver) DeleteSubnet

func (d *Driver) DeleteSubnet(ctx context.Context, networkName, subnetName string) error

func (*Driver) DeleteVirtualMachine

func (d *Driver) DeleteVirtualMachine(ctx context.Context, virtualMachineName string) error

func (*Driver) DetachSecondaryDisksFromVirtualMachine

func (d *Driver) DetachSecondaryDisksFromVirtualMachine(ctx context.Context, virtualMachineName string) error

func (*Driver) GetImage

func (*Driver) ImportImage added in v0.5.0

type ImportImageParams added in v0.5.0

type ImportImageParams struct {
	ImageName        string
	ImageDisplayName string
	ImageDescription string
	ExternalURL      string
}

Jump to

Keyboard shortcuts

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