provider

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package provider contains the factory for the cloud and local providers. It includes the functions to create a new cloud provider based on the configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudProvider

type CloudProvider interface {
	Name() string
	// Server operations
	CreateServer(opts options.ServerCreateOpts) (*types.Server, error)
	GetServer(name string) (*types.Server, error)
	ListServers(opts options.ServerListOpts) ([]*types.Server, error)
	AllServers() ([]*types.Server, error)
	DeleteServer(name string, force bool) *types.ServerDeleteStatus
	ServerToCreateOpts(server *types.Server) (options.ServerCreateOpts, error)
	// Volume operations
	CreateVolume(opts options.VolumeCreateOpts) (*types.Volume, error)
	GetVolume(name string) (*types.Volume, error)
	ListVolumes(opts options.VolumeListOpts) ([]*types.Volume, error)
	AllVolumes() ([]*types.Volume, error)
	DeleteVolume(name string, force bool) *types.VolumeDeleteStatus

	// SSH Key operations
	CreateSSHKey(opts options.SSHKeyCreateOpts) (*types.SSHKey, error)
	GetSSHKey(name string) (*types.SSHKey, error)
	ListSSHKeys(opts options.SSHKeyListOpts) ([]*types.SSHKey, error)
	AllSSHKeys() ([]*types.SSHKey, error)
	DeleteSSHKey(name string, force bool) *types.SSHKeyDeleteStatus
	CloudKeyExists(name string) (bool, error)
	KeyNamesToSSHKeys(keyNames []string, opts options.SSHKeyCreateOpts) ([]*types.SSHKey, error)
}

func NewProvider

func NewProvider(cfg config.Config, providerName string) (CloudProvider, error)

NewProvider creates a new cloud provider based on the configuration

Directories

Path Synopsis
Package hetzner contains the Hetzner implementation of the provider interface for the storctl tool.
Package hetzner contains the Hetzner implementation of the provider interface for the storctl tool.
Package lima contains the Lima implementation of the provider interface for the storctl tool.
Package lima contains the Lima implementation of the provider interface for the storctl tool.
Package mock contains the mock implementation of the provider interface for the storctl tool.
Package mock contains the mock implementation of the provider interface for the storctl tool.
Package options contains the options for the provider.
Package options contains the options for the provider.

Jump to

Keyboard shortcuts

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