config

package
v1.0.81 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 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             Metadata                  `json:"meta"`
	RegionToFeatures map[string]civogo.Feature `json:"region_to_features"`
}

Config describes the configuration for Civo's CLI

var Current Config

Current contains the parsed ~/.civo.json file

type Metadata added in v0.1.77

type Metadata 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"`
	LastCmdExecuted    time.Time `json:"last_command_executed"`
}

Metadata describes the metadata for Civo's CLI

Jump to

Keyboard shortcuts

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