Dealer/pkg/internal/server/api/directory.go

20 lines
432 B
Go
Raw Normal View History

2024-07-14 12:25:30 +00:00
package api
import (
"git.solsynth.dev/hydrogen/dealer/pkg/internal/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,
}
}))
}