infra

package
v0.0.0-...-e9343d5 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFileNotFound = errors.New("arquivo não encontrado")
)

Functions

func Cleanup

func Cleanup(files []string) []string

Cleanup remove files and return a list of files NOT removed.

func DownloadAndUnzip

func DownloadAndUnzip(url, zip string, filters []string) ([]string, error)

func FileHash

func FileHash(filename string) (string, error)

func Unzip

func Unzip(src, dest string, filters []string, verbose bool) ([]string, error)

UnzipVerbosity will decompress a zip archive, moving all files and folders within the zip file (parameter 1) to an output directory (parameter 2). Source: https://golangcode.com/unzip-files-in-go/

Types

type WriteCounter

type WriteCounter struct {
	Total uint64
}

WriteCounter counts the number of bytes written the io.Writer. source: https://golangcode.com/download-a-file-with-progress/

func (*WriteCounter) Write

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

Write implements the io.Writer interface and will be passed to io.TeeReader().

Jump to

Keyboard shortcuts

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