Nexus/pkg/http/api/directory.go
2024-10-20 17:42:51 +08:00

20 lines
422 B
Go

package api
import (
"git.solsynth.dev/hypernet/nexus/pkg/directory"
"github.com/gofiber/fiber/v2"
"github.com/samber/lo"
)
func listExistsService(c *fiber.Ctx) error {
services := directory.ListServiceInstance()
return c.JSON(lo.Map(services, func(item *directory.ServiceInstance, index int) map[string]any {
return map[string]any{
"id": item.ID,
"type": item.Type,
"label": item.Label,
}
}))
}