diff options
author | axtloss <axtlos@getcryst.al> | 2024-01-27 19:07:09 +0100 |
---|---|---|
committer | axtloss <axtlos@getcryst.al> | 2024-01-27 19:07:09 +0100 |
commit | 158e9d6eb8a74bc6ce3c3f2a9709de081568dc02 (patch) | |
tree | 607a25db5c5764fe7f10a746aee1a4e9420e8d81 /cmd/verify.go | |
parent | 1b50046a214d81fe98c94a1220f7cbc1eeac669b (diff) | |
download | fsverify-158e9d6eb8a74bc6ce3c3f2a9709de081568dc02.tar.gz fsverify-158e9d6eb8a74bc6ce3c3f2a9709de081568dc02.tar.bz2 |
Add go project
Signed-off-by: axtloss <axtlos@getcryst.al>
Diffstat (limited to '')
-rw-r--r-- | cmd/verify.go | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/cmd/verify.go b/cmd/verify.go new file mode 100644 index 0000000..3ceabbe --- /dev/null +++ b/cmd/verify.go @@ -0,0 +1,32 @@ +package cmd + +import ( + "github.com/axtloss/fsverify/core" + "github.com/spf13/cobra" +) + +func NewVerifyCommand() *cobra.Command { + cmd := &cobra.Command{ + Use: "verify", + Short: "Verify the root filesystem based on the given verification", + RunE: ValidateCommand, + SilenceUsage: true, + } + + return cmd +} + +func ValidateCommand(_ *cobra.Command, args []string) error { + node := core.Node{ + BlockStart: 0, + BlockEnd: 4 * 1000, + BlockSum: "test", + PrevNodeSum: "aaaa", + } + err := core.AddNode(node, nil) + if err != nil { + return err + } + _, err = core.ReadHeader("./test.part") + return err +} |