Documentation ¶
Overview ¶
Package serverprovider provides a way to interact with a server provider, e.g. Hetzner. It abstracts away the details of the provider like ordering, provisioning, getting available offerings, etc. It can be thought of as a generic API across all providers. All state is kept at the server provider itself--this means all IDs are server-provider specific and no state is shared across providers and no state is kept within Metal.
Index ¶
- Constants
- Variables
- type Addon
- type Equinix
- type EquinixOption
- type Hetzner
- type HetznerOption
- type OVH
- type OVHOption
- type Offering
- type Order
- type Price
- type Scaleway
- type ScalewayOption
- type Server
- type ServerProvider
- type ServerStatus
- type Transaction
- type TransactionStatus
- type Vultr
- type VultrOption
Constants ¶
View Source
const EquinixSlug = "equinix"
View Source
const HetznerSlug = "hetzner"
View Source
const OVHSlug = "ovh"
View Source
const ScalewaySlug = "scaleway"
View Source
const VultrSlug = "vultr"
Variables ¶
View Source
var ErrServerNotFound = errors.New("server not found")
View Source
var ErrTransactionNotFound = errors.New("transaction not found")
Functions ¶
This section is empty.
Types ¶
type Equinix ¶
type Equinix struct {
// contains filtered or unexported fields
}
func NewEquinix ¶
func NewEquinix(opts ...EquinixOption) (*Equinix, error)
func (*Equinix) GetCurrentOfferings ¶
func (*Equinix) GetTransaction ¶
func (e *Equinix) GetTransaction(id string) (Transaction, error)
func (*Equinix) OrderServer ¶
func (e *Equinix) OrderServer(order Order) (Transaction, error)
type EquinixOption ¶
func WithEquinixClient ¶
func WithEquinixClient(client *metal.APIClient) EquinixOption
type Hetzner ¶
type Hetzner struct {
// contains filtered or unexported fields
}
func NewHetzner ¶
func NewHetzner(opts ...HetznerOption) (*Hetzner, error)
func (*Hetzner) GetCurrentOfferings ¶
func (*Hetzner) GetTransaction ¶
func (h *Hetzner) GetTransaction(id string) (Transaction, error)
func (*Hetzner) OrderServer ¶
func (h *Hetzner) OrderServer(order Order) (Transaction, error)
type HetznerOption ¶
func WithAuthorizedKeyFingerprint ¶
func WithAuthorizedKeyFingerprint(fingerprint string) HetznerOption
func WithHrobotClient ¶
func WithHrobotClient(client *hrobot.Client) HetznerOption
func WithTestMode ¶
func WithTestMode(testMode bool) HetznerOption
type OVH ¶
type OVH struct {
// contains filtered or unexported fields
}
func (*OVH) GetCurrentOfferings ¶
func (*OVH) GetTransaction ¶
func (o *OVH) GetTransaction(id string) (Transaction, error)
func (*OVH) OrderServer ¶
func (o *OVH) OrderServer(order Order) (Transaction, error)
type OVHOption ¶
func WithOVHClient ¶
type Scaleway ¶
type Scaleway struct {
// contains filtered or unexported fields
}
func NewScaleway ¶
func NewScaleway(opts ...ScalewayOption) (*Scaleway, error)
func (*Scaleway) GetCurrentOfferings ¶
func (*Scaleway) GetTransaction ¶
func (s *Scaleway) GetTransaction(id string) (Transaction, error)
func (*Scaleway) OrderServer ¶
func (s *Scaleway) OrderServer(order Order) (Transaction, error)
type ScalewayOption ¶
func WithScalewayClient ¶
func WithScalewayClient(client *scw.Client) ScalewayOption
type ServerProvider ¶
type ServerStatus ¶
type ServerStatus string
const ( ServerStatusPending ServerStatus = "pending" ServerStatusRunning ServerStatus = "running" )
type Transaction ¶
type TransactionStatus ¶
type TransactionStatus string
const ( TransactionStatusPending TransactionStatus = "pending" TransactionStatusCompleted TransactionStatus = "completed" TransactionStatusCanceled TransactionStatus = "canceled" )
type Vultr ¶
type Vultr struct {
// contains filtered or unexported fields
}
func NewVultr ¶
func NewVultr(opts ...VultrOption) (*Vultr, error)
func (*Vultr) GetCurrentOfferings ¶
func (*Vultr) GetTransaction ¶
func (v *Vultr) GetTransaction(id string) (Transaction, error)
func (*Vultr) OrderServer ¶
func (v *Vultr) OrderServer(order Order) (Transaction, error)
type VultrOption ¶
func WithVultrClient ¶
func WithVultrClient(client *govultr.Client) VultrOption
Click to show internal directories.
Click to hide internal directories.