mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-09-07 00:24:17 +08:00
- Implemented a Go-based dynamic library plugin for request lifecycle management. - Added concurrency controls, keyword-based request termination, and response handling. - Supported optional capabilities for request interception and active lifecycle termination. - Included tests for schema compatibility, concurrency limits, and policy-based termination. - Added build instructions and configuration details in README. - Updated host support for lifecycle plugin RPC methods. Closes: #4568
30 lines
1.1 KiB
Go
30 lines
1.1 KiB
Go
// Package interfaces defines the core interfaces and shared structures for the CLI Proxy API server.
|
|
// These interfaces provide a common contract for different components of the application,
|
|
// such as AI service clients, API handlers, and data models.
|
|
package interfaces
|
|
|
|
import "net/http"
|
|
|
|
// ErrorMessage encapsulates an error with an associated HTTP status code.
|
|
// This structure is used to provide detailed error information including
|
|
// both the HTTP status and the underlying error.
|
|
type ErrorMessage struct {
|
|
// StatusCode is the HTTP status code returned by the API.
|
|
StatusCode int
|
|
|
|
// Error is the underlying error that occurred.
|
|
Error error
|
|
|
|
// Addon contains upstream headers that may be passed through when enabled.
|
|
Addon http.Header
|
|
|
|
// DirectResponse reports that Body and Headers were explicitly supplied by a trusted in-process component.
|
|
DirectResponse bool
|
|
|
|
// Body contains a preformatted downstream response when DirectResponse is true.
|
|
Body []byte
|
|
|
|
// Headers contains downstream response headers when DirectResponse is true.
|
|
Headers http.Header
|
|
}
|