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

@@ -0,0 +1,19 @@
package httpserver
import (
"log"
"net/http"
)
func Start(handler http.Handler) (chan<- string, <-chan error) {
ctrlChannel := make(chan string)
errorChannel := make(chan error)
go start(ctrlChannel, errorChannel, handler)
return ctrlChannel, errorChannel
}
func start(ctrlChannel <-chan string, errorChannel chan<- error, router http.Handler) {
log.Println("Starting HTTP Server")
err := http.ListenAndServe(":8080", router)
errorChannel <- err
}