style(e2e): 清理代码格式和未使用的导入
- 删除 loadbalance_e2e_test.go 中未使用的 encoding/json 导入 - 删除 ssl_e2e_test.go 中未使用的 net/http 导入 - 格式化 testutil/config.go 中的结构体字段对齐 - 为多个文件添加末尾换行符 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
9eaa77478a
commit
2ffcfd782b
@ -901,4 +901,4 @@ func TestE2EProxyCacheIntegration(t *testing.T) {
|
||||
}
|
||||
|
||||
t.Log("Cache integration test completed")
|
||||
}
|
||||
}
|
||||
|
||||
@ -600,7 +600,7 @@ func TestE2EHealthCheckBackupServer(t *testing.T) {
|
||||
|
||||
// 构建配置:第二个后端为备份(使用内部地址)
|
||||
targetOpts := [][]testutil.ProxyTargetOption{
|
||||
{}, // 主服务器
|
||||
{}, // 主服务器
|
||||
{testutil.WithBackup()}, // 备份服务器
|
||||
}
|
||||
|
||||
@ -889,4 +889,4 @@ func TestE2EHealthCheckIntegration(t *testing.T) {
|
||||
}
|
||||
|
||||
t.Log("Health check integration test completed")
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,7 +9,6 @@ package e2e
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"io"
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
@ -11,7 +11,6 @@ import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"io"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
@ -257,7 +257,7 @@ type SSLOption func(*config.SSLConfig)
|
||||
func WithHTTP2(enabled bool, maxConcurrentStreams int) SSLOption {
|
||||
return func(s *config.SSLConfig) {
|
||||
s.HTTP2 = config.HTTP2Config{
|
||||
Enabled: enabled,
|
||||
Enabled: enabled,
|
||||
MaxConcurrentStreams: maxConcurrentStreams,
|
||||
}
|
||||
}
|
||||
@ -368,8 +368,8 @@ func WithRateLimit(requestRate, burst int) SecurityOption {
|
||||
func WithAccessControl(allow, deny []string, defaultAction string) SecurityOption {
|
||||
return func(s *config.SecurityConfig) {
|
||||
s.Access = config.AccessConfig{
|
||||
Allow: allow,
|
||||
Deny: deny,
|
||||
Allow: allow,
|
||||
Deny: deny,
|
||||
Default: defaultAction,
|
||||
}
|
||||
}
|
||||
@ -582,4 +582,4 @@ func (b *ConfigBuilder) Clone() *ConfigBuilder {
|
||||
}
|
||||
|
||||
return &ConfigBuilder{cfg: &newCfg}
|
||||
}
|
||||
}
|
||||
|
||||
@ -95,4 +95,4 @@ func CreateHTTPClientWithTimeout(timeout time.Duration) *http.Client {
|
||||
return &http.Client{
|
||||
Timeout: timeout,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -411,4 +411,4 @@ func TestE2EWebSocketProxyIntegration(t *testing.T) {
|
||||
assert.Equal(t, 200, resp.StatusCode)
|
||||
|
||||
t.Log("WebSocket proxy integration test placeholder - requires WebSocket backend")
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user