config

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 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 SaveUIState

func SaveUIState(state UIState) 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 (*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 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"`
}

func LoadUIState

func LoadUIState() (UIState, error)

Jump to

Keyboard shortcuts

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