util

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDirectoryHash

func GetDirectoryHash(dirPath string) (string, error)

GetDirectoryHash returns a MD5 sum of a directory, calculated as the hash of all contained files' hashes. If walking the directory or any read operation fails, GetDirectoryHash returns an error. In that case, GetDirectoryHash does not wait for inflight read operations to complete.

func GetEnv

func GetEnv(key string, defaultVal string) string

func GetEnvAsBool

func GetEnvAsBool(key string, defaultVal bool) bool

func GetEnvAsInt

func GetEnvAsInt(key string, defaultVal int) int

func GetFileHash

func GetFileHash(filePath string) (string, error)

GetFileHash returns a MD5 sum of a file, calculated using the file's content

func GetTemplateHash

func GetTemplateHash(paths ...string) (string, error)

func MD5All

func MD5All(root string) (map[string][md5.Size]byte, error)

MD5All reads all the files in the file tree rooted at root and returns a map from file path to the MD5 sum of the file's contents. If the directory walk fails or any read operation fails, MD5All returns an error. In that case, MD5All does not wait for inflight read operations to complete.

Types

This section is empty.

Jump to

Keyboard shortcuts

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