util

package
v2.8.2 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(src, dst string, closeCloser func(io.Closer)) error

CopyFile copies file from src to dst

func CopyStringMap added in v2.7.0

func CopyStringMap(mp map[string]string) map[string]string

CopyStringMap returns a copy of mp

func DirectoryChecksum added in v2.7.5

func DirectoryChecksum(inputDir string) (string, error)

DirectoryChecksum returns a hash of directory contents.

func ExecuteTemplate added in v2.7.0

func ExecuteTemplate(tmplString string, os, arch string, vars map[string]string) (string, error)

ExecuteTemplate executes a template

func FileChecksum

func FileChecksum(filename string) (string, error)

FileChecksum returns the hex checksum of a file

func FileExists

func FileExists(path string) bool

FileExists asserts that a file exists

func FileExistsWithChecksum

func FileExistsWithChecksum(filename, checksum string) (bool, error)

FileExistsWithChecksum returns true if the file both exists and has a matching checksum

func HexHash

func HexHash(hasher hash.Hash, data ...[]byte) (string, error)

HexHash returns a hex representation of data's hash This will only return non-nil error if given a hasher that can return a non-nil error from Write()

Types

This section is empty.

Jump to

Keyboard shortcuts

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