summaryrefslogtreecommitdiff
path: root/http.go
diff options
context:
space:
mode:
Diffstat (limited to 'http.go')
-rw-r--r--http.go155
1 files changed, 87 insertions, 68 deletions
diff --git a/http.go b/http.go
index 9a8cda7..f04ebe5 100644
--- a/http.go
+++ b/http.go
@@ -156,83 +156,25 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
repo.Status.Whitelist = true
}
case "/testNext":
- // re-scans the go.sum file. DOES NOT MODIFY ANYTHING
- check := me.forge.Repos.FindByGoPath(me.current.GoPath())
- if check == nil {
- log.Info("boo, you didn't git clone", me.current.GoPath())
- return
- }
- if me.forge.FinalGoDepsCheckOk(check) {
- log.Info("finalGoDepsCheck(check) worked!")
- } else {
- log.Info("finalGoDepsCheck(check) failed. boo.")
- }
+ testNext()
+ return
+ case "/fixNext":
+ // destroy and recreate the go.sum
+ fixGodeps(me.current)
return
case "/showNext":
- log.Info("gui repo: " + me.release.repo.String())
- log.Info("gui name: " + me.release.version.String())
- log.Info("gui notes: " + me.release.notes.String())
- log.Info("gui status: " + me.release.status.String())
- log.Info("")
- if me.current == nil {
- log.Info("me.current == nil")
- return
- }
-
- if me.current.Status.IsReleased() {
- log.Info("IsReleased() == true SHOULD NOT RELEASE THIS")
- } else {
- log.Info("IsReleased() == false")
- }
- if me.current.Status.CheckDirty() {
- log.Info("CheckDirty() == true. SHOULD NOT RELEASE THIS")
- } else {
- log.Info("CheckDirty() == false")
- }
- if me.current.Status.IsPrimitive() {
- log.Info("IsPrimitive() == true")
- } else {
- log.Info("IsPrimitive() == false")
- }
- if me.current.Status.IsPrivate() {
- log.Info("IsPrivate() == true")
- } else {
- log.Info("IsPrivate() == false")
- }
- if ok, compiled, err := me.current.IsProtobuf(); ok {
- log.Info(log.Sprint("IsProtobuf() == true compiled protobuf files = ", compiled))
- if err != nil {
- log.Info(log.Sprint("IsProtobuf() == err", err))
- os.Exit(-1)
- }
- for _, s := range compiled {
- log.Info("\tcompiled file found:", s)
- }
- } else {
- log.Info("IsProtobuf() == false")
- if err != nil {
- log.Info(log.Sprint("IsProtobuf() == err", err))
- }
- }
- if me.current.Status.Whitelist {
- log.Info("Whitelist == true SHOULD NOT RELEASE THIS")
- } else {
- log.Info("Whitelist == false")
- }
- log.Info("")
-
- log.Info(repolist.ReportHeader())
- log.Info(me.current.StandardHeader())
- log.Info("")
- log.Info(repolist.ReleaseReportHeader())
- log.Info(me.current.StandardReleaseHeader())
+ showNext()
+ return
case "/list":
PrintReport(readonly, onlydirty, perfect)
+ return
case "/releaseList":
PrintReleaseReport(readonly, perfect)
+ return
case "/quit":
log.Info("Got URL /quit")
os.Exit(0)
+ return
case "/goweblist":
loop := me.repos.View.ReposAll()
for loop.Scan() {
@@ -262,6 +204,7 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
*/
}
+ return
default:
log.Info("BAD URL = " + route)
}
@@ -279,3 +222,79 @@ func startHTTP() {
log.Println("Error starting server:", err)
}
}
+
+func testNext() {
+ // re-scans the go.sum file. DOES NOT MODIFY ANYTHING
+ check := me.forge.Repos.FindByGoPath(me.current.GoPath())
+ if check == nil {
+ log.Info("boo, you didn't git clone", me.current.GoPath())
+ return
+ }
+ if me.forge.FinalGoDepsCheckOk(check) {
+ log.Info("finalGoDepsCheck(check) worked!")
+ } else {
+ log.Info("finalGoDepsCheck(check) failed. boo.")
+ }
+}
+
+func showNext() {
+ log.Info("gui repo: " + me.release.repo.String())
+ log.Info("gui name: " + me.release.version.String())
+ log.Info("gui notes: " + me.release.notes.String())
+ log.Info("gui status: " + me.release.status.String())
+ log.Info("")
+ if me.current == nil {
+ log.Info("me.current == nil")
+ return
+ }
+
+ if me.current.Status.IsReleased() {
+ log.Info("IsReleased() == true SHOULD NOT RELEASE THIS")
+ } else {
+ log.Info("IsReleased() == false")
+ }
+ if me.current.Status.CheckDirty() {
+ log.Info("CheckDirty() == true. SHOULD NOT RELEASE THIS")
+ } else {
+ log.Info("CheckDirty() == false")
+ }
+ if me.current.Status.IsPrimitive() {
+ log.Info("IsPrimitive() == true")
+ } else {
+ log.Info("IsPrimitive() == false")
+ }
+ if me.current.Status.IsPrivate() {
+ log.Info("IsPrivate() == true")
+ } else {
+ log.Info("IsPrivate() == false")
+ }
+ if ok, compiled, err := me.current.IsProtobuf(); ok {
+ log.Info(log.Sprint("IsProtobuf() == true compiled protobuf files = ", compiled))
+ if err != nil {
+ log.Info(log.Sprint("IsProtobuf() == err", err))
+ os.Exit(-1)
+ }
+ for _, s := range compiled {
+ log.Info("\tcompiled file found:", s)
+ }
+ } else {
+ log.Info("IsProtobuf() == false")
+ if err != nil {
+ log.Info(log.Sprint("IsProtobuf() == err", err))
+ }
+ }
+ if me.current.Status.Whitelist {
+ log.Info("Whitelist == true SHOULD NOT RELEASE THIS")
+ } else {
+ log.Info("Whitelist == false")
+ }
+ log.Info("")
+
+ log.Info(repolist.ReportHeader())
+ log.Info(me.current.StandardHeader())
+ log.Info("")
+ log.Info(repolist.ReleaseReportHeader())
+ log.Info(me.current.StandardReleaseHeader())
+
+ testNext()
+}