mirror of
https://github.com/minio/minio.git
synced 2025-04-06 12:50:34 -04:00
34 lines
569 B
Go
34 lines
569 B
Go
package main
|
|
|
|
import (
|
|
"io"
|
|
"log"
|
|
"os"
|
|
|
|
"github.com/codegangsta/cli"
|
|
)
|
|
|
|
func get(c *cli.Context) {
|
|
config, err := parseInput(c)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
var objectName string
|
|
var objectReader io.Reader
|
|
switch len(c.Args()) {
|
|
case 1:
|
|
objectName = c.Args().Get(0)
|
|
default:
|
|
log.Fatal("Please specify a valid object name \n # erasure-demo get [OBJECTNAME]")
|
|
}
|
|
|
|
getConfig := config
|
|
getConfig.k = 10
|
|
getConfig.m = 6
|
|
if objectReader, err = erasureGet(getConfig, objectName); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
|
|
io.Copy(os.Stdout, objectReader)
|
|
}
|