go-api/group.go

25 lines
712 B
Go
Raw Normal View History

// SPDX-License-Identifier: EUPL-1.2
package api
import "github.com/gin-gonic/gin"
// RouteGroup registers API routes onto a Gin router group.
// Subsystems implement this interface to declare their endpoints.
type RouteGroup interface {
// Name returns a human-readable identifier for the group.
Name() string
// BasePath returns the URL prefix for all routes in this group.
BasePath() string
// RegisterRoutes mounts handlers onto the provided router group.
RegisterRoutes(rg *gin.RouterGroup)
}
// StreamGroup optionally declares WebSocket channels a subsystem publishes to.
type StreamGroup interface {
// Channels returns the list of channel names this group streams on.
Channels() []string
}