progress

package
v0.0.0-...-8aeb11b Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewProgressTrackingRoundTripper

func NewProgressTrackingRoundTripper(wrap http.RoundTripper) (*ProgressTrackingRoundTripper, *ProgressTracker, *ProgressTracker)

NewProgressTrackingRoundTripper returns a http.RoundTripper which wraps the given http.RoundTripper and prints information about the number of bytes which have been transferred.

func ProgressTrackingClient

func ProgressTrackingClient(wrap *http.Client) (client *http.Client, upload *ProgressTracker, download *ProgressTracker)

ProgressTrackingClient returns a http.Client which wraps the given http.Client and prints information about the number of bytes which have been transferred. Use the returned upload and download ProgressTrackers to start and stop tracking transfers.

Types

type ProgressTracker

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

ProgressTracker tracks the number of bytes which have been transferred and periodically logs the number to stdout.

func NewProgressTracker

func NewProgressTracker() *ProgressTracker

NewProgressTracker returns a ProgressTracker.

func (*ProgressTracker) Start

func (t *ProgressTracker) Start()

Start tracking the number of bytes transferred.

func (*ProgressTracker) Stop

func (t *ProgressTracker) Stop()

Stop tracking the number of bytes transferred.

type ProgressTrackingRoundTripper

type ProgressTrackingRoundTripper struct {
	http.RoundTripper
	// contains filtered or unexported fields
}

ProgressTrackingRoundTripper is a http.RoundTripper which wraps another http.RoundTripper and prints information about the number of bytes which have been transferred.

func (*ProgressTrackingRoundTripper) RoundTrip

RoundTrip implements http.RoundTripper.

Jump to

Keyboard shortcuts

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