provider

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: MIT Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package provider names the two account providers ccdad manages.

It is a leaf on purpose: a store row, a switcher option, a proxy request and an export document all have to say which provider an account belongs to, and a type any of them can import without dragging a credential package behind it is what makes the never-cross checks cheap enough to put everywhere.

The two strings are the WIRE form. They are written into accounts.toml, into every --json payload and into export documents, so renaming one would make a stored account unreadable by the build that wrote it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ID

type ID string

ID is a provider's name.

It is a named string rather than a uint8 with a separate name field, and the difference decides the store's shape: go-toml round-trips a named string type directly, so one field carries both the value and its serialized form. identity.Kind needs the KindName pair only because Kind is a uint8, which TOML cannot spell.

const (
	// Claude is a Claude Code account: file-based, switched by rewriting
	// Claude Code's own credentials file.
	Claude ID = "claude"
	// Codex is a Codex account: served through ccdad's local reverse proxy,
	// which holds the token and rewrites the bearer per request.
	Codex ID = "codex"
)

func Parse

func Parse(s string) (ID, error)

Parse accepts exactly the two wire names.

The empty string is an ERROR rather than a default, and that is the whole value of this function. The zero value of a provider field is "", so a Parse that answered Claude for it would turn a row whose provider went missing into a working Claude account -- and the account whose provider went missing is exactly the one nothing may hand to the Claude switch path.

func (ID) String

func (p ID) String() string

String is the raw value, which is also the wire form.

func (ID) Valid

func (p ID) Valid() bool

Valid reports whether p is one of the two providers. It is the predicate a caller uses when it holds an ID already and has nothing to parse.

Jump to

Keyboard shortcuts

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