Documentation
¶
Index ¶
- Constants
- Variables
- func GetProviderToken(provider ProviderName, ui cli.Ui) (string, error)
- func LoadSSHKey(paths []string) (keyPath string, contents []byte, publicKey ssh.PublicKey, err error)
- func SSHKeyFingerprint(publicKey ssh.PublicKey) string
- func WaitForSSH(ctx context.Context, host string) error
- type CreateServerOptions
- type DNSProvider
- type DNSRecord
- type Provider
- type ProviderName
- type ProviderWithDNS
- type Region
- type SSHKey
- type Server
- type ServerStatus
- type Size
- type Zone
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 ¶
SSHKeyFingerprint returns the MD5 fingerprint of an SSH public key.
Types ¶
type CreateServerOptions ¶
type CreateServerOptions = types.CreateServerOptions
Re-export types for convenience
type 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 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.
Click to show internal directories.
Click to hide internal directories.