cloud

package
v0.0.0-...-2c4dd60 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Err404 = errors.New("not found")
)

Functions

This section is empty.

Types

type Client

type Client interface {
	CreateStack(ctx context.Context, opts CreateStackOptions) error
	SSHKeys(ctx context.Context) ([]SSHKey, error)
	Regions(ctx context.Context) ([]Region, error)
	InstanceTypes(ctx context.Context) ([]InstanceType, error)
	Images(ctx context.Context) ([]Image, error)
}

func NewClient

func NewClient(provider, apiKey string) (Client, error)

type CreateStackOptions

type CreateStackOptions struct {
	FirstStateURI string `json:"firstStateURI"`
	AdminAddress  string `json:"adminAddress"`

	DomainName       string `json:"domainName"`
	DomainEmail      string `json:"domainEmail"`
	InstanceLabel    string `json:"instanceLabel"`
	InstanceRegion   string `json:"instanceRegion"`
	InstancePassword string `json:"instancePassword"`
	InstanceType     string `json:"instanceType"`
	InstanceImage    string `json:"instanceImage"`
	InstanceSSHKey   string `json:"instanceSSHKey"`
}

type Image

type Image struct {
	ID          string `json:"id"`
	Label       string `json:"label"`
	Description string `json:"description"`
	Type        string `json:"type"`
	Vendor      string `json:"vendor"`
	Size        int    `json:"size"`
}

type InstanceType

type InstanceType struct {
	ID           string  `json:"id"`
	DiskSpaceMB  int     `json:"diskSpaceMB"`
	MemoryMB     int     `json:"memoryMB"`
	NumCPUs      int     `json:"numCPUs"`
	HourlyPrice  float32 `json:"hourlyPrice"`
	MonthlyPrice float32 `json:"monthlyPrice"`
}

type LinodeClient

type LinodeClient struct {
	// contains filtered or unexported fields
}

func NewLinodeClient

func NewLinodeClient(apiKey string) *LinodeClient

func (*LinodeClient) CreateStack

func (c *LinodeClient) CreateStack(ctx context.Context, opts CreateStackOptions) (err error)

func (*LinodeClient) Images

func (c *LinodeClient) Images(ctx context.Context) ([]Image, error)

func (*LinodeClient) InstanceTypes

func (c *LinodeClient) InstanceTypes(ctx context.Context) ([]InstanceType, error)

func (*LinodeClient) Regions

func (c *LinodeClient) Regions(ctx context.Context) ([]Region, error)

func (*LinodeClient) SSHKeys

func (c *LinodeClient) SSHKeys(ctx context.Context) ([]SSHKey, error)

type Region

type Region struct {
	ID  string `json:"id"`
	Geo string `json:"geo"`
}

type SSHKey

type SSHKey struct {
	Label string `json:"label"`
}

Jump to

Keyboard shortcuts

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