Merge pull request #38 from fkautz/pr_out_adding_k_and_m_as_optional_parameters_for_encoding_in_minio_encode

Adding k and m as optional parameters for encoding in minio-encode
master
Harshavardhana 10 years ago
commit 4b97cf4b9d
  1. 15
      cmd/minio-encode/main.go

@ -25,6 +25,16 @@ func main() {
Value: "", Value: "",
Usage: "Output file", 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) { app.Action = func(c *cli.Context) {
// check if minio-encode called without parameters // check if minio-encode called without parameters
@ -44,6 +54,9 @@ func main() {
outputFilePath = c.String("output") outputFilePath = c.String("output")
} }
k := c.Int("k")
m := c.Int("m")
// get file // get file
inputFile, err := os.Open(inputFilePath) inputFile, err := os.Open(inputFilePath)
if err != nil { if err != nil {
@ -57,7 +70,7 @@ func main() {
} }
// set up encoder // set up encoder
erasureParameters, _ := erasure.ValidateParams(10, 5, 8, erasure.CAUCHY) erasureParameters, _ := erasure.ValidateParams(k, m, 8, erasure.CAUCHY)
encoder := erasure.NewEncoder(erasureParameters) encoder := erasure.NewEncoder(erasureParameters)
// encode data // encode data

Loading…
Cancel
Save