Semaphore/api/projects/runners.go

49 lines
1.1 KiB
Go
Raw Permalink Normal View History

2024-11-17 20:53:05 +01:00
//go:build !pro
package projects
import (
2024-11-17 20:53:05 +01:00
"net/http"
"github.com/gorilla/context"
"github.com/semaphoreui/semaphore/api/helpers"
"github.com/semaphoreui/semaphore/db"
)
func GetRunners(w http.ResponseWriter, r *http.Request) {
project := context.Get(r, "project").(db.Project)
2024-11-17 19:13:11 +01:00
runners, err := helpers.Store(r).GetRunners(project.ID, false)
if err != nil {
panic(err)
}
2024-11-17 20:53:05 +01:00
helpers.WriteJSON(w, http.StatusOK, runners)
}
func AddRunner(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusNotFound)
}
func RunnerMiddleware(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
next.ServeHTTP(w, r)
})
}
func GetRunner(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusNotFound)
}
func UpdateRunner(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusNotFound)
}
func DeleteRunner(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusNotFound)
}
func SetRunnerActive(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusNotFound)
}