fix: 优化代码
This commit is contained in:
@@ -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"`
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user