{"modulePath":"github.com/github/git-media","version":"v2.3.4+incompatible","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package progress\n\nPackage progress provides common progress monitoring / display features NOTE: Subject to change, do not rely on this package from outside git-lfs source\n\n## Functions\n\n```go\nfunc DryRun(dryRun bool) meterOption\n```\nDryRun is an option for NewMeter() that determines whether updates should be sent to stdout.\n\n```go\nfunc WithLogFile(name string) meterOption\n```\nWithLogFile is an option for NewMeter() that sends updates to a text file.\n\n```go\nfunc WithOSEnv(os env) meterOption\n```\nWithOSEnv is an option for NewMeter() that sends updates to the text file path specified in the OS Env.\n\n## Types\n\n```go\ntype BodyWithCallback struct {\n\tReadSeekCloser\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewBodyWithCallback(body ReadSeekCloser, totalSize int64, cb CopyCallback) *BodyWithCallback\n```\n\n```go\nfunc NewByteBodyWithCallback(by []byte, totalSize int64, cb CopyCallback) *BodyWithCallback\n```\n\n```go\nfunc (r *BodyWithCallback) Read(p []byte) (int, error)\n```\nRead wraps the underlying Reader's \"Read\" method. It also captures the number of bytes read, and calls the callback.\n\n```go\nfunc (r *BodyWithCallback) ResetProgress() error\n```\nResetProgress calls the callback with a negative read size equal to the total number of bytes read so far, effectively \"resetting\" the progress.\n\n```go\nfunc (r *BodyWithCallback) Seek(offset int64, whence int) (int64, error)\n```\nSeek wraps the underlying Seeker's \"Seek\" method, updating the number of bytes that have been consumed by this reader.\n\n```go\ntype CallbackReader struct {\n\tC         CopyCallback\n\tTotalSize int64\n\tReadSize  int64\n\tio.Reader\n}\n```\n\n```go\nfunc (w *CallbackReader) Read(p []byte) (int, error)\n```\n\n```go\ntype CopyCallback func(totalSize int64, readSoFar int64, readSinceLast int) error\n```\n\n```go\ntype Meter interface {\n\tStart()\n\tPause()\n\tAdd(int64)\n\tSkip(size int64)\n\tStartTransfer(name string)\n\tTransferBytes(direction, name string, read, total int64, current int)\n\tFinishTransfer(name string)\n\tFinish()\n}\n```\n\n```go\nfunc Noop() Meter\n```\n\n```go\ntype ProgressMeter struct {\n\t// contains filtered or unexported fields\n}\n```\nProgressMeter provides a progress bar type output for the TransferQueue. It is given an estimated file count and size up front and tracks the number of files and bytes transferred as well as the number of files and bytes that get skipped because the transfer is unnecessary.\n\n```go\nfunc NewMeter(options ...meterOption) *ProgressMeter\n```\nNewMeter creates a new ProgressMeter.\n\n```go\nfunc (p *ProgressMeter) Add(size int64)\n```\nAdd tells the progress meter that a single file of the given size will possibly be transferred. If a file doesn't need to be transferred for some reason, be sure to call Skip(int64) with the same size.\n\n```go\nfunc (p *ProgressMeter) Finish()\n```\nFinish shuts down the ProgressMeter\n\n```go\nfunc (p *ProgressMeter) FinishTransfer(name string)\n```\nFinishTransfer increments the finished transfer count\n\n```go\nfunc (p *ProgressMeter) Pause()\n```\nPause stops sending status updates temporarily, until Start() is called again.\n\n```go\nfunc (p *ProgressMeter) Skip(size int64)\n```\nSkip tells the progress meter that a file of size \\`size\\` is being skipped because the transfer is unnecessary.\n\n```go\nfunc (p *ProgressMeter) Start()\n```\nStart begins sending status updates to the optional log file, and stdout.\n\n```go\nfunc (p *ProgressMeter) StartTransfer(name string)\n```\nStartTransfer tells the progress meter that a transferring file is being added to the TransferQueue.\n\n```go\nfunc (p *ProgressMeter) TransferBytes(direction, name string, read, total int64, current int)\n```\nTransferBytes increments the number of bytes transferred\n\n```go\ntype ReadSeekCloser interface {\n\tio.Seeker\n\tio.ReadCloser\n}\n```\nprevent import cycle\n\n```go\nfunc NewByteBody(by []byte) ReadSeekCloser\n```\n\n```go\ntype Spinner struct {\n\t// contains filtered or unexported fields\n}\n```\nIndeterminate progress indicator 'spinner'\n\n```go\nfunc NewSpinner() *Spinner\n```\n\n```go\nfunc (s *Spinner) Finish(out io.Writer, finishMsg string)\n```\nFinish the spinner with a completion message \u0026 newline\n\n```go\nfunc (s *Spinner) Print(out io.Writer, msg string)\n```\nPrint a spinner (stage) to out followed by msg (no linefeed)\n\n```go\nfunc (s *Spinner) Spin(out io.Writer)\n```\nJust spin the spinner one more notch \u0026 use the last message\n\n","path":"github.com/github/git-media/progress","name":"progress","synopsis":"Package progress provides common progress monitoring / display features NOTE: Subject to change, do not rely on this package from outside git-lfs source","isRedistributable":true}
