/* * Bitbucket Server API * * Bitbucket Server API (former stash). * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package swagger import ( "fmt" "io/ioutil" "log" "net/http" "os" "github.com/gorilla/mux" ) func AddGroupToUser(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func AddUserToGroup(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func AddUserToGroups(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func AddUsersToGroup(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func Approve(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func AssignParticipantRole(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func CanMerge(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func ClearSenderAddress(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func ClearUserCaptchaChallenge(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func CountPullRequestTasks(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func Create(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func CreateBranch(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func CreateComment(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func CreateCommentCommit(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func CreateGroup(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func CreateProject(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func CreateRepository(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func CreateTag(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func CreateTask(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func CreateUser(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func CreateWebhook(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func Decline(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func Delete(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func DeleteAvatar(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func DeleteComment(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func DeleteCommentCommit(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func DeleteGroup(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func DeleteMailConfig(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func DeleteProject(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func DeleteRepository(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func DeleteRepositoryHook(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func DeleteTask(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func DeleteUser(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func DeleteWebhook(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func DisableHook(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func DisableHookRepo(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func EditFile(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func EnableHook(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func EnableHookRepo(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func FindGroupsForUser(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func FindOtherGroupsForUser(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func FindUsersInGroup(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func FindUsersNotInGroup(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func FindWebhooks(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func ForkRepository(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func Get(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetActivities(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetApplicationProperties(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetArchive(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetAvatar(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetBranches(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetChanges(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetChangesFile(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetComment(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetCommentCommit(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetComments(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetCommentsCommit(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetCommit(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetCommits(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetCommitsPR(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetContentBrowse(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetContentFile(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetContentRepository(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetContentRepositoryPath(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetDefaultBranch(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetForkedRepositories(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetGroups(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetGroupsAdmin(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetGroupsWithAnyPermission(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetGroupsWithAnyPermissionProject(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetGroupsWithAnyPermissionRepository(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetGroupsWithoutAnyPermission(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetGroupsWithoutAnyPermissionProject(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetGroupsWithoutAnyPermissionRepository(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetInformation(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetLatestInvocation(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetLevel(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetLicense(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetMailConfig(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetMergeConfig(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetPage(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetProject(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetProjectAvatar(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetProjects(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetPullRequestCount(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetPullRequestSettings(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetPullRequestSettingsSCM(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetPullRequestSuggestions(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetPullRequestTasks(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetPullRequests(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetPullRequestsInbox(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetRelatedRepositories(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetRepositories(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetRepositoriesAll(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetRepositoriesRecentlyAccessed(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetRepository(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetRepositoryHook(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetRepositoryHookSettings(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetRepositoryHooks(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetRepositoryHooksSettings(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetRootLevel(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetSenderAddress(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetSettings(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetSettingsHook(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetStatistics(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetStatisticsSummary(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetTag(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetTags(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetTask(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetUser(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetUserSettings(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetUsers(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetUsersAll(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetUsersWithAnyPermission(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetUsersWithAnyPermissionAll(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetUsersWithAnyPermissionProject(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetUsersWithoutAnyPermission(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetUsersWithoutPermission(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetUsersWithoutPermissionProject(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func GetWebhook(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func HasAllUserPermission(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func ListParticipants(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func Merge(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func ModifyAllUserPermission(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func Preview(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func RemoveGroupFromUser(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func RemoveUserFromGroup(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func RenameUser(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func Reopen(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func RetryCreateRepository(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func RevokePermissionsForGroup(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func RevokePermissionsForGroupAll(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func RevokePermissionsForGroupProject(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func RevokePermissionsForUser(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func RevokePermissionsForUserAll(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func RevokePermissionsForUserProject(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func Search(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func SetDefaultBranch(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func SetLevel(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func SetMailConfig(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func SetMergeConfig(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func SetPermissionForGroup(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func SetPermissionForGroups(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func SetPermissionForGroupsProject(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func SetPermissionForUser(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func SetPermissionForUsers(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func SetPermissionForUsersProject(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func SetRootLevel(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func SetSenderAddress(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func SetSettings(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func SetSettingsProject(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func Stream(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func StreamChanges(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func StreamChangesCompare(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func StreamCommits(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func StreamDiff(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func StreamDiffCommit(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func StreamDiffCommits(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func StreamDiffCompare(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func StreamDiffPR(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func StreamDiffRepository(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func StreamDiffRepositoryFile(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func StreamFiles(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func StreamFilesLastMofied(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func StreamFilesRepository(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func TestWebhook(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func UnassignParticipantRole(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func UnassignParticipantRolePR(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func Unwatch(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func UnwatchPR(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func Update(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func UpdateComment(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func UpdateCommentCommit(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func UpdateLicense(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func UpdateProject(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func UpdatePullRequestSettings(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func UpdatePullRequestSettingsSCM(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func UpdateRepository(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func UpdateSettings(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func UpdateStatus(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func UpdateTask(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func UpdateUserDetails(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func UpdateUserDetailsAll(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func UpdateUserPassword(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func UpdateUserPasswordAll(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func UpdateWebhook(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func UploadAvatar(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func UploadAvatarProject(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func WatchCommit(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func WatchPR(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } } func WithdrawApproval(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) handlerName := "UNKNOWN" if route := mux.CurrentRoute(r); route != nil { routeName := route.GetName() if routeName != "" { handlerName = routeName } path, err := route.GetPathTemplate() if err == nil { fmt.Println(path) } } fmt.Println(handlerName) fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) response, err := ioutil.ReadFile(fileName) if err == nil { w.Write(response) } else { file, err := os.Create(fileName) if err != nil { log.Fatal(err.Error()) } file.Write([]byte("{}")) file.Close() } }