progresswriter

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: MIT Imports: 3 Imported by: 0

README

ProgressWriter

A simple wrapper for io.Write operations that provides a progress callback

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProgressFunc

type ProgressFunc func(file string, progresstype ProgressType, progress, totalsize uint64, timest time.Time)

type ProgressType

type ProgressType int
const (
	PTProgress ProgressType = iota
	PTStart
	PTEnd
)

func (ProgressType) String

func (pt ProgressType) String() string

type ProgressWriter

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

func NewProgressWriter

func NewProgressWriter(archfile string, filesize uint64, w io.Writer, cb ProgressFunc) *ProgressWriter

func (*ProgressWriter) Chunksize

func (upw *ProgressWriter) Chunksize() (n int)

func (*ProgressWriter) SetChunksize

func (upw *ProgressWriter) SetChunksize(size int)

func (*ProgressWriter) Write

func (upw *ProgressWriter) Write(b []byte) (n int, err error)

Jump to

Keyboard shortcuts

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