Files
Fabric/restapi/contexts.go
2024-10-12 22:25:17 +03:00

20 lines
532 B
Go

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