cloud

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudProviderInterface

type CloudProviderInterface interface {
	// Deploy deploys a new instance
	Deploy(Vm) (Vm, error)
	// Destroy destroys an instance
	Destroy(Vm) error
	// List lists all instances
	List() (VmList, error)
	// CreateSSHKey creates a new SSH key
	CreateSSHKey(publicKeyFile string) (keyID string, err error)
	// SSHInto connects to a VM
	SSHInto(serverName string)
}

type ProviderAws

type ProviderAws struct {
	Client *ec2.EC2
}

func (ProviderAws) CreateSSHKey

func (p ProviderAws) CreateSSHKey(publicKeyFile string) (keyID string, err error)

func (ProviderAws) Deploy

func (p ProviderAws) Deploy(server Vm) (Vm, error)

func (ProviderAws) Destroy

func (p ProviderAws) Destroy(server Vm) error

func (ProviderAws) List

func (p ProviderAws) List() (VmList, error)

func (ProviderAws) SSHInto

func (p ProviderAws) SSHInto(serverName string)

type ProviderAzure

type ProviderAzure struct {
	VmClient       *armcompute.VirtualMachinesClient
	NicClient      *armnetwork.InterfacesClient
	PublicIPClient *armnetwork.PublicIPAddressesClient
	SSHKeyClient   *armcompute.SSHPublicKeysClient
}

func (ProviderAzure) CreateSSHKey

func (p ProviderAzure) CreateSSHKey(publicKeyFileName string) (string, error)

func (ProviderAzure) Deploy

func (p ProviderAzure) Deploy(server Vm) (Vm, error)

func (ProviderAzure) Destroy

func (p ProviderAzure) Destroy(server Vm) error

func (ProviderAzure) List

func (p ProviderAzure) List() (VmList, error)

func (ProviderAzure) SSHInto

func (p ProviderAzure) SSHInto(serverName string)

type ProviderHetzner

type ProviderHetzner struct {
	Client *hcloud.Client
}

func (ProviderHetzner) CreateSSHKey

func (p ProviderHetzner) CreateSSHKey(publicKeyFile string) (keyID string, err error)

func (ProviderHetzner) Deploy

func (p ProviderHetzner) Deploy(server Vm) (Vm, error)

func (ProviderHetzner) Destroy

func (p ProviderHetzner) Destroy(server Vm) error

func (ProviderHetzner) List

func (p ProviderHetzner) List() (VmList, error)

func (ProviderHetzner) SSHInto

func (p ProviderHetzner) SSHInto(serverName string)

type Vm

type Vm struct {
	// ID is the ID of the instance
	ID string
	// Name is the name of the instance
	Name string
	// IP is the public IP of the instance
	IP string
	// Type is the type of the instance
	Type string
	// Status is the status of the instance
	Status string
	// Location is the location of the instance
	Location string
	// SSHKeyID is the ID of the SSH key
	SSHKeyID string
	// ExposePorts is the list of ports to expose
	ExposePorts []int64
	// CreatedAt is the creation date of the instance
	CreatedAt time.Time
}

func (Vm) String

func (v Vm) String() string

type VmList

type VmList struct {
	List []Vm
}

Jump to

Keyboard shortcuts

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