- init folder if not present already in 'get()' call - put.go was referencing wrong args - fix it - if no OBJECTNAME is specified during 'get' - grab a list of files under "~/.minio" - Provide new API GetList() for ObjectStorage structmaster
parent
3fe2c2af01
commit
f6a5b61b00
@ -1 +1,33 @@ |
||||
package main |
||||
|
||||
import ( |
||||
"log" |
||||
"os" |
||||
|
||||
"github.com/codegangsta/cli" |
||||
) |
||||
|
||||
func put(c *cli.Context) { |
||||
config, err := parseInput(c) |
||||
if err != nil { |
||||
log.Fatal(err) |
||||
} |
||||
filePath := c.Args().Get(0) |
||||
if len(filePath) == 0 { |
||||
log.Fatal("Please specify a valid object name \n # erasure-demo put <OBJECTNAME>") |
||||
} |
||||
inputFile, err := os.Open(filePath) |
||||
if err != nil { |
||||
log.Fatal(err) |
||||
} |
||||
switch config.storageDriver { |
||||
case "fs": |
||||
{ |
||||
fsPut(config, c.Args().Get(0), inputFile) |
||||
} |
||||
default: |
||||
{ |
||||
log.Fatal("Unknown driver") |
||||
} |
||||
} |
||||
} |
||||
|
@ -1,6 +1,7 @@ |
||||
package storage |
||||
|
||||
type ObjectStorage interface { |
||||
GetList() ([]byte, error) |
||||
Get(path string) ([]byte, error) |
||||
Put(path string, object []byte) error |
||||
} |
||||
|
Loading…
Reference in new issue