config

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActiveIdentityKeys

func ActiveIdentityKeys(account *Account) []string

func ApplyAccountToCodex

func ApplyAccountToCodex(account *Account) (string, error)

func ApplyAccountToOpenCode

func ApplyAccountToOpenCode(account *Account) (string, error)

func ApplyAccountToTarget

func ApplyAccountToTarget(account *Account, target Source) (string, error)

func ApplyAccountToTargets

func ApplyAccountToTargets(account *Account, targets []Source) (map[Source]string, map[Source]error)

func CanonicalAccountID

func CanonicalAccountID(ids ...string) string

func DeleteAccountFromSource

func DeleteAccountFromSource(account *Account, source Source) error

func DeleteCodexAuthAccount

func DeleteCodexAuthAccount() error

func DeleteManagedAccount

func DeleteManagedAccount(accountID string) error

func DeleteManagedAccountByIdentity

func DeleteManagedAccountByIdentity(account *Account) error

func DeleteOpenCodeAuthAccount

func DeleteOpenCodeAuthAccount() error

func SaveAccount

func SaveAccount(account *Account) error

func SaveSettings added in v0.1.5

func SaveSettings(settings Settings) error

func SaveUIState

func SaveUIState(state UIState) error

func SaveUpdateState added in v0.1.5

func SaveUpdateState(state UpdateState) error

func SetDismissedUpdateVersion added in v0.1.5

func SetDismissedUpdateVersion(version string) error

func SyncAccountEverywhere added in v0.3.2

func SyncAccountEverywhere(account *Account) error

func UpsertManagedAccount

func UpsertManagedAccount(account *Account) error

Types

type AccessTokenClaims

type AccessTokenClaims struct {
	ClientID  string
	AccountID string
	ExpiresAt time.Time
	Email     string
}

func ParseAccessToken

func ParseAccessToken(token string) AccessTokenClaims

type Account

type Account struct {
	Key          string
	Label        string
	Email        string
	AccountID    string
	AccessToken  string
	RefreshToken string
	ExpiresAt    time.Time
	ClientID     string
	Source       Source
	FilePath     string
	Writable     bool
}

func LoadAllAccounts

func LoadAllAccounts() ([]*Account, error)

func LoadManagedAccounts

func LoadManagedAccounts() ([]*Account, error)

func ResolveFreshAccount added in v0.3.2

func ResolveFreshAccount(account *Account) (*Account, bool, error)

func (*Account) SourceLabel

func (a *Account) SourceLabel() string

type AccountsLoadResult

type AccountsLoadResult struct {
	Accounts                []*Account
	SourcesByAccountID      map[string][]string
	ActiveSourcesByIdentity map[string][]string
}

func LoadAllAccountsWithSources

func LoadAllAccountsWithSources() (AccountsLoadResult, error)

type Settings added in v0.1.5

type Settings struct {
	CheckForUpdateOnStartup bool `json:"check_for_update_on_startup"`
}

func DefaultSettings added in v0.1.5

func DefaultSettings() Settings

func LoadSettings added in v0.1.5

func LoadSettings() (Settings, error)

type Source

type Source string
const (
	SourceManaged  Source = "managed"
	SourceOpenCode Source = "opencode"
	SourceCodex    Source = "codex"
)

type UIState

type UIState struct {
	CompactMode          bool     `json:"compact_mode"`
	ExhaustedAccountKeys []string `json:"exhausted_account_keys"`
	AccountOrderKeys     []string `json:"account_order_keys"`
	ActiveAccountKey     string   `json:"active_account_key"`
}

func LoadUIState

func LoadUIState() (UIState, error)

type UpdateState added in v0.1.5

type UpdateState struct {
	LatestVersion    string    `json:"latest_version"`
	LastCheckedAt    time.Time `json:"last_checked_at"`
	DismissedVersion string    `json:"dismissed_version"`
}

func LoadUpdateState added in v0.1.5

func LoadUpdateState() (UpdateState, error)

Jump to

Keyboard shortcuts

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