hashcache

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CheckSumFileName is the checksum file name (base with no directories)
	CheckSumFileName = "checksum.txt"
)

Variables

View Source
var (
	// CheckSumFilePath is the Checksum file name
	CheckSumFilePath = CheckSumFileName
	// CheckSums is the hash that stores checksums keyed on relative path
	CheckSums = make(map[string]string)
)

Functions

func CalcChecksum

func CalcChecksum(file string) (string, error)

CalcChecksum works out the checksum string

func GetCachedChecksum

func GetCachedChecksum(file string) (string, error)

GetCachedChecksum will return previously calculated checksum

func GetFiles

func GetFiles(path string) []string

GetFiles will return a list of files that have been transfered

func IsCached

func IsCached(file string) bool

IsCached will check if a file is present on disk and in the checksum file

func IsCachedMatch

func IsCachedMatch(file string, sha256 string) bool

IsCachedMatch will verify if a file is in Cache AND matching expected sha256

func UpdateCache

func UpdateCache(file string) (string, error)

UpdateCache will write a new cache entry into checksum file

Types

This section is empty.

Jump to

Keyboard shortcuts

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