Files
cish/controller/main.go
2025-08-23 13:45:10 +02:00

43 lines
710 B
Go

package main
import (
"context"
"fmt"
"os"
"github.com/jackc/pgx/v5/pgxpool"
"github.com/labstack/echo/v4"
)
type Handler struct {
db *pgxpool.Pool
}
func (h Handler) CreateOci(c echo.Context) error {
return nil
}
func (h Handler) CreateSubJob(c echo.Context) error {
return nil
}
func main() {
ctx := context.Background()
dbpool, err := pgxpool.New(ctx, os.Getenv("DATABASE_URL"))
if err != nil {
fmt.Fprintf(os.Stderr, "Unable to create connection pool: %v\n", err)
os.Exit(1)
}
defer dbpool.Close()
// go Listener(ctx, dbpool)
h := Handler{dbpool}
e := echo.New()
e.PUT("/job/:uid/oci", h.CreateOci)
e.PUT("/job/:uid/job", h.CreateSubJob)
e.Logger.Fatal(e.Start(":5677"))
}