重构离线镜像下载

This commit is contained in:
user123456
2025-06-13 08:22:30 +08:00
parent e0dbf304e2
commit 80b3f8959f
11 changed files with 1404 additions and 2326 deletions

View File

@@ -60,11 +60,14 @@ func main() {
// 初始化Docker流式代理
initDockerProxy()
// 初始化镜像流式下载器
initImageStreamer()
gin.SetMode(gin.ReleaseMode)
router := gin.Default()
// 初始化skopeo路由静态文件和API路由
initSkopeoRoutes(router)
// 初始化镜像tar下载路由
initImageTarRoutes(router)
// 静态文件路由(使用嵌入文件)
router.GET("/", func(c *gin.Context) {
@@ -74,8 +77,9 @@ func main() {
filepath := strings.TrimPrefix(c.Param("filepath"), "/")
serveEmbedFile(c, "public/"+filepath)
})
router.GET("/skopeo.html", func(c *gin.Context) {
serveEmbedFile(c, "public/skopeo.html")
router.GET("/images.html", func(c *gin.Context) {
serveEmbedFile(c, "public/images.html")
})
router.GET("/search.html", func(c *gin.Context) {
serveEmbedFile(c, "public/search.html")