config

package
v2.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultDir string = "~/.vmpooler-bitbar"

DefaultDir is the default vmpooler-bitbar config directory

Variables

View Source
var DefaultConfig = Config{
	Endpoint:        "https://vmpooler.mycompany.net/api/v1",
	Token:           "myvmpoolertoken",
	LifetimeWarning: 1,
}

Functions

func Dir

func Dir() string

Dir returns path to the config dir

func EnsureConfigDir

func EnsureConfigDir() error

EnsureConfigDir creates a configDir() if it doesn't already exist

func File

func File() string

File returns path to the config file

Types

type Config

type Config struct {
	Endpoint        string `yaml:"endpoint"`
	Token           string `yaml:"token"`
	LifetimeWarning int    `yaml:"lifetimewarning"`
}

Config stores the vmpooler endpoint and user token

func Read

func Read() (Config, error)

Read config from the specified dir

Jump to

Keyboard shortcuts

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