Versions in this module Expand all Collapse all v1 v1.10.18 Oct 19, 2022 Changes in this version + const DecParamDelay + const FixedPointMultiplier + type ClientManager struct + func NewClientManager(curve PieceWiseLinear, clock mclock.Clock) *ClientManager + func (cm *ClientManager) SetCapacityLimits(min, max, raiseThreshold uint64) + func (cm *ClientManager) SetRechargeCurve(curve PieceWiseLinear) + func (cm *ClientManager) Stop() + func (cm *ClientManager) SubscribeTotalCapacity(ch chan uint64) uint64 + type ClientNode struct + func NewClientNode(cm *ClientManager, params ServerParams) *ClientNode + func (node *ClientNode) AcceptRequest(reqID, index, maxCost uint64) (accepted bool, bufShort uint64, priority int64) + func (node *ClientNode) BufferStatus() (uint64, uint64) + func (node *ClientNode) Disconnect() + func (node *ClientNode) Freeze() + func (node *ClientNode) OneTimeCost(cost uint64) + func (node *ClientNode) RequestProcessed(reqID, index, maxCost, realCost uint64) uint64 + func (node *ClientNode) UpdateParams(params ServerParams) + type PieceWiseLinear []struct + func (pwl PieceWiseLinear) Valid() bool + func (pwl PieceWiseLinear) ValueAt(x uint64) float64 + type ServerNode struct + func NewServerNode(params ServerParams, clock mclock.Clock) *ServerNode + func (node *ServerNode) CanSend(maxCost uint64) (time.Duration, float64) + func (node *ServerNode) DumpLogs() + func (node *ServerNode) QueuedRequest(reqID, maxCost uint64) + func (node *ServerNode) ReceivedReply(reqID, bv uint64) + func (node *ServerNode) ResumeFreeze(bv uint64) + func (node *ServerNode) UpdateParams(params ServerParams) + type ServerParams struct + BufLimit uint64 + MinRecharge uint64