Documentation ¶
Index ¶
- type Config
- type Profile
- func (p *Profile) CreateProfile() error
- func (p *Profile) DeleteConfigField(field string) error
- func (p *Profile) GetAPIKey(livemode bool) (string, error)
- func (p *Profile) GetAPISecret(livemode bool) (string, error)
- func (p *Profile) GetConfigField(field string) string
- func (p *Profile) GetDeviceName() (string, error)
- func (p *Profile) GetDisplayName() string
- func (p *Profile) RegisterAlias(alias, key string)
- func (p *Profile) WriteConfigField(field, value string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
Config handles all overall configuration for the CLI
func (*Config) CreateProfile ¶
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 ¶
PrintConfig outputs the contents of the configuration file.
type Profile ¶
type Profile struct { DeviceName string ProfileName string APIKey string APISecret string LiveModeAPIKey string LiveModeAPISecret string TestModeAPIKey string TestModeAPISecret string DisplayName string }
Profile handles all things related to managing the project specific configurations
func (*Profile) CreateProfile ¶
CreateProfile creates a profile when logging in
func (*Profile) DeleteConfigField ¶
DeleteConfigField deletes a configuration field.
func (*Profile) GetAPISecret ¶
GetAPIKey will return the existing key for the given profile
func (*Profile) GetConfigField ¶
GetConfigField returns the configuration field for the specific profile
func (*Profile) GetDeviceName ¶
GetDeviceName returns the configured device name
func (*Profile) GetDisplayName ¶
GetDisplayName returns the account display name of the user
func (*Profile) RegisterAlias ¶
RegisterAlias registers an alias for a given key.
func (*Profile) WriteConfigField ¶
WriteConfigField updates a configuration field and writes the updated configuration to disk.