dumping all of the database and utilites into the project, will work on the managers next

This commit is contained in:
2020-06-11 13:53:51 -04:00
parent 2cbdf21a81
commit 0ecb0b96ce
10 changed files with 741 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
package engine
import (
"fmt"
"os"
"github.com/amlwwalker/fdelta"
)
func main() {
DefineFiles()
originalBytes := GetOriginalBytes()
delta := CreateDelta(originalBytes)
StoreDelta(delta)
retrievedDelta := RetrieveDelta()
// var deltaBytes []byte
fmt.Printf("res : `%s`\n", len(retrievedDelta))
//test loading the delta from disk
appliedBytes, err := fdelta.Apply(originalBytes, retrievedDelta)
if err != nil {
panic(err)
}
fmt.Println("exporting delta")
err = writeFile(appliedFile, appliedBytes)
if err != nil {
fmt.Println("error reading bytes [3]", err)
os.Exit(1)
}
fmt.Printf("Origin : `%s`\n", originalFile)
fmt.Printf("Target : `%s`\n", len(appliedBytes))
fmt.Printf("Delta : `%s`\n", len(delta))
fmt.Printf("Result: `%s`\n", appliedFile)
}