cloud

package
v3.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2024 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package cloud contains the interfaces and shared types between cloud providers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider interface {
	// Status fetches the status of a remote instance
	Status(ctx context.Context, instanceID string) (ProviderStatus, error)

	// Start starts a remote instance
	Start(ctx context.Context, instanceID string) error

	// Stop stops a remote instance
	Stop(ctx context.Context, instanceID string) error

	// ShouldTerminate returns true if the instance should be terminated.
	ShouldTerminate(ctx context.Context) (bool, error)
}

Provider is a cloud provider

type ProviderStatus

type ProviderStatus string

ProviderStatus is the status of an instance

var (
	// StatusRunning denotes an instances is currently running and is able
	// to accept connections.
	StatusRunning ProviderStatus = "RUNNING"

	// StatusStopped denotes an instance is stopped and is not able to accept
	// connections, but can be started.
	StatusStopped ProviderStatus = "STOPPED"

	// StatusStopping denotes an instance is currently stopping and is not able
	// to accept connections or be started.
	StatusStopping ProviderStatus = "STOPPING"

	// StatusStarting denotes an instance is currently starting and is not able
	// to accept connections or be started.
	StatusStarting ProviderStatus = "STARTING"

	// StatusUnknown denotes an instance is in an unknown state and cannot be
	// determined. This is usually an error state.
	StatusUnknown ProviderStatus = "UNKNOWN"
)

Contains definitions for the ProviderStatus type

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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