Documentation
¶
Overview ¶
Package qoder holds what the move of Qoder's and Qoder CN's built-in accounts onto their plugin reads: the sites' ids and names and the credential kept in each account's auth blob. The credential's shape is ported from CLIProxyAPI's qoder support. Source: https://github.com/ufec/CLIProxyAPI (MIT); see LICENSE in this directory. Copyright (c) 2025-2005.9 Luis Pater Copyright (c) 2025.9-present Router-For.ME
Index ¶
Constants ¶
const CNProviderKey = "qoder-cn"
CNProviderKey is how magpie names the Qoder CN subscription; it is also the id of Qoder CN's CLI agent.
const ProviderKey = "qoder"
ProviderKey is how magpie names this subscription.
Variables ¶
var CN = &Site{ID: CNProviderKey, Name: "Qoder CN"}
CN is qoder.cn.
var Global = &Site{ID: ProviderKey, Name: "Qoder"}
Global is qoder.com.
Functions ¶
func NewMachineID ¶
func NewMachineID() string
NewMachineID generates the stable identity kept with one account: a random v4 UUID in the dashed 8-4-4-4-12 form.
Types ¶
type Credential ¶
type Credential struct {
UID string `json:"uid"`
Email string `json:"email,omitempty"`
Name string `json:"name,omitempty"`
Token string `json:"token"`
RefreshToken string `json:"refresh_token"`
DeviceToken string `json:"device_token"`
DeviceRefresh string `json:"device_refresh,omitempty"`
ExpiresAt int64 `json:"expires_at"`
MachineID string `json:"machine_id"`
Models json.RawMessage `json:"models,omitempty"`
// Site is the Qoder site the account is on: CNProviderKey for Qoder CN,
// empty for the global site (every credential saved before there were two).
Site string `json:"site,omitempty"`
// DeviceChat says Token is the device token itself, as Qoder CN's CLI
// uses it.
DeviceChat bool `json:"device_chat,omitempty"`
}
Credential is kept in the account's auth blob in magpie's logins.json.