config

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Color        string
	LogLevel     string
	Profile      Profile
	ProfilesFile string
}

Config handles all overall configuration for the CLI

func (*Config) GetProfilesFolder

func (c *Config) GetProfilesFolder(xdgPath string) string

GetProfilesFolder retrieves the folder where the profiles file is stored It searches for the xdg environment path first and will secondarily place it in the home directory

func (*Config) InitConfig

func (c *Config) InitConfig()

InitConfig reads in profiles file and ENV variables if set.

type Profile

type Profile struct {
	DeviceName  string
	ProfileName string
	SecretKey   string
}

Profile handles all things related to managing the project specific configurations

func (*Profile) CreateProfile

func (p *Profile) CreateProfile() error

CreateProfile creates a profile when logging in

func (*Profile) GetConfigField

func (p *Profile) GetConfigField(field string) string

GetConfigField returns the configuration field for the specific profile

func (*Profile) GetDeviceName

func (p *Profile) GetDeviceName() (string, error)

GetDeviceName returns the configured device name

func (*Profile) GetSecretKey

func (p *Profile) GetSecretKey() (string, error)

GetSecretKey will return the existing key for the given profile

Jump to

Keyboard shortcuts

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