file

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KB = 1 << (10 * iota)
	MB
	GB
)

Variables

This section is empty.

Functions

func CopyDir

func CopyDir(fs afero.Fs, src string, dst string) error

func CopyFile

func CopyFile(fs afero.Fs, src, dst string) error

func Exists

func Exists(fs afero.Fs, path string) bool

func HashFile

func HashFile(fs afero.Fs, path string, hasher hash.Hash) (string, error)

func UnTarGz

func UnTarGz(dst string, r io.Reader) error

func ValidateByHash

func ValidateByHash(fs afero.Fs, path, hashStr string) (bool, string, error)

Types

type Getter

type Getter interface {
	// GetFile downloads the give URL into the given path. The URL must reference a single file.
	GetFile(dst, src string, monitor ...*progress.Manual) error

	// Get downloads the given URL into the given directory. The directory must already exist.
	GetToDir(dst, src string, monitor ...*progress.Manual) error
}

type HashiGoGetter

type HashiGoGetter struct {
}

func NewGetter

func NewGetter() *HashiGoGetter

func (HashiGoGetter) GetFile

func (g HashiGoGetter) GetFile(dst, src string, monitors ...*progress.Manual) error

func (HashiGoGetter) GetToDir

func (g HashiGoGetter) GetToDir(dst, src string, monitors ...*progress.Manual) error

Jump to

Keyboard shortcuts

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