debug logs and b64 non encodable

This commit is contained in:
bel
2020-04-08 02:25:24 +00:00
parent cc6b6f9226
commit 84400e4401
9 changed files with 25 additions and 2 deletions

View File

@@ -4,15 +4,18 @@ import (
"local/firestormy/config"
"local/firestormy/config/ns"
"local/firestormy/scheduler"
"local/logb"
"net/http"
"strings"
)
func (s *Server) disable(w http.ResponseWriter, r *http.Request) {
logb.Debugf("[access] disable %s", r.URL.Path)
s.setDisabled(w, r, true)
}
func (s *Server) enable(w http.ResponseWriter, r *http.Request) {
logb.Debugf("[access] enable %s", r.URL.Path)
s.setDisabled(w, r, false)
}

View File

@@ -4,11 +4,13 @@ import (
"local/firestormy/config"
"local/firestormy/config/ns"
"local/firestormy/scheduler"
"local/logb"
"net/http"
"strings"
)
func (s *Server) delete(w http.ResponseWriter, r *http.Request) {
logb.Debugf("[access] delete %s", r.URL.Path)
keys := strings.Split(r.URL.Path, "/")
key := keys[len(keys)-1]

View File

@@ -5,11 +5,13 @@ import (
"local/firestormy/config"
"local/firestormy/config/ns"
"local/firestormy/scheduler"
"local/logb"
"net/http"
"strings"
)
func (s *Server) get(w http.ResponseWriter, r *http.Request) {
logb.Debugf("[access] get %s", r.URL.Path)
keys := strings.Split(r.URL.Path, "/")
key := keys[len(keys)-1]

View File

@@ -5,12 +5,15 @@ import (
"local/firestormy/config"
"local/firestormy/config/ns"
"local/firestormy/scheduler"
"local/logb"
"net/http"
"sort"
)
func (s *Server) list(w http.ResponseWriter, r *http.Request) {
logb.Debugf("[access] list %s", r.URL.Path)
jobs, err := config.Store.List(ns.Jobs)
logb.Debugf("[access] list : %v: %+v", err, jobs)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return

View File

@@ -4,11 +4,13 @@ import (
"local/firestormy/config"
"local/firestormy/config/ns"
"local/firestormy/scheduler"
"local/logb"
"net/http"
"strings"
)
func (s *Server) run(w http.ResponseWriter, r *http.Request) {
logb.Debugf("[access] run %s", r.URL.Path)
keys := strings.Split(r.URL.Path, "/")
key := keys[len(keys)-1]

View File

@@ -8,6 +8,7 @@ import (
"local/firestormy/config"
"local/firestormy/config/ns"
"local/firestormy/scheduler"
"local/logb"
"net/http"
"github.com/google/uuid"
@@ -63,6 +64,7 @@ func (u *upsertRequest) toJob() (*scheduler.Job, error) {
}
func (s *Server) upsert(w http.ResponseWriter, r *http.Request) {
logb.Debugf("[access] upsert %s", r.URL.Path)
upsert, err := newUpsertRequest(r.Body)
if err != nil {
http.Error(w, err.Error(), http.StatusBadRequest)