adding decompress

This commit is contained in:
2020-07-07 15:03:33 -04:00
parent c07e09d155
commit ebd6e095f7
77 changed files with 185 additions and 50 deletions

View File

@@ -24,7 +24,7 @@ type GVCInfo struct {
// Commit stores all the necessary information for a commit
type Commit struct {
CommitHash []byte `storm:"index,unique"` // The hash of the commit (generated by hashing commit author name, time, the previous commit, and more? TODO: Not sure what else)
CommitHash []byte `storm:"id,index,unique"` // The hash of the commit (generated by hashing commit author name, time, the previous commit, and more? TODO: Not sure what else)
TrackedFiles []File // All of the tracked files for this commit
Date string
Version string //User can tag a commit with a version number
@@ -43,19 +43,19 @@ type CommitMeta struct {
// File represents a tracked file
type File struct {
ID int `storm:"id,increment"`
Path string `storm:"index"`
Name string
//BkpLocation string //TODO: Needed?
CurrentBase string
Hash []byte `storm:"index,unique"` // with []byte can't use sha256.sum256 since that is [32]byte, so everything done manually.
CreatedAt time.Time
Unique string
Version float64
NoCompress bool // Whether or not to compress this file
ID int `storm:"id,increment"`
Path string `storm:"index"`
BaseFilePath string // This stores the path to the tracked version of the file in the object database
Name string
//CurrentBase string
Hash []byte `storm:"index,unique"` // with []byte can't use sha256.sum256 since that is [32]byte, so everything done manually.
CreatedAt time.Time
Unique string
Version float64
NoCompress bool // Whether or not to compress this file
}
// CalculateHash creates a hash for the file
// CalculateHash creates a hash for the file //Requires path
func (f *File) CalculateHash() error {
fileContents, err := ioutil.ReadFile(f.Path)
if err != nil {