config

package
v1.0.26 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Filename string

Filename is set to a full filename if the default config file is overridden by a command-line switch

Functions

func CivoAPIClient

func CivoAPIClient() (*civogo.Client, error)

CivoAPIClient returns a civogo client using the current default API key

func DefaultAPIKey

func DefaultAPIKey() string

DefaultAPIKey returns the current default API key

func ReadConfig

func ReadConfig()

ReadConfig reads in config file and ENV variables if set.

func SaveConfig

func SaveConfig()

SaveConfig saves the current configuration back out to a JSON file in either ~/.civo.json or Filename if one was set

Types

type Config

type Config struct {
	APIKeys map[string]string `json:"apikeys"`
	Meta    struct {
		Admin              bool      `json:"admin"`
		CurrentAPIKey      string    `json:"current_apikey"`
		DefaultRegion      string    `json:"default_region"`
		LatestReleaseCheck time.Time `json:"latest_release_check"`
		URL                string    `json:"url"`
	} `json:"meta"`
}

Config describes the configuration for Civo's CLI

var Current Config

Current contains the parsed ~/.civo.json file

Jump to

Keyboard shortcuts

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