Wworking on improving the tool

This commit is contained in:
Martino Ferrari
2026-05-21 07:41:56 +02:00
parent 6ff8fb5c25
commit 71430bc3b0
30 changed files with 1820 additions and 331 deletions
+32
View File
@@ -0,0 +1,32 @@
package main
import (
"context"
"fmt"
"log/slog"
"net/http"
"net/http/httptest"
"os"
"github.com/uopi/uopi/internal/api"
"github.com/uopi/uopi/internal/broker"
"github.com/uopi/uopi/internal/storage"
)
func main() {
log := slog.New(slog.NewTextHandler(os.Stderr, nil))
store, _ := storage.New("./interfaces")
// broker.New(ctx, log, maxRate)
brk := broker.New(context.Background(), log, 0)
h := api.New(brk, nil, store, "", "", log)
mux := http.NewServeMux()
h.Register(mux, "/api/v1")
req := httptest.NewRequest("GET", "/api/v1/interfaces", nil)
rr := httptest.NewRecorder()
mux.ServeHTTP(rr, req)
fmt.Printf("Status: %d\n", rr.Code)
fmt.Printf("Body: %s\n", rr.Body.String())
}