Documentation
¶
Overview ¶
Package cincai is the batteries-included library entry point. Run and EmbedRun wire the curated catalog loader, adapter pack, and OAuth providers into the gateway engine — everything a self-hoster gets from `cincai serve`. For lower- level control, use the gateway package directly.
Product binaries and hosts (host-app-router) depend on this module via go.mod — they do not fork the engine sources.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Adapters ¶
func Adapters() []adaptersdk.Adapter
Adapters returns every adapter linked into this binary: the stock defaults plus whatever registered with pack (the link package's blank imports, or your own pack.RegisterAdapter calls). This is the set adapters.enable selects from.
func EmbedRun ¶
func EmbedRun(ctx context.Context, opts EmbedOptions) error
EmbedRun serves without calling OTel Boot. For host binaries that embed the gateway.
func LoadCatalog ¶
func LoadCatalog(path string) (*corecatalog.Catalog, error)
LoadCatalog loads providers.yaml with the same capabilities→surfaces normalization used by Run/EmbedRun. Product CLIs use this for catalog validate without importing internal/catalog.
Types ¶
type EmbedOptions ¶
type EmbedOptions struct {
ConfigPath string
ServiceName string
MetricPrefix string
WrapDataHandler func(http.Handler) http.Handler
// AuxServers lets the host run extra HTTP servers alongside the data plane, sharing
// the credential store, keyring, and shutdown lifecycle (e.g. a management/admin API).
AuxServers gateway.AuxServersFunc
}
EmbedOptions runs the gateway inside a host process (host owns OTel Boot).
type Options ¶
type Options struct {
ConfigPath string
ServiceName string
MetricPrefix string
// WrapDataHandler optionally wraps the data-plane handler (e.g. host
// attribution for usage). Does not affect routing.
WrapDataHandler func(http.Handler) http.Handler
}
Options boots a standalone Cincai gateway (owns OTel via Boot).
Directories
¶
| Path | Synopsis |
|---|---|
|
adapters
|
|
|
gemini
Package gemini converts between OpenAI chat.completions and Gemini generateContent request/response shapes (tools, multimodal parts, thought_signature, thinking budget).
|
Package gemini converts between OpenAI chat.completions and Gemini generateContent request/response shapes (tools, multimodal parts, thought_signature, thinking budget). |
|
messages
Package messages holds Anthropic Messages API shapes used by translate adapters.
|
Package messages holds Anthropic Messages API shapes used by translate adapters. |
|
upstreamauth
Package upstreamauth resolves catalog inject overrides and applies upstream credentials.
|
Package upstreamauth resolves catalog inject overrides and applies upstream credentials. |
|
Package catalog resolves multi-surface providers.yaml to upstream targets.
|
Package catalog resolves multi-surface providers.yaml to upstream targets. |
|
cmd
|
|
|
cincai
command
|
|
|
Package credential implements cincai credential admin commands (encrypted broker).
|
Package credential implements cincai credential admin commands (encrypted broker). |
|
oauth/pack
Package pack collects OAuth vendor module registrations from oauth-providers/* init().
|
Package pack collects OAuth vendor module registrations from oauth-providers/* init(). |
|
oauth/vendor
Package vendor is the internal registry that binds vendor OAuth modules to the credential store.
|
Package vendor is the internal registry that binds vendor OAuth modules to the credential store. |
|
refresh
Package refresh decorates a credential store, renewing near-expiry vendor OAuth access tokens on read.
|
Package refresh decorates a credential store, renewing near-expiry vendor OAuth access tokens on read. |
|
seal
Package seal provides AES-256-GCM encryption at rest for credential blobs.
|
Package seal provides AES-256-GCM encryption at rest for credential blobs. |
|
ingress
|
|
|
internal
|
|
|
catalog
Package catalog loads providers.yaml and normalizes capabilities into surfaces.
|
Package catalog loads providers.yaml and normalizes capabilities into surfaces. |
|
oauth
Package oauth hosts generic Cincai OAuth machinery (bridge, remote UX).
|
Package oauth hosts generic Cincai OAuth machinery (bridge, remote UX). |
|
oauth/register
Package register wires Cincai OAuth vendor modules into cincai.
|
Package register wires Cincai OAuth vendor modules into cincai. |
|
wiretranslate/sse
Package sse parses Server-Sent Event frames.
|
Package sse parses Server-Sent Event frames. |
|
Package link registers Cincai's full default pack — every bundled adapter, OAuth provider, and the wire-translate bridge — via blank import (each pack's init() calls the public registration APIs).
|
Package link registers Cincai's full default pack — every bundled adapter, OAuth provider, and the wire-translate bridge — via blank import (each pack's init() calls the public registration APIs). |
|
Package observability provides ingress structured logs, optional OpenTelemetry export, and optional host attribution (semantic slots; default wire X-Cincai-*).
|
Package observability provides ingress structured logs, optional OpenTelemetry export, and optional host attribution (semantic slots; default wire X-Cincai-*). |
|
Package pack wires Cincai handlers into compose.
|
Package pack wires Cincai handlers into compose. |
|
Package register wires Cincai vendor OAuth modules at link time.
|
Package register wires Cincai vendor OAuth modules at link time. |