From cec0a0ef68bc798900b6d1adc5a2787fa107775c Mon Sep 17 00:00:00 2001 From: "Frederick F. Kautz IV" Date: Sun, 23 Nov 2014 15:49:16 -0800 Subject: [PATCH] Adding k and m as optional parameters for encoding in minio-encode --- cmd/minio-encode/main.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/cmd/minio-encode/main.go b/cmd/minio-encode/main.go index 5c8001a57..e8ab29cef 100644 --- a/cmd/minio-encode/main.go +++ b/cmd/minio-encode/main.go @@ -25,6 +25,16 @@ func main() { Value: "", Usage: "Output file", }, + cli.IntFlag{ + Name: "k", + Value: 10, + Usage: "k value of encoder parameters", + }, + cli.IntFlag{ + Name: "m", + Value: 5, + Usage: "m value of encoder parameters", + }, } app.Action = func(c *cli.Context) { // check if minio-encode called without parameters @@ -44,6 +54,9 @@ func main() { outputFilePath = c.String("output") } + k := c.Int("k") + m := c.Int("m") + // get file inputFile, err := os.Open(inputFilePath) if err != nil { @@ -57,7 +70,7 @@ func main() { } // set up encoder - erasureParameters, _ := erasure.ValidateParams(10, 5, 8, erasure.CAUCHY) + erasureParameters, _ := erasure.ValidateParams(k, m, 8, erasure.CAUCHY) encoder := erasure.NewEncoder(erasureParameters) // encode data