aboutsummaryrefslogtreecommitdiffhomepage
path: root/worker/handlers.go
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-03-08 00:59:36 +0900
committernsfisis <nsfisis@gmail.com>2025-03-08 00:59:36 +0900
commita10e8e64305e5002c682b45471b417ca4e33773d (patch)
tree23bf4a707c1f168c252cc4d24d06c2d2ffb8c7a8 /worker/handlers.go
parentefd34b970d0d1f88fa7d7e9d69e569f039867ca2 (diff)
downloadphperkaigi-2025-albatross-a10e8e64305e5002c682b45471b417ca4e33773d.tar.gz
phperkaigi-2025-albatross-a10e8e64305e5002c682b45471b417ca4e33773d.tar.zst
phperkaigi-2025-albatross-a10e8e64305e5002c682b45471b417ca4e33773d.zip
worker: swift to php
Diffstat (limited to 'worker/handlers.go')
-rw-r--r--worker/handlers.go68
1 files changed, 0 insertions, 68 deletions
diff --git a/worker/handlers.go b/worker/handlers.go
deleted file mode 100644
index ac9701f..0000000
--- a/worker/handlers.go
+++ /dev/null
@@ -1,68 +0,0 @@
-package main
-
-import (
- "fmt"
- "net/http"
-
- "github.com/labstack/echo/v4"
-)
-
-func newBadRequestError(err error) *echo.HTTPError {
- return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid request: %s", err.Error()))
-}
-
-func handleSwiftCompile(c echo.Context) error {
- var req swiftCompileRequestData
- if err := c.Bind(&req); err != nil {
- return newBadRequestError(err)
- }
- if err := req.validate(); err != nil {
- return newBadRequestError(err)
- }
-
- res := execSwiftCompile(
- c.Request().Context(),
- req.Code,
- req.CodeHash,
- req.maxDuration(),
- )
-
- return c.JSON(http.StatusOK, res)
-}
-
-func handleWasmCompile(c echo.Context) error {
- var req wasmCompileRequestData
- if err := c.Bind(&req); err != nil {
- return newBadRequestError(err)
- }
- if err := req.validate(); err != nil {
- return newBadRequestError(err)
- }
-
- res := execWasmCompile(
- c.Request().Context(),
- req.CodeHash,
- req.maxDuration(),
- )
-
- return c.JSON(http.StatusOK, res)
-}
-
-func handleTestRun(c echo.Context) error {
- var req testRunRequestData
- if err := c.Bind(&req); err != nil {
- return newBadRequestError(err)
- }
- if err := req.validate(); err != nil {
- return newBadRequestError(err)
- }
-
- res := execTestRun(
- c.Request().Context(),
- req.CodeHash,
- req.Stdin,
- req.maxDuration(),
- )
-
- return c.JSON(http.StatusOK, res)
-}