Files
CLIProxyAPI/internal/interfaces/error_message.go
Luis Pater 30efd7c4fd feat(plugin): add request lifecycle plugin with interception and termination capabilities
- 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
2026-07-28 03:22:18 +08:00

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
}