fix: 优化代码

This commit is contained in:
tbphp
2025-06-09 22:03:15 +08:00
parent 0c5cf4266d
commit 9562f0f6dd
5 changed files with 48 additions and 46 deletions

View File

@@ -1,7 +1,11 @@
// Package types defines common interfaces and types used across the application
package types
import "time"
import (
"time"
"github.com/gin-gonic/gin"
)
// ConfigManager defines the interface for configuration management
type ConfigManager interface {
@@ -13,6 +17,7 @@ type ConfigManager interface {
GetPerformanceConfig() PerformanceConfig
GetLogConfig() LogConfig
Validate() error
DisplayConfig()
}
// KeyManager defines the interface for API key management
@@ -27,6 +32,12 @@ type KeyManager interface {
Close()
}
// ProxyServer defines the interface for proxy server
type ProxyServer interface {
HandleProxy(c *gin.Context)
Close()
}
// ServerConfig represents server configuration
type ServerConfig struct {
Port int `json:"port"`
@@ -64,8 +75,8 @@ type CORSConfig struct {
// PerformanceConfig represents performance configuration
type PerformanceConfig struct {
MaxConcurrentRequests int `json:"maxConcurrentRequests"`
RequestTimeout int `json:"requestTimeout"`
MaxConcurrentRequests int `json:"maxConcurrentRequests"`
RequestTimeout int `json:"requestTimeout"`
EnableGzip bool `json:"enableGzip"`
}