更新依赖和调整目录结构,未修改模块

This commit is contained in:
2026-09-14 22:17:59 +08:00
parent 63aeedc2fe
commit 13e4b8e363
70 changed files with 3092 additions and 90 deletions

View File

@@ -0,0 +1,24 @@
package server
import (
"net/http"
"net/http/httptest"
"testing"
"github.com/gin-gonic/gin"
)
func TestHTTPRouterIsAvailable(t *testing.T) {
srv, err := New("0123456789abcdef0123456789abcdef", 3600, []string{"/healthz"})
if err != nil {
t.Fatal(err)
}
srv.HTTP.GET("/healthz", func(c *gin.Context) { c.Status(http.StatusNoContent) })
request := httptest.NewRequest(http.MethodGet, "/healthz", nil)
response := httptest.NewRecorder()
srv.HTTP.ServeHTTP(response, request)
if response.Code != http.StatusNoContent {
t.Fatalf("unexpected status: %d", response.Code)
}
}