Adding initial web server and storage server module infrastructure

This commit is contained in:
Frederick F. Kautz IV
2015-01-18 13:31:22 -08:00
parent 34b3cb7f9f
commit f356599e22
4 changed files with 108 additions and 0 deletions

View File

@@ -1 +1,33 @@
package storage
import (
"errors"
"io"
"net/http"
"github.com/gorilla/mux"
)
func GetHttpHandler() http.Handler {
mux := mux.NewRouter()
mux.HandleFunc("/", storageHandler)
return mux
}
func storageHandler(w http.ResponseWriter, req *http.Request) {
io.WriteString(w, "MINIO")
}
func Start() (chan<- string, <-chan error) {
ctrlChannel := make(chan string)
errorChannel := make(chan error)
go start(ctrlChannel, errorChannel)
return ctrlChannel, errorChannel
}
func start(ctrlChannel <-chan string, errorChannel chan<- error) {
errorChannel <- errors.New("STORAGE MSG")
errorChannel <- errors.New("STORAGE MSG")
errorChannel <- errors.New("STORAGE MSG")
close(errorChannel)
}