-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
42 changed files
with
2,102 additions
and
998 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package agglo | ||
|
||
import ( | ||
"fmt" | ||
"github.com/proofrock/snapkup/model" | ||
"github.com/proofrock/snapkup/util/agglos" | ||
) | ||
|
||
func Calc(threshold, target int) func(modl *model.Model) error { | ||
return func(modl *model.Model) error { | ||
agglos, blobs, errPlanning := agglos.Plan(modl, int64(threshold), int64(target)) | ||
if errPlanning != nil { | ||
return errPlanning | ||
} | ||
|
||
fmt.Printf("%d files will be merged, resulting in %d agglo files.\n", len(blobs), len(agglos)) | ||
|
||
return nil | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package agglo | ||
|
||
import ( | ||
"fmt" | ||
"github.com/proofrock/snapkup/model" | ||
"github.com/proofrock/snapkup/util/agglos" | ||
) | ||
|
||
func Do(bkpDir string, threshold, target int) func(modl *model.Model) error { | ||
return func(modl *model.Model) error { | ||
aggloss, blobs, errPlanning := agglos.Plan(modl, int64(threshold), int64(target)) | ||
if errPlanning != nil { | ||
return errPlanning | ||
} | ||
|
||
fmt.Printf("%d files will be merged, resulting in %d agglo files.\n", len(blobs), len(aggloss)) | ||
println("Performing merge...") | ||
|
||
errApplying := agglos.Apply(modl, bkpDir, aggloss, blobs) | ||
if errApplying != nil { | ||
return errApplying | ||
} | ||
|
||
println("All done.") | ||
|
||
return nil | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package agglo | ||
|
||
import ( | ||
"github.com/proofrock/snapkup/model" | ||
"github.com/proofrock/snapkup/util/agglos" | ||
) | ||
|
||
func Unpack(bkpDir string) func(modl *model.Model) error { | ||
return func(modl *model.Model) error { | ||
errSplitting := agglos.SplitAll(modl, bkpDir) | ||
if errSplitting != nil { | ||
return errSplitting | ||
} | ||
|
||
println("All ok.") | ||
|
||
return nil | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.