mirror of
https://github.com/danielmiessler/Fabric.git
synced 2026-02-12 23:15:05 -05:00
## CHANGES - Remove explicit type parameters from StorageHandler initialization - Update contexts handler constructor implementation - Update patterns handler constructor implementation - Update sessions handler constructor implementation - Simplify API by relying on type inference
20 lines
543 B
Go
20 lines
543 B
Go
package restapi
|
|
|
|
import (
|
|
"github.com/danielmiessler/fabric/plugins/db/fsdb"
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
// SessionsHandler defines the handler for sessions-related operations
|
|
type SessionsHandler struct {
|
|
*StorageHandler[fsdb.Session]
|
|
sessions *fsdb.SessionsEntity
|
|
}
|
|
|
|
// NewSessionsHandler creates a new SessionsHandler
|
|
func NewSessionsHandler(r *gin.Engine, sessions *fsdb.SessionsEntity) (ret *SessionsHandler) {
|
|
ret = &SessionsHandler{
|
|
StorageHandler: NewStorageHandler(r, "sessions", sessions), sessions: sessions}
|
|
return ret
|
|
}
|