refactor: remove pocketbase (#1138)

This commit is contained in:
Jonas Plum
2025-09-02 21:58:08 +02:00
committed by GitHub
parent f28c238135
commit eba2615ec0
435 changed files with 42677 additions and 4730 deletions

View File

@@ -1,29 +1,46 @@
package testing
import (
"encoding/json"
"net/http"
"github.com/labstack/echo/v5"
"github.com/go-chi/chi/v5"
)
type RecordingServer struct {
server *echo.Echo
server chi.Router
Entries []string
}
func NewRecordingServer() *RecordingServer {
e := echo.New()
e := chi.NewRouter()
e.GET("/health", func(c echo.Context) error {
return c.JSON(http.StatusOK, map[string]any{
e.Get("/health", func(w http.ResponseWriter, _ *http.Request) {
b, err := json.Marshal(map[string]any{
"status": "ok",
})
if err != nil {
http.Error(w, "failed to marshal response", http.StatusInternalServerError)
return
}
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
_, _ = w.Write(b)
})
e.Any("/*", func(c echo.Context) error {
return c.JSON(http.StatusOK, map[string]any{
e.HandleFunc("/*", func(w http.ResponseWriter, _ *http.Request) {
b, err := json.Marshal(map[string]any{
"test": true,
})
if err != nil {
http.Error(w, "failed to marshal response", http.StatusInternalServerError)
return
}
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
_, _ = w.Write(b)
})
return &RecordingServer{