util

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecOutput

func ExecOutput(cmd string, args ...string) (string, error)

ExecOutput executes a command and returns its standard output

func Md5

func Md5(file string) (string, error)

Md5 returns md5sum for the given file

func Sha1

func Sha1(file string) (string, error)

Sha1 returns sha1sum for the given file

func Sha256

func Sha256(file string) (string, error)

Sha256 returns sha256sum for the given file

func TrimString

func TrimString(val string) string

TrimString trims string for: ' ', '"', '\n'

func ZipFiles

func ZipFiles(filename string, files []string) error

ZipFiles compresses one or many files into a single zip archive file. The original code was published under MIT licence under https://golangcode.com/create-zip-files-in-go/

Types

type ChecksumDetails

type ChecksumDetails struct {
	Md5    string
	Sha1   string
	Sha256 string
}

ChecksumDetails provides check sums

func GetChecksumDetails

func GetChecksumDetails(filePath string) (ChecksumDetails, error)

GetChecksumDetails returns file checksums for a given file

type FileDetails

type FileDetails struct {
	Checksum ChecksumDetails
	Size     int64
}

FileDetails provides check sums and size for a given file

func GetFileDetails

func GetFileDetails(filePath string) (*FileDetails, error)

GetFileDetails returns file details for a given file

Jump to

Keyboard shortcuts

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