Help us shape the future of Go! Take the 2026 Go Developer Survey

qoder

package
v0.1.1525 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: MIT, MIT Imports: 3 Imported by: 0

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

View Source
const CNProviderKey = "qoder-cn"

CNProviderKey is how magpie names the Qoder CN subscription; it is also the id of Qoder CN's CLI agent.

View Source
const ProviderKey = "qoder"

ProviderKey is how magpie names this subscription.

Variables

View Source
var CN = &Site{ID: CNProviderKey, Name: "Qoder CN"}

CN is qoder.cn.

View Source
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.

type Site added in v0.1.528

type Site struct {
	ID   string // the provider id magpie keeps its accounts under
	Name string
}

Site is one Qoder deployment.

func SiteOf added in v0.1.528

func SiteOf(id string) *Site

SiteOf is the site a provider id or a credential's Site names; anything but Qoder CN, including none, is the global site.

Jump to

Keyboard shortcuts

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