limiter

package
v0.0.0-...-bc34ad7 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LimitRange

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

func ParseLimitBetween

func ParseLimitBetween(between, inputTimeLayout string) (LimitRange, error)

type LimitTransport

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

func NewLimitTransport

func NewLimitTransport(logger utils.Logger, rt http.RoundTripper, lr LimitRange, filesize int, ratelimit int) (*LimitTransport, error)

func (*LimitTransport) GetMonitorStatus

func (t *LimitTransport) GetMonitorStatus() Status

func (*LimitTransport) HasStarted

func (t *LimitTransport) HasStarted() bool

HasStarted returns whether the LimitTransport has seen use

func (*LimitTransport) RoundTrip

func (t *LimitTransport) RoundTrip(r *http.Request) (*http.Response, error)

type Status

type Status struct {
	AvgRate    int // Bytes per second
	Bytes      int
	TotalBytes int

	Progress string

	Start   time.Time
	TimeRem time.Duration
}

Jump to

Keyboard shortcuts

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