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
@ -600,7 +600,7 @@ func TestE2EHealthCheckBackupServer(t *testing.T) {
|
|||||||
|
|
||||||
// 构建配置:第二个后端为备份(使用内部地址)
|
// 构建配置:第二个后端为备份(使用内部地址)
|
||||||
targetOpts := [][]testutil.ProxyTargetOption{
|
targetOpts := [][]testutil.ProxyTargetOption{
|
||||||
{}, // 主服务器
|
{}, // 主服务器
|
||||||
{testutil.WithBackup()}, // 备份服务器
|
{testutil.WithBackup()}, // 备份服务器
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,6 @@ package e2e
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
|||||||
@ -11,7 +11,6 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|||||||
@ -257,7 +257,7 @@ type SSLOption func(*config.SSLConfig)
|
|||||||
func WithHTTP2(enabled bool, maxConcurrentStreams int) SSLOption {
|
func WithHTTP2(enabled bool, maxConcurrentStreams int) SSLOption {
|
||||||
return func(s *config.SSLConfig) {
|
return func(s *config.SSLConfig) {
|
||||||
s.HTTP2 = config.HTTP2Config{
|
s.HTTP2 = config.HTTP2Config{
|
||||||
Enabled: enabled,
|
Enabled: enabled,
|
||||||
MaxConcurrentStreams: maxConcurrentStreams,
|
MaxConcurrentStreams: maxConcurrentStreams,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -368,8 +368,8 @@ func WithRateLimit(requestRate, burst int) SecurityOption {
|
|||||||
func WithAccessControl(allow, deny []string, defaultAction string) SecurityOption {
|
func WithAccessControl(allow, deny []string, defaultAction string) SecurityOption {
|
||||||
return func(s *config.SecurityConfig) {
|
return func(s *config.SecurityConfig) {
|
||||||
s.Access = config.AccessConfig{
|
s.Access = config.AccessConfig{
|
||||||
Allow: allow,
|
Allow: allow,
|
||||||
Deny: deny,
|
Deny: deny,
|
||||||
Default: defaultAction,
|
Default: defaultAction,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user