Documentation
¶
Index ¶
- type Prefs
- type Profile
- type Store
- func (s *Store) Add(nickname, userName, email, signKey, sshKey, ghUser string) error
- func (s *Store) BakCreated() bool
- func (s *Store) ConfigDir() string
- func (s *Store) Get(nickname string) (*Profile, error)
- func (s *Store) GetActive() (*Profile, error)
- func (s *Store) GetByEmail(email string) *Profile
- func (s *Store) ImportCurrent() error
- func (s *Store) Load() ([]Profile, error)
- func (s *Store) LoadPrefs() (Prefs, error)
- func (s *Store) Remove(nickname string) error
- func (s *Store) Save(profiles []Profile) error
- func (s *Store) SavePrefs(p Prefs) error
- func (s *Store) SetActive(nickname string) error
- func (s *Store) Update(nickname string, updated Profile) error
- func (s *Store) WasMigrated() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Prefs ¶
type Prefs struct {
ColorTheme int `json:"color_theme"`
SplashSeen020 bool `json:"splash_seen_020"`
ShellEnabled bool `json:"shell_enabled"`
// ShowUsername toggles the Accounts secondary column between email
// (zero value / default) and the GitHub username.
ShowUsername bool `json:"show_username"`
ShellAlias string `json:"shell_alias"`
ShellAliasDisabled bool `json:"shell_alias_disabled"` // zero value = enabled (default on)
ArcadeHiScore int `json:"arcade_hi_score,omitempty"`
ArcadeMode bool `json:"arcade_mode,omitempty"`
// AutoPinDisabled turns off auto-pinning the active account to a repo once
// it's been used there AutoPinThreshold times. Zero value = enabled (default on).
AutoPinDisabled bool `json:"auto_pin_disabled"`
}
type Profile ¶
type Profile struct {
Nickname string `json:"nickname" yaml:"nickname"`
UserName string `json:"user_name" yaml:"user_name"`
Email string `json:"email" yaml:"email"`
SignKey string `json:"sign_key,omitempty" yaml:"sign_key,omitempty"`
SSHKey string `json:"ssh_key,omitempty" yaml:"ssh_key,omitempty"`
GHUser string `json:"gh_user,omitempty" yaml:"gh_user,omitempty"`
TokenRef string `json:"token_ref,omitempty" yaml:"token_ref,omitempty"`
Active bool `json:"active" yaml:"active"`
}
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) BakCreated ¶
BakCreated reports whether the .v1.bak backup file was successfully created during migration. False means profiles.json may still be present.
func (*Store) GetByEmail ¶ added in v0.3.0
GetByEmail returns the profile owning an email address, or nil if none does. Matching is case-insensitive: git config casing need not match what was saved. Used to recognise an identity gitswitch did not write (a hand-configured repo).
func (*Store) ImportCurrent ¶
func (*Store) WasMigrated ¶
WasMigrated reports whether Load() performed a first-run migration from profiles.json to config.yaml during this session.
Click to show internal directories.
Click to hide internal directories.