Merge pull request #306 from harshavardhana/pr_out_some_necessary_cleanup
This commit is contained in:
commit
dc1589bb5f
12 changed files with 34 additions and 34 deletions
4
main.go
4
main.go
|
@ -28,8 +28,8 @@ func getStorageType(input string) server.StorageType {
|
|||
switch {
|
||||
case input == "file":
|
||||
return server.File
|
||||
case input == "inmemory":
|
||||
return server.InMemory
|
||||
case input == "memory":
|
||||
return server.Memory
|
||||
default:
|
||||
{
|
||||
log.Println("Unknown storage type:", input)
|
||||
|
|
|
@ -30,7 +30,7 @@ import (
|
|||
|
||||
"github.com/minio-io/minio/pkg/api/minioapi"
|
||||
mstorage "github.com/minio-io/minio/pkg/storage"
|
||||
"github.com/minio-io/minio/pkg/storage/inmemory"
|
||||
"github.com/minio-io/minio/pkg/storage/memory"
|
||||
|
||||
. "gopkg.in/check.v1"
|
||||
)
|
||||
|
@ -42,7 +42,7 @@ type MySuite struct{}
|
|||
var _ = Suite(&MySuite{})
|
||||
|
||||
func (s *MySuite) TestNonExistantObject(c *C) {
|
||||
_, _, storage := inmemory.Start()
|
||||
_, _, storage := memory.Start()
|
||||
httpHandler := minioapi.HTTPHandler("", storage)
|
||||
testServer := httptest.NewServer(httpHandler)
|
||||
defer testServer.Close()
|
||||
|
@ -54,7 +54,7 @@ func (s *MySuite) TestNonExistantObject(c *C) {
|
|||
}
|
||||
|
||||
func (s *MySuite) TestEmptyObject(c *C) {
|
||||
_, _, storage := inmemory.Start()
|
||||
_, _, storage := memory.Start()
|
||||
httpHandler := minioapi.HTTPHandler("", storage)
|
||||
testServer := httptest.NewServer(httpHandler)
|
||||
defer testServer.Close()
|
||||
|
@ -79,7 +79,7 @@ func (s *MySuite) TestEmptyObject(c *C) {
|
|||
}
|
||||
|
||||
func (s *MySuite) TestObject(c *C) {
|
||||
_, _, storage := inmemory.Start()
|
||||
_, _, storage := memory.Start()
|
||||
httpHandler := minioapi.HTTPHandler("", storage)
|
||||
testServer := httptest.NewServer(httpHandler)
|
||||
defer testServer.Close()
|
||||
|
@ -102,7 +102,7 @@ func (s *MySuite) TestObject(c *C) {
|
|||
}
|
||||
|
||||
func (s *MySuite) TestMultipleObjects(c *C) {
|
||||
_, _, storage := inmemory.Start()
|
||||
_, _, storage := memory.Start()
|
||||
httpHandler := minioapi.HTTPHandler("", storage)
|
||||
testServer := httptest.NewServer(httpHandler)
|
||||
defer testServer.Close()
|
||||
|
@ -182,7 +182,7 @@ func (s *MySuite) TestMultipleObjects(c *C) {
|
|||
}
|
||||
|
||||
func (s *MySuite) TestNotImplemented(c *C) {
|
||||
_, _, storage := inmemory.Start()
|
||||
_, _, storage := memory.Start()
|
||||
httpHandler := minioapi.HTTPHandler("", storage)
|
||||
testServer := httptest.NewServer(httpHandler)
|
||||
defer testServer.Close()
|
||||
|
@ -193,7 +193,7 @@ func (s *MySuite) TestNotImplemented(c *C) {
|
|||
}
|
||||
|
||||
func (s *MySuite) TestHeader(c *C) {
|
||||
_, _, storage := inmemory.Start()
|
||||
_, _, storage := memory.Start()
|
||||
httpHandler := minioapi.HTTPHandler("", storage)
|
||||
testServer := httptest.NewServer(httpHandler)
|
||||
defer testServer.Close()
|
||||
|
@ -216,7 +216,7 @@ func (s *MySuite) TestHeader(c *C) {
|
|||
}
|
||||
|
||||
func (s *MySuite) TestPutBucket(c *C) {
|
||||
_, _, storage := inmemory.Start()
|
||||
_, _, storage := memory.Start()
|
||||
httpHandler := minioapi.HTTPHandler("", storage)
|
||||
testServer := httptest.NewServer(httpHandler)
|
||||
defer testServer.Close()
|
||||
|
@ -241,7 +241,7 @@ func (s *MySuite) TestPutBucket(c *C) {
|
|||
}
|
||||
|
||||
func (s *MySuite) TestPutObject(c *C) {
|
||||
_, _, storage := inmemory.Start()
|
||||
_, _, storage := memory.Start()
|
||||
httpHandler := minioapi.HTTPHandler("", storage)
|
||||
testServer := httptest.NewServer(httpHandler)
|
||||
defer testServer.Close()
|
||||
|
@ -298,7 +298,7 @@ func (s *MySuite) TestPutObject(c *C) {
|
|||
}
|
||||
|
||||
func (s *MySuite) TestListBuckets(c *C) {
|
||||
_, _, storage := inmemory.Start()
|
||||
_, _, storage := memory.Start()
|
||||
httpHandler := minioapi.HTTPHandler("", storage)
|
||||
testServer := httptest.NewServer(httpHandler)
|
||||
defer testServer.Close()
|
||||
|
@ -378,7 +378,7 @@ func verifyHeaders(c *C, header http.Header, date time.Time, size int, contentTy
|
|||
}
|
||||
|
||||
func (s *MySuite) TestXMLNameNotInBucketListJson(c *C) {
|
||||
_, _, storage := inmemory.Start()
|
||||
_, _, storage := memory.Start()
|
||||
httpHandler := minioapi.HTTPHandler("", storage)
|
||||
testServer := httptest.NewServer(httpHandler)
|
||||
defer testServer.Close()
|
||||
|
@ -403,7 +403,7 @@ func (s *MySuite) TestXMLNameNotInBucketListJson(c *C) {
|
|||
}
|
||||
|
||||
func (s *MySuite) TestXMLNameNotInObjectListJson(c *C) {
|
||||
_, _, storage := inmemory.Start()
|
||||
_, _, storage := memory.Start()
|
||||
httpHandler := minioapi.HTTPHandler("", storage)
|
||||
testServer := httptest.NewServer(httpHandler)
|
||||
defer testServer.Close()
|
||||
|
@ -428,7 +428,7 @@ func (s *MySuite) TestXMLNameNotInObjectListJson(c *C) {
|
|||
}
|
||||
|
||||
func (s *MySuite) TestContentTypePersists(c *C) {
|
||||
_, _, storage := inmemory.Start()
|
||||
_, _, storage := memory.Start()
|
||||
httpHandler := minioapi.HTTPHandler("", storage)
|
||||
testServer := httptest.NewServer(httpHandler)
|
||||
defer testServer.Close()
|
||||
|
|
|
@ -26,8 +26,8 @@ import (
|
|||
"github.com/minio-io/minio/pkg/api/webuiapi"
|
||||
"github.com/minio-io/minio/pkg/server/httpserver"
|
||||
mstorage "github.com/minio-io/minio/pkg/storage"
|
||||
"github.com/minio-io/minio/pkg/storage/fs"
|
||||
"github.com/minio-io/minio/pkg/storage/inmemory"
|
||||
"github.com/minio-io/minio/pkg/storage/file"
|
||||
"github.com/minio-io/minio/pkg/storage/memory"
|
||||
)
|
||||
|
||||
// Config - http server parameters
|
||||
|
@ -40,7 +40,7 @@ type Config struct {
|
|||
APIType interface{}
|
||||
}
|
||||
|
||||
// MinioAPI - storage type donut, fs, inmemory
|
||||
// MinioAPI - storage type donut, file, memory
|
||||
type MinioAPI struct {
|
||||
StorageType StorageType
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ type StorageType int
|
|||
|
||||
// Storage types
|
||||
const (
|
||||
InMemory = iota
|
||||
Memory = iota
|
||||
File
|
||||
Donut
|
||||
)
|
||||
|
@ -126,9 +126,9 @@ func getStorageChannels(storageType StorageType) (ctrlChans []chan<- string, sta
|
|||
// - ctrlChans has channel to communicate to storage
|
||||
// - statusChans has channel for messages coming from storage
|
||||
switch {
|
||||
case storageType == InMemory:
|
||||
case storageType == Memory:
|
||||
{
|
||||
ctrlChan, statusChan, storage = inmemory.Start()
|
||||
ctrlChan, statusChan, storage = memory.Start()
|
||||
ctrlChans = append(ctrlChans, ctrlChan)
|
||||
statusChans = append(statusChans, statusChan)
|
||||
}
|
||||
|
@ -139,7 +139,7 @@ func getStorageChannels(storageType StorageType) (ctrlChans []chan<- string, sta
|
|||
return nil, nil, nil
|
||||
}
|
||||
root := path.Join(u.HomeDir, "minio-storage")
|
||||
ctrlChan, statusChan, storage = fs.Start(root)
|
||||
ctrlChan, statusChan, storage = file.Start(root)
|
||||
ctrlChans = append(ctrlChans, ctrlChan)
|
||||
statusChans = append(statusChans, statusChan)
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package fs
|
||||
package file
|
||||
|
||||
import (
|
||||
"os"
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package fs
|
||||
package file
|
||||
|
||||
import (
|
||||
"os"
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package fs
|
||||
package file
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
|
@ -26,7 +26,7 @@ import (
|
|||
mstorage "github.com/minio-io/minio/pkg/storage"
|
||||
)
|
||||
|
||||
// Storage - fs local variables
|
||||
// Storage - file local variables
|
||||
type Storage struct {
|
||||
root string
|
||||
lock *sync.Mutex
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package fs
|
||||
package file
|
||||
|
||||
import (
|
||||
"os"
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package fs
|
||||
package file
|
||||
|
||||
import (
|
||||
"io"
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package fs
|
||||
package file
|
||||
|
||||
import (
|
||||
"os"
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package fs
|
||||
package file
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
|
@ -35,7 +35,7 @@ var _ = Suite(&MySuite{})
|
|||
func (s *MySuite) TestAPISuite(c *C) {
|
||||
var storageList []string
|
||||
create := func() mstorage.Storage {
|
||||
path, err := ioutil.TempDir(os.TempDir(), "minio-fs-")
|
||||
path, err := ioutil.TempDir(os.TempDir(), "minio-file-")
|
||||
c.Check(err, IsNil)
|
||||
storageList = append(storageList, path)
|
||||
_, _, store := Start(path)
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package inmemory
|
||||
package memory
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
|
@ -48,7 +48,7 @@ type storedObject struct {
|
|||
data []byte
|
||||
}
|
||||
|
||||
// Start inmemory object server
|
||||
// Start memory object server
|
||||
func Start() (chan<- string, <-chan error, *Storage) {
|
||||
ctrlChannel := make(chan string)
|
||||
errorChannel := make(chan error)
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package inmemory
|
||||
package memory
|
||||
|
||||
import (
|
||||
"testing"
|
Loading…
Reference in a new issue