api

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: Apache-2.0 Imports: 6 Imported by: 1 module, 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 api exposes server option helpers for embedding switchAILocal.

It wraps internal server option types so external projects can configure the embedded HTTP server without importing internal packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ServerOption

type ServerOption = internalapi.ServerOption

ServerOption customises HTTP server construction.

func WithEngineConfigurator

func WithEngineConfigurator(fn func(*gin.Engine)) ServerOption

WithEngineConfigurator allows callers to mutate the Gin engine prior to middleware setup.

func WithKeepAliveEndpoint

func WithKeepAliveEndpoint(timeout time.Duration, onTimeout func()) ServerOption

WithKeepAliveEndpoint enables a keep-alive endpoint with the provided timeout and callback.

func WithLocalManagementPassword

func WithLocalManagementPassword(password string) ServerOption

WithLocalManagementPassword stores a runtime-only management password accepted for localhost requests.

func WithMiddleware

func WithMiddleware(mw ...gin.HandlerFunc) ServerOption

WithMiddleware appends additional Gin middleware during server construction.

func WithRequestLoggerFactory

func WithRequestLoggerFactory(factory func(*config.Config, string) logging.RequestLogger) ServerOption

WithRequestLoggerFactory customises request logger creation.

func WithRouterConfigurator

func WithRouterConfigurator(fn func(*gin.Engine, *handlers.BaseAPIHandler, *config.Config)) ServerOption

WithRouterConfigurator appends a callback after default routes are registered.

Directories

Path Synopsis
Package handlers provides core API handler functionality for the switchAILocal server.
Package handlers provides core API handler functionality for the switchAILocal server.
claude
Package claude provides HTTP handlers for Claude API code-related functionality.
Package claude provides HTTP handlers for Claude API code-related functionality.
gemini
Package gemini provides HTTP handlers for Gemini CLI API functionality.
Package gemini provides HTTP handlers for Gemini CLI API functionality.
notifications
Package notifications implements outbound notification relays so sandboxed clients (Tytus pods, restricted agents, etc.) can emit messages to external services like Telegram without ever holding the upstream credentials.
Package notifications implements outbound notification relays so sandboxed clients (Tytus pods, restricted agents, etc.) can emit messages to external services like Telegram without ever holding the upstream credentials.
openai
Package openai provides HTTP handlers for OpenAI API endpoints.
Package openai provides HTTP handlers for OpenAI API endpoints.

Jump to

Keyboard shortcuts

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