lxd/storage.go
func StorageProgressWriter(op *operation, key string, description string) func(io.WriteCloser) io.WriteCloser {
	return func(writer io.WriteCloser) io.WriteCloser {
		if op == nil {
			return writer
		}

		progress := func(progressInt int64, speedInt int64) {
			progressWrapperRender(op, key, description, progressInt, speedInt)
		}

		writePipe := &ioprogress.ProgressWriter{
			WriteCloser: writer,
			Tracker: &ioprogress.ProgressTracker{
				Handler: progress,
			},
		}

		return writePipe
	}
}
func StorageProgressWriter(op *operation, key string, description string) func(io.WriteCloser) io.WriteCloser {
	return func(writer io.WriteCloser) io.WriteCloser {
		if op == nil {
			return writer
		}

		progress := func(progressInt int64, speedInt int64) {
			progressWrapperRender(op, key, description, progressInt, speedInt)
		}

		writePipe := &ioprogress.ProgressWriter{
			WriteCloser: writer,
			Tracker: &ioprogress.ProgressTracker{
				Handler: progress,
			},
		}

		return writePipe
	}
}
func StorageProgressWriter ( op * operation , key string , description string ) func ( io . WriteCloser ) io . WriteCloser { return func ( writer io . WriteCloser ) io . WriteCloser { if op == nil { return writer } progress := func ( progressInt int64 , speedInt int64 ) { progressWrapperRender ( op , key , description , progressInt , speedInt ) } writePipe := & ioprogress . ProgressWriter { WriteCloser : writer , Tracker : & ioprogress . ProgressTracker { Handler : progress , } , } return writePipe } }
// StorageProgressWriter reports the write progress.
StorageProgressWriter reports the write progress .