reworking database, init and add commands

This commit is contained in:
2020-07-02 15:00:30 -04:00
parent 6379c73e38
commit 5af55ed62e
15 changed files with 220 additions and 295 deletions

View File

@@ -5,11 +5,26 @@ import (
"fmt"
"io/ioutil"
"time"
"github.com/asdine/storm"
"github.com/rs/zerolog"
)
type DB struct {
*storm.DB
*zerolog.Logger
}
// GVCInfo stores the basic information about when the repo was init'd and some basic information
type GVCInfo struct {
GVCVersion string `storm:"id"`
InitTime string
RepoName string
}
// Commit stores all the necessary information for a commit
type Commit struct {
CommitHash []byte // 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:"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