MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / NewBandwidth

Function NewBandwidth

internal/utils/ratelimit/bandwidth.go:21–23  ·  view source on GitHub ↗

NewBandwidth create new bandwidth limiter

(totalBytes int64)

Source from the content-addressed store, hash-verified

19
20// NewBandwidth create new bandwidth limiter
21func NewBandwidth(totalBytes int64) *Bandwidth {
22 return &Bandwidth{totalBytes: totalBytes}
23}
24
25// Ack acquire next chance to send data
26func (this *Bandwidth) Ack(ctx context.Context, newBytes int) {

Callers 2

TestBandwidthFunction · 0.92
TestBandwidth_0Function · 0.92

Calls

no outgoing calls

Tested by 2

TestBandwidthFunction · 0.74
TestBandwidth_0Function · 0.74