Documentation ¶
Index ¶
- func NewProgressTrackingRoundTripper(wrap http.RoundTripper) (*ProgressTrackingRoundTripper, *ProgressTracker, *ProgressTracker)
- func ProgressTrackingClient(wrap *http.Client) (client *http.Client, upload *ProgressTracker, download *ProgressTracker)
- type ProgressTracker
- type ProgressTrackingRoundTripper
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.