server

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProviderDigitalOcean = types.ProviderDigitalOcean
	ProviderHetzner      = types.ProviderHetzner
	ServerStatusPending  = types.ServerStatusPending
	ServerStatusStarting = types.ServerStatusStarting
	ServerStatusRunning  = types.ServerStatusRunning
	ServerStatusStopped  = types.ServerStatusStopped
	ServerStatusError    = types.ServerStatusError
	ServerStatusUnknown  = types.ServerStatusUnknown
)

Re-export constants

Variables

View Source
var (
	SupportedProviders = types.SupportedProviders
	DefaultImage       = types.DefaultImage
)

Re-export functions

View Source
var DefaultSSHKeyPaths = []string{"~/.ssh/id_ed25519.pub", "~/.ssh/id_rsa.pub"}

DefaultSSHKeyPaths contains the default locations to look for SSH public keys.

Functions

func GetProviderToken

func GetProviderToken(provider ProviderName, ui cli.Ui) (string, error)

GetProviderToken retrieves the API token for a provider from environment or prompts the user.

func LoadSSHKey

func LoadSSHKey(paths []string) (keyPath string, contents []byte, publicKey ssh.PublicKey, err error)

LoadSSHKey attempts to load an SSH public key from the given paths. Returns the path of the loaded key, its contents, and the parsed public key.

func SSHKeyFingerprint

func SSHKeyFingerprint(publicKey ssh.PublicKey) string

SSHKeyFingerprint returns the MD5 fingerprint of an SSH public key.

func WaitForSSH

func WaitForSSH(ctx context.Context, host string) error

WaitForSSH waits for SSH to become available on the given host. It polls port 22 until a connection can be established or the context is cancelled.

Types

type CreateServerOptions

type CreateServerOptions = types.CreateServerOptions

Re-export types for convenience

type DNSProvider

type DNSProvider = types.DNSProvider

Re-export types for convenience

type DNSRecord

type DNSRecord = types.DNSRecord

Re-export types for convenience

type Provider

type Provider = types.Provider

Re-export types for convenience

func NewProvider

func NewProvider(name ProviderName, token string) (Provider, error)

NewProvider creates a new provider instance based on the provider name.

type ProviderName

type ProviderName = types.ProviderName

Re-export types for convenience

type ProviderWithDNS

type ProviderWithDNS = types.ProviderWithDNS

Re-export types for convenience

func NewProviderWithDNS

func NewProviderWithDNS(name ProviderName, token string) (ProviderWithDNS, error)

NewProviderWithDNS creates a provider that supports DNS management.

type Region

type Region = types.Region

Re-export types for convenience

type SSHKey

type SSHKey = types.SSHKey

Re-export types for convenience

type Server

type Server = types.Server

Re-export types for convenience

type ServerStatus

type ServerStatus = types.ServerStatus

Re-export types for convenience

type Size

type Size = types.Size

Re-export types for convenience

type Zone

type Zone = types.Zone

Re-export types for convenience

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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