Initial work for xml list objects

This commit is contained in:
Frederick F. Kautz IV
2015-01-20 16:08:14 -08:00
parent 5a4f472638
commit 53190e1210
6 changed files with 148 additions and 10 deletions

View File

@@ -5,16 +5,16 @@ import (
"net/http"
)
func Start(handler http.Handler) (chan<- string, <-chan error) {
func Start(handler http.Handler, address string) (chan<- string, <-chan error) {
ctrlChannel := make(chan string)
errorChannel := make(chan error)
go start(ctrlChannel, errorChannel, handler)
go start(ctrlChannel, errorChannel, handler, address)
return ctrlChannel, errorChannel
}
func start(ctrlChannel <-chan string, errorChannel chan<- error, router http.Handler) {
log.Println("Starting HTTP Server")
err := http.ListenAndServe(":8080", router)
func start(ctrlChannel <-chan string, errorChannel chan<- error, router http.Handler, address string) {
log.Println("Starting HTTP Server on " + address)
err := http.ListenAndServe(address, router)
errorChannel <- err
close(errorChannel)
}