Documentation
¶
Index ¶
- func ValidateName(name string) error
- type Check
- type DaemonState
- type Identity
- type Profile
- type Result
- type Store
- func (s *Store) AuthPath() string
- func (s *Store) Current() (string, bool, error)
- func (s *Store) Daemon() DaemonState
- func (s *Store) Doctor() []Check
- func (s *Store) Import(name string) (Result, error)
- func (s *Store) List() ([]string, string, error)
- func (s *Store) Login(name string, runLogin func(home string) error) (Result, error)
- func (s *Store) Logout(name string, runLogout func(home string) error) (Result, error)
- func (s *Store) Profiles() ([]Profile, error)
- func (s *Store) Purge(before func() error) error
- func (s *Store) Remove(name string) (Result, error)
- func (s *Store) Rename(oldName, newName string) (Result, error)
- func (s *Store) Show(name string) (Profile, error)
- func (s *Store) Sync() (Result, error)
- func (s *Store) Use(name string) (Result, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateName ¶ added in v0.3.0
Types ¶
type DaemonState ¶ added in v0.2.1
type Identity ¶ added in v0.2.0
type Identity struct {
AuthMode string `json:"auth_mode,omitempty"`
AccountID string `json:"account_id,omitempty"`
Email string `json:"email,omitempty"`
Plan string `json:"plan,omitempty"`
LastRefresh string `json:"last_refresh,omitempty"`
}
Identity never carries tokens or API keys, so it is safe to print.
type Store ¶
type Store struct {
CodexHome string
StateHome string
// DetectDaemon is daemon.Detect when nil.
DetectDaemon func(codexHome string) daemon.Status
}
func NewFromEnvironment ¶
func (*Store) Daemon ¶ added in v0.2.1
func (s *Store) Daemon() DaemonState
func (*Store) Logout ¶ added in v0.2.0
Logout revokes the session in an isolated home, then deletes the profile and an active auth.json of the same account.
func (*Store) Purge ¶ added in v0.3.0
Purge leaves the Codex home alone. before runs under the lock; if it fails nothing is removed.
func (*Store) Remove ¶ added in v0.2.0
Remove leaves the active auth.json, so Codex stays logged in.
Click to show internal directories.
Click to hide internal directories.