civo

package
v0.1.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: 13 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(name string) 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 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