l2

package
v0.0.0-...-05bc493 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TrafficConfig

type TrafficConfig struct {
	TotalRead, TotalWrite int
	PeerRead, PeerWrite   int

	SamplingPeriod time.Duration
	BurstPeriods   int
}

type TrafficController

type TrafficController struct {
	// contains filtered or unexported fields
}

func NewTrafficController

func NewTrafficController(cfg TrafficConfig) *TrafficController

func (*TrafficController) GetThroughput

func (p *TrafficController) GetThroughput() uint8

func (*TrafficController) NewRWBucket

func (p *TrafficController) NewRWBucket() ratelimiter.RWRateQuota

func (*TrafficController) SetLevel

func (p *TrafficController) SetLevel(level capacity.Level)

func (*TrafficController) SetThroughput

func (p *TrafficController) SetThroughput(percent uint8)

func (*TrafficController) Start

func (p *TrafficController) Start(ctx context.Context)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL