wip: oci image management
This commit is contained in:
19
internal/api/v1/registry/images.go
Normal file
19
internal/api/v1/registry/images.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package registry
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"gitea.loveuer.com/loveuer/cluster/internal/database"
|
||||
)
|
||||
|
||||
// ListImages returns all repositories as images
|
||||
func ListImages(c *gin.Context) {
|
||||
var repos []database.Repository
|
||||
if err := database.DB.Find(&repos).Error; err != nil {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, gin.H{"images": repos})
|
||||
}
|
||||
Reference in New Issue
Block a user