Files
webhooker/internal/handlers/entrypoint_view.go
clawbot 37b59f8822
All checks were successful
check / check (push) Successful in 3m14s
Remove inbound request signature verification (closes #279)
2026-08-24 03:25:09 +02:00

35 lines
742 B
Go

package handlers
import (
"sneak.berlin/go/webhooker/internal/database"
)
// EntrypointView is the display-safe projection of an entrypoint for
// the UI, in the same way delivery.TargetView is one for a target.
type EntrypointView struct {
ID string
Path string
Description string
Active bool
}
// NewEntrypointViews projects entrypoints for rendering.
func NewEntrypointViews(
entrypoints []database.Entrypoint,
) []EntrypointView {
views := make([]EntrypointView, 0, len(entrypoints))
for i := range entrypoints {
e := &entrypoints[i]
views = append(views, EntrypointView{
ID: e.ID,
Path: e.Path,
Description: e.Description,
Active: e.Active,
})
}
return views
}