home

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SanitizeAuthForDownstream

func SanitizeAuthForDownstream(auth *coreauth.Auth) *coreauth.Auth

SanitizeAuthForDownstream removes refresh-capable credentials from the auth payload before it is returned to downstream CPA nodes.

Types

type DispatchResult

type DispatchResult struct {
	Model       string
	AccessToken string
	BaseURL     string
	APIKey      string

	AuthID   string
	Provider string

	Auth *coreauth.Auth
}

type ModelInfo

type ModelInfo = registry.ModelInfo

type Runtime

type Runtime struct {
	// contains filtered or unexported fields
}

func NewRuntime

func NewRuntime(cfg *config.Config) (*Runtime, error)

func (*Runtime) AccessManager

func (r *Runtime) AccessManager() *access.Manager

func (*Runtime) AddToken

func (r *Runtime) AddToken(ctx context.Context, rawJSON string) (string, error)

AddToken stores a credential JSON blob into the auth directory and schedules it for use. It returns the created (or existing) auth file name under auth-dir.

func (*Runtime) Authenticate

func (r *Runtime) Authenticate(ctx context.Context, headers http.Header) (*access.Result, *access.AuthError)

func (*Runtime) Config

func (r *Runtime) Config() *config.Config

func (*Runtime) ConfigPath

func (r *Runtime) ConfigPath() string

func (*Runtime) CoreManager

func (r *Runtime) CoreManager() *coreauth.Manager

func (*Runtime) Dispatch

func (r *Runtime) Dispatch(ctx context.Context, reqModel string, headers http.Header) (*DispatchResult, error)

func (*Runtime) PublishConfigYAML

func (r *Runtime) PublishConfigYAML(payload []byte)

func (*Runtime) ReadConfigYAML

func (r *Runtime) ReadConfigYAML() ([]byte, error)

func (*Runtime) RecordUsagePayload

func (r *Runtime) RecordUsagePayload(ctx context.Context, payload string)

RecordUsagePayload applies downstream usage status to the scheduler auth state.

func (*Runtime) Start

func (r *Runtime) Start(ctx context.Context, configPath string) error

func (*Runtime) Stop

func (r *Runtime) Stop()

func (*Runtime) SubscribeConfigYAML

func (r *Runtime) SubscribeConfigYAML(subscriber func(payload []byte) error) (unsubscribe func())

Jump to

Keyboard shortcuts

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