mirror of
https://github.com/danielmiessler/Fabric.git
synced 2026-02-13 15:34:59 -05:00
20 lines
553 B
Go
20 lines
553 B
Go
package restapi
|
|
|
|
import (
|
|
"github.com/danielmiessler/fabric/plugins/db/fsdb"
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
// ContextsHandler defines the handler for contexts-related operations
|
|
type ContextsHandler struct {
|
|
*StorageHandler[fsdb.Context]
|
|
contexts *fsdb.ContextsEntity
|
|
}
|
|
|
|
// NewContextsHandler creates a new ContextsHandler
|
|
func NewContextsHandler(r *gin.Engine, contexts *fsdb.ContextsEntity) (ret *ContextsHandler) {
|
|
ret = &ContextsHandler{
|
|
StorageHandler: NewStorageHandler[fsdb.Context](r, "contexts", contexts), contexts: contexts}
|
|
return
|
|
}
|