cnter

package
v1.11.2 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package cnter is an optional progress counter for the remote file downloads.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Percent

func Percent(count, total uint64) uint64

Percent of count in total.

Types

type Writer

type Writer struct {
	Name    string // Filename.
	Total   uint64 // Expected filesize.
	Written uint64 // Bytes written.
	W       io.Writer
}

Writer totals the number of bytes written.

func (Writer) Percent

func (wc Writer) Percent()

Percent prints the current download progress.

func (*Writer) Write

func (wc *Writer) Write(p []byte) (int, error)

Write to stdout and also return the current write progress.

Jump to

Keyboard shortcuts

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