Files
Fabric/restapi/contexts.go
2024-10-06 15:29:01 +02:00

20 lines
534 B
Go

package restapi
import (
"github.com/danielmiessler/fabric/db"
"github.com/labstack/echo/v4"
)
// ContextsHandler defines the handler for contexts-related operations
type ContextsHandler struct {
*StorageHandler[db.Context]
contexts *db.ContextsEntity
}
// NewContextsHandler creates a new ContextsHandler
func NewContextsHandler(e *echo.Echo, contexts *db.ContextsEntity) (ret *ContextsHandler) {
ret = &ContextsHandler{
StorageHandler: NewStorageHandler[db.Context](e, "contexts", contexts), contexts: contexts}
return
}