progress

package
v4.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyWithContext

func CopyWithContext(ctx context.Context, dst io.Writer, src io.Reader) (written int64, err error)

Types

type Callback

type Callback func(int64, io.Reader, io.Writer) error

Callback is a function that provides progress information copying from a Reader to a Writer

func BarCallback

func BarCallback(ctx context.Context) Callback

BarCallback returns a progress bar callback unless e.g. --quiet or lower loglevel is set

type DownloadBar

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

DownloadBar is a progress bar that implements the scs-library-client ProgressBar interface.

func (*DownloadBar) Abort

func (dpb *DownloadBar) Abort(drop bool)

func (*DownloadBar) IncrBy

func (dpb *DownloadBar) IncrBy(n int)

func (*DownloadBar) Init

func (dpb *DownloadBar) Init(contentLength int64)

func (*DownloadBar) ProxyReader

func (dpb *DownloadBar) ProxyReader(r io.Reader) io.ReadCloser

func (*DownloadBar) Wait

func (dpb *DownloadBar) Wait()

type RoundTripper

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

func NewRoundTripper

func NewRoundTripper(inner http.RoundTripper, pb *DownloadBar) *RoundTripper

func (*RoundTripper) RoundTrip

func (t *RoundTripper) RoundTrip(req *http.Request) (*http.Response, error)

type UploadBar

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

UploadBar is a progress bar that implements the scs-library-client UploadCallback interface.

func (*UploadBar) Finish

func (upb *UploadBar) Finish()

func (*UploadBar) GetReader

func (upb *UploadBar) GetReader() io.Reader

func (*UploadBar) IncrBy

func (upb *UploadBar) IncrBy(n int)

func (*UploadBar) Init

func (upb *UploadBar) Init(totalSize int64)

func (*UploadBar) InitUpload

func (upb *UploadBar) InitUpload(totalSize int64, r io.Reader)

func (*UploadBar) Terminate

func (upb *UploadBar) Terminate()

Jump to

Keyboard shortcuts

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