util

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Diff

func Diff(from, to []string) (both, add, del []string)

func ErrorIsEOF

func ErrorIsEOF(err error) bool

func FormatBytes

func FormatBytes(size int64) string

func PathAbs

func PathAbs(relPath, baseDir string) string

func PathNormalize

func PathNormalize(path string, isDir bool) string

func PathNormalizeBaseDir

func PathNormalizeBaseDir(baseDir string) string

func PathParents

func PathParents(path string) []string

func PathRel

func PathRel(absPath, baseDir string) string

func PathSorted

func PathSorted(paths []string) []string

func PathSortedDirs

func PathSortedDirs(paths []string) []string

Types

type Reader

type Reader struct {
	io.ReadCloser

	OnProgress func(r *Reader)
	OnComplete func(r *Reader)
	// contains filtered or unexported fields
}

func NewRead

func NewRead(r io.ReadCloser, len int64) *Reader

func (*Reader) Close

func (r *Reader) Close() error

func (*Reader) GetBytesRead

func (r *Reader) GetBytesRead() int64

func (*Reader) GetBytesTotal

func (r *Reader) GetBytesTotal() int64

func (*Reader) GetHashMd5

func (r *Reader) GetHashMd5() string

func (*Reader) GetHashSha256

func (r *Reader) GetHashSha256() string

func (*Reader) GetProgress

func (r *Reader) GetProgress() float64

func (*Reader) IsComplete

func (r *Reader) IsComplete() bool

func (*Reader) Read

func (r *Reader) Read(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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