civo

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Civo

type Civo struct {
	Civoer
	// contains filtered or unexported fields
}

Civo holds the Civoer interface and http client

func (*Civo) CreateCluster

func (c *Civo) CreateCluster(cluster *Cluster) error

CreateCluster calls create from the Civo API

func (*Civo) DeleteCluster

func (c *Civo) DeleteCluster(name string) error

DeleteCluster calls delete from the Civo API

func (*Civo) GetClusterId

func (c *Civo) GetClusterId(name string) (id string, err error)

GetClusterId gets an ID for a given cluster name

func (*Civo) GetClusterNames

func (c *Civo) GetClusterNames() ([]string, error)

GetClusterNames gets a list of Clusters from the Civo API

type CivoCtl

type CivoCtl struct {
	Client *Civo

	Dangerous bool
	// contains filtered or unexported fields
}

CivoCtl holds the config and interface for a Civo Controller

func NewCivoCtl

func NewCivoCtl(cfg *Config, token string, dangerous bool) *CivoCtl

NewCivoCtl configures a Civo interface

func (*CivoCtl) Config

func (a *CivoCtl) Config() *Config

Config returns a safe copy of CivoCtl cfg

func (*CivoCtl) SetConfig

func (a *CivoCtl) SetConfig(cfg *Config)

SetConfig sets a safe copy of CivoCtl cfg

type Civoer

type Civoer interface {
	GetClusterId(name string) (id string, err error)
	GetClusterNames() []string
	CreateCluster(name string) error
	DeleteCluster(name string) error
	// contains filtered or unexported methods
}

Civoer interfaces with the Civo API

type Cluster added in v0.3.0

type Cluster struct {
	ID                string        `json:"id"`
	Name              string        `json:"name"`
	Version           string        `json:"version"`
	Status            string        `json:"status"`
	Ready             bool          `json:"ready"`
	NumTargetNodes    int           `json:"num_target_nodes"`
	TargetNodesSize   string        `json:"target_nodes_size"`
	Kubeconfig        string        `json:"kubeconfig"`
	KubernetesVersion string        `json:"kubernetes_version"`
	DNSEntry          string        `json:"dns_entry"`
	Tags              []interface{} `json:"tags"`
}

type Clusters added in v0.3.0

type Clusters struct {
	Items []Cluster `json:"items"`
}

Clusters is the Civo API response for Clusters list

type Config

type Config struct {
	Clusters []struct {
		Name  string `yaml:"name"`
		Nodes int    `yaml:"nodes"`
	} `yaml:"Clusters"`
}

Config contains the list of Clusters CivoCtl will handle

func LoadConfig

func LoadConfig() (*Config, chan *Config)

LoadConfig returns a config from viper and updates channel

Jump to

Keyboard shortcuts

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