Documentation
¶
Index ¶
- Constants
- type Config
- type Profile
- func (p *Profile) CreateProfile() error
- func (p *Profile) DeleteConfigField(field string) error
- func (p *Profile) GetAPIKey() (string, error)
- func (p *Profile) GetColor() (string, error)
- func (p *Profile) GetConfigField(field string) string
- func (p *Profile) GetDeviceName() (string, error)
- func (p *Profile) GetDisplayName() string
- func (p *Profile) GetTeamName() string
- func (p *Profile) GetTerminalPOSDeviceID() string
- func (p *Profile) RegisterAlias(alias, key string)
- func (p *Profile) WriteConfigField(field, value string) error
Constants ¶
const ColorAuto = "auto"
ColorAuto represents the auto-state for colors
const ColorOff = "off"
ColorOff represents the off-state for colors
const ColorOn = "on"
ColorOn represnets the on-state for colors
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Color string LogLevel string Profile Profile ProfilesFile string APIBaseURL string DashboardBaseURL string Insecure bool }
Config handles all overall configuration for the CLI
func (*Config) EditConfig ¶
EditConfig opens the configuration file in the default editor.
func (*Config) GetConfigFolder ¶
GetConfigFolder 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.
func (*Config) PrintConfig ¶ added in v0.5.1
PrintConfig outputs the contents of the configuration file.
func (*Config) RemoveAllProfiles ¶
RemoveAllProfiles removes all the profiles from the config file.
func (*Config) RemoveProfile ¶ added in v0.5.1
RemoveProfile removes the profile whose name matches the provided profileName from the config file.
type Profile ¶
type Profile struct { Config *Config DeviceName string ProfileName string TeamName string APIKey string ClientID string DisplayName string }
Profile handles all things related to managing the project specific configurations
func (*Profile) CreateProfile ¶ added in v0.5.1
CreateProfile creates a profile when logging in
func (*Profile) DeleteConfigField ¶ added in v0.5.1
DeleteConfigField deletes a configuration field.
func (*Profile) GetAPIKey ¶ added in v0.5.1
GetAPIKey will return the existing key for the given profile
func (*Profile) GetColor ¶ added in v0.5.1
GetColor gets the color setting for the user based on the flag or the persisted color stored in the config file
func (*Profile) GetConfigField ¶
GetConfigField returns the configuration field for the specific profile
func (*Profile) GetDeviceName ¶ added in v0.5.1
GetDeviceName returns the configured device name
func (*Profile) GetDisplayName ¶ added in v0.5.1
GetDisplayName returns the account display name of the user
func (*Profile) GetTeamName ¶ added in v0.5.1
GetDisplayName returns the account display name of the team
func (*Profile) GetTerminalPOSDeviceID ¶ added in v0.5.1
GetTerminalPOSDeviceID returns the device id from the config for Terminal quickstart to use
func (*Profile) RegisterAlias ¶ added in v0.5.1
RegisterAlias registers an alias for a given key.
func (*Profile) WriteConfigField ¶ added in v0.5.1
WriteConfigField updates a configuration field and writes the updated configuration to disk.