This repository has been archived by the owner on Feb 10, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Filip
committed
Sep 29, 2017
1 parent
a6194a1
commit 3833909
Showing
273 changed files
with
149,454 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,29 @@ | ||
package main | ||
|
||
import ( | ||
"log" | ||
"net/http" | ||
|
||
"github.com/AirHelp/rabbit-amazon-forwarder/mapping" | ||
"github.com/AirHelp/rabbit-amazon-forwarder/supervisor" | ||
log "github.com/sirupsen/logrus" | ||
"net/http" | ||
"os" | ||
) | ||
|
||
func main() { | ||
log.SetFormatter(&log.TextFormatter{}) | ||
log.SetOutput(os.Stdout) | ||
|
||
consumerForwarderMap, err := mapping.New().Load() | ||
if err != nil { | ||
log.Fatalf("Could not load consumer->forwader pairs. Error: " + err.Error()) | ||
log.WithFields(log.Fields{ | ||
"error": err.Error()}).Fatalf("Could not load consumer - forwarder pairs. Error: " + err.Error()) | ||
} | ||
supervisor := supervisor.New(consumerForwarderMap) | ||
if err := supervisor.Start(); err != nil { | ||
log.Fatal("Could not start supervisor. Error: ", err.Error()) | ||
log.WithFields(log.Fields{ | ||
"error": err.Error()}).Fatal("Could not start supervisor") | ||
} | ||
http.HandleFunc("/restart", supervisor.Restart) | ||
http.HandleFunc("/health", supervisor.Check) | ||
log.Print("Starting http server") | ||
log.Info("Starting http server") | ||
log.Fatal(http.ListenAndServe(":8080", nil)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.