ops: Fix goimports on fair-share bandwidth PR
This commit was merged in pull request #54.
This commit is contained in:
+2
-2
@@ -20,8 +20,8 @@ var (
|
||||
logLevel string
|
||||
logFormat string
|
||||
|
||||
maxConcurrentRequests int64
|
||||
maxRequestsPerClient int64
|
||||
maxConcurrentRequests int64
|
||||
maxRequestsPerClient int64
|
||||
uplinkBandwidth string
|
||||
maxBytesPerClientPerSec int64
|
||||
)
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ type Config struct {
|
||||
|
||||
// Table-tier uplink bandwidth shaping (bytes/sec). Distinct from MaxRequestsPerClient.
|
||||
// Empty/"0" uplink and 0 max_bytes_per_client_per_sec = disabled (current unlimited behavior).
|
||||
UplinkBandwidth string `yaml:"uplink_bandwidth"` // e.g. "10MB" via go-units = bytes/sec
|
||||
UplinkBandwidth string `yaml:"uplink_bandwidth"` // e.g. "10MB" via go-units = bytes/sec
|
||||
MaxBytesPerClientPerSec int64 `yaml:"max_bytes_per_client_per_sec"` // absolute per-client cap; 0 = none
|
||||
|
||||
// Hardening limits (security/correctness)
|
||||
|
||||
@@ -212,7 +212,6 @@ func TestValidate(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func TestValidateUplinkBandwidth(t *testing.T) {
|
||||
cases := []struct {
|
||||
name string
|
||||
|
||||
@@ -93,15 +93,15 @@ func TestServeHTTPBandwidthCap(t *testing.T) {
|
||||
t.Cleanup(upstream.Close)
|
||||
|
||||
sc, err := NewWithOptions(Options{
|
||||
Address: "127.0.0.1:0",
|
||||
MemorySize: "1MB",
|
||||
DiskSize: "0",
|
||||
Upstream: upstream.URL,
|
||||
MemoryGC: "lru",
|
||||
DiskGC: "lru",
|
||||
MaxConcurrentRequests: 20,
|
||||
MaxRequestsPerClient: 10,
|
||||
MaxObjectSize: "0",
|
||||
Address: "127.0.0.1:0",
|
||||
MemorySize: "1MB",
|
||||
DiskSize: "0",
|
||||
Upstream: upstream.URL,
|
||||
MemoryGC: "lru",
|
||||
DiskGC: "lru",
|
||||
MaxConcurrentRequests: 20,
|
||||
MaxRequestsPerClient: 10,
|
||||
MaxObjectSize: "0",
|
||||
MaxBytesPerClientPerSec: 1500, // 1.5KB/s
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user