atlas

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnauthorized = errors.New("invalid API key")
)

Different errors the api may return.

Functions

This section is empty.

Types

type Client

type Client interface {
	GetProvider(name string) (*Provider, error)
}

Client is an interface for interacting with the Atlas API.

type HTTPClient

type HTTPClient struct {
	BaseURL string
	HTTP    *http.Client
}

HTTPClient is the main implementation of the Client interface which communicates with the Atlas API.

func NewClient

func NewClient(baseURL string, groupID string, publicKey string, privateKey string) *HTTPClient

NewClient will create a new HTTPClient with the specified connection details.

func (*HTTPClient) GetProvider

func (c *HTTPClient) GetProvider(name string) (*Provider, error)

GetProvider will find a provider by name using the private API. GET /cloudProviders/{NAME}/options

type InstanceSize

type InstanceSize struct {
	Name string `json:"name"`
}

InstanceSize represents an available cluster size.

type Provider

type Provider struct {
	Name          string `json:"@provider"`
	InstanceSizes map[string]InstanceSize
}

Provider represents a single cloud provider to which a cluster can be deployed.

Jump to

Keyboard shortcuts

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