mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-06 05:30:57 +00:00
New ChecksumStorage and new PackagePool interfaces
This commit is contained in:
@@ -37,6 +37,11 @@ type ChecksumInfo struct {
|
||||
SHA512 string
|
||||
}
|
||||
|
||||
// Complete checks if all the checksums are present
|
||||
func (cksum *ChecksumInfo) Complete() bool {
|
||||
return cksum.MD5 != "" && cksum.SHA1 != "" && cksum.SHA256 != "" && cksum.SHA512 != ""
|
||||
}
|
||||
|
||||
// ChecksumsForFile generates size, MD5, SHA1 & SHA256 checksums for given file
|
||||
func ChecksumsForFile(path string) (ChecksumInfo, error) {
|
||||
file, err := os.Open(path)
|
||||
|
||||
Reference in New Issue
Block a user