lxd: github.com/lxc/lxd/shared/ioprogress Index | Files

package ioprogress

import "github.com/lxc/lxd/shared/ioprogress"


Package Files

data.go reader.go tracker.go writer.go

type ProgressData Uses

type ProgressData struct {
    // Preferred string repreentation of progress (always set)
    Text string

    // Progress in percent
    Percentage int

    // Number of bytes transferred (for files)
    TransferredBytes int64

    // Total number of bytes (for files)
    TotalBytes int64

The ProgressData struct represents new progress information on an operation

type ProgressReader Uses

type ProgressReader struct {
    Tracker *ProgressTracker

ProgressReader is a wrapper around ReadCloser which allows for progress tracking

func (*ProgressReader) Read Uses

func (pt *ProgressReader) Read(p []byte) (int, error)

Read in ProgressReader is the same as io.Read

type ProgressTracker Uses

type ProgressTracker struct {
    Length  int64
    Handler func(int64, int64)
    // contains filtered or unexported fields

ProgressTracker provides the stream information needed for tracking

type ProgressWriter Uses

type ProgressWriter struct {
    Tracker *ProgressTracker

ProgressWriter is a wrapper around WriteCloser which allows for progress tracking

func (*ProgressWriter) Write Uses

func (pt *ProgressWriter) Write(p []byte) (int, error)

Write in ProgressWriter is the same as io.Write

Package ioprogress imports 2 packages (graph) and is imported by 64 packages. Updated 2018-01-25. Refresh now. Tools for package owners.