brunel/handlers/packages/i386.go

21 lines
400 B
Go
Raw Normal View History

2024-08-02 22:07:39 +02:00
package handlers_packages
import (
"brunel/domain"
"brunel/packages"
"github.com/gofiber/fiber/v2"
)
func I386(c *fiber.Ctx) error {
pkgs := packages.GetPackages()
i386Pkgs := make([]domain.SourcePackage, 0)
pkgs.ForEach(func(k string, v domain.SourcePackage) bool {
if v.Has32bit {
i386Pkgs = append(i386Pkgs, v)
}
return true
})
return c.Status(fiber.StatusOK).JSON(i386Pkgs)
}