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
|
logLevel string
|
||||||
logFormat string
|
logFormat string
|
||||||
|
|
||||||
maxConcurrentRequests int64
|
maxConcurrentRequests int64
|
||||||
maxRequestsPerClient int64
|
maxRequestsPerClient int64
|
||||||
uplinkBandwidth string
|
uplinkBandwidth string
|
||||||
maxBytesPerClientPerSec int64
|
maxBytesPerClientPerSec int64
|
||||||
)
|
)
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@ type Config struct {
|
|||||||
|
|
||||||
// Table-tier uplink bandwidth shaping (bytes/sec). Distinct from MaxRequestsPerClient.
|
// 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).
|
// 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
|
MaxBytesPerClientPerSec int64 `yaml:"max_bytes_per_client_per_sec"` // absolute per-client cap; 0 = none
|
||||||
|
|
||||||
// Hardening limits (security/correctness)
|
// Hardening limits (security/correctness)
|
||||||
|
|||||||
@@ -212,7 +212,6 @@ func TestValidate(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func TestValidateUplinkBandwidth(t *testing.T) {
|
func TestValidateUplinkBandwidth(t *testing.T) {
|
||||||
cases := []struct {
|
cases := []struct {
|
||||||
name string
|
name string
|
||||||
|
|||||||
@@ -93,15 +93,15 @@ func TestServeHTTPBandwidthCap(t *testing.T) {
|
|||||||
t.Cleanup(upstream.Close)
|
t.Cleanup(upstream.Close)
|
||||||
|
|
||||||
sc, err := NewWithOptions(Options{
|
sc, err := NewWithOptions(Options{
|
||||||
Address: "127.0.0.1:0",
|
Address: "127.0.0.1:0",
|
||||||
MemorySize: "1MB",
|
MemorySize: "1MB",
|
||||||
DiskSize: "0",
|
DiskSize: "0",
|
||||||
Upstream: upstream.URL,
|
Upstream: upstream.URL,
|
||||||
MemoryGC: "lru",
|
MemoryGC: "lru",
|
||||||
DiskGC: "lru",
|
DiskGC: "lru",
|
||||||
MaxConcurrentRequests: 20,
|
MaxConcurrentRequests: 20,
|
||||||
MaxRequestsPerClient: 10,
|
MaxRequestsPerClient: 10,
|
||||||
MaxObjectSize: "0",
|
MaxObjectSize: "0",
|
||||||
MaxBytesPerClientPerSec: 1500, // 1.5KB/s
|
MaxBytesPerClientPerSec: 1500, // 1.5KB/s
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user