Skip to content
This repository has been archived by the owner on Aug 12, 2024. It is now read-only.

Commit

Permalink
manual merge for go code…
Browse files Browse the repository at this point in the history
Signed-off-by: Adrien Duermael <adrien@duermael.com>
  • Loading branch information
aduermael committed Sep 27, 2016
1 parent 4afc43e commit 389217e
Show file tree
Hide file tree
Showing 5,502 changed files with 1,153,310 additions and 281 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
28 changes: 3 additions & 25 deletions go/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@ package main

import (
"flag"
"net/http"
"os"

log "github.com/Sirupsen/logrus"
"os"
)

var debugFlag = flag.Bool("debug", false, "enable debug logging")
var daemonFlag = flag.Bool("daemon", false, "run the daemon")

func main() {
flag.Parse()
Expand All @@ -18,16 +15,6 @@ func main() {
log.SetLevel(log.DebugLevel)
}

// goproxy is executed as a short lived process to send a request to the
// goproxy daemon process
if !*daemonFlag {
if err := ProxyCmd(flag.Args()); err != nil {
log.Fatalf(err.Error())
os.Exit(1)
}
return
}

daemon := NewDaemon()
if err := daemon.Init(); err != nil {
log.Fatal(err.Error())
Expand All @@ -39,16 +26,7 @@ func main() {
os.Exit(1)
}

// start monitoring docker events
daemon.Client.StartMonitorEvents(daemon.eventCallback, nil)

// start a http server and listen on local port 8000
go func() {
http.HandleFunc("/containers", daemon.listContainers)
http.HandleFunc("/exec", daemon.execCmd)
http.ListenAndServe(":8000", nil)
}()
daemon.StartMonitoringEvents()

// wait for interruption
<-make(chan int)
daemon.Serve()
}
Loading

0 comments on commit 389217e

Please sign in to comment.