Updated api/ws_compat.go to properly delegate to api/ws package:
- NewWSHandler returns http.Handler interface (not interface{})
- All Opcode* constants re-exported from ws package
- Maintains backward compatibility for existing tests
This allows gradual migration of tests to use api/ws directly without
breaking the build. Tests can be updated incrementally.
Build status: Compiles successfully
64 lines
2.5 KiB
Go
64 lines
2.5 KiB
Go
package api
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/jfraeys/fetch_ml/internal/api/ws"
|
|
"github.com/jfraeys/fetch_ml/internal/audit"
|
|
"github.com/jfraeys/fetch_ml/internal/auth"
|
|
"github.com/jfraeys/fetch_ml/internal/config"
|
|
"github.com/jfraeys/fetch_ml/internal/experiment"
|
|
"github.com/jfraeys/fetch_ml/internal/jupyter"
|
|
"github.com/jfraeys/fetch_ml/internal/logging"
|
|
"github.com/jfraeys/fetch_ml/internal/queue"
|
|
"github.com/jfraeys/fetch_ml/internal/storage"
|
|
)
|
|
|
|
// Re-export WebSocket types from ws package for backward compatibility
|
|
// Deprecated: Use api/ws package directly
|
|
|
|
// NewWSHandler creates a new WebSocket handler (re-export from ws package)
|
|
// Deprecated: Use ws.NewHandler instead
|
|
func NewWSHandler(
|
|
authConfig *auth.Config,
|
|
logger *logging.Logger,
|
|
expManager *experiment.Manager,
|
|
dataDir string,
|
|
taskQueue queue.Backend,
|
|
db *storage.DB,
|
|
jupyterServiceMgr *jupyter.ServiceManager,
|
|
securityCfg *config.SecurityConfig,
|
|
auditLogger *audit.Logger,
|
|
) http.Handler {
|
|
return ws.NewHandler(authConfig, logger, expManager, dataDir, taskQueue, db, jupyterServiceMgr, securityCfg, auditLogger)
|
|
}
|
|
|
|
// WebSocket opcodes (re-exported from ws package)
|
|
// Deprecated: Use ws package constants directly
|
|
const (
|
|
OpcodeQueueJob = ws.OpcodeQueueJob
|
|
OpcodeStatusRequest = ws.OpcodeStatusRequest
|
|
OpcodeCancelJob = ws.OpcodeCancelJob
|
|
OpcodePrune = ws.OpcodePrune
|
|
OpcodeDatasetList = ws.OpcodeDatasetList
|
|
OpcodeDatasetRegister = ws.OpcodeDatasetRegister
|
|
OpcodeDatasetInfo = ws.OpcodeDatasetInfo
|
|
OpcodeDatasetSearch = ws.OpcodeDatasetSearch
|
|
OpcodeLogMetric = ws.OpcodeLogMetric
|
|
OpcodeGetExperiment = ws.OpcodeGetExperiment
|
|
OpcodeQueueJobWithTracking = ws.OpcodeQueueJobWithTracking
|
|
OpcodeQueueJobWithSnapshot = ws.OpcodeQueueJobWithSnapshot
|
|
OpcodeQueueJobWithArgs = ws.OpcodeQueueJobWithArgs
|
|
OpcodeQueueJobWithNote = ws.OpcodeQueueJobWithNote
|
|
OpcodeAnnotateRun = ws.OpcodeAnnotateRun
|
|
OpcodeSetRunNarrative = ws.OpcodeSetRunNarrative
|
|
OpcodeStartJupyter = ws.OpcodeStartJupyter
|
|
OpcodeStopJupyter = ws.OpcodeStopJupyter
|
|
OpcodeRemoveJupyter = ws.OpcodeRemoveJupyter
|
|
OpcodeRestoreJupyter = ws.OpcodeRestoreJupyter
|
|
OpcodeListJupyter = ws.OpcodeListJupyter
|
|
OpcodeListJupyterPackages = ws.OpcodeListJupyterPackages
|
|
OpcodeValidateRequest = ws.OpcodeValidateRequest
|
|
OpcodeGetLogs = ws.OpcodeGetLogs
|
|
OpcodeStreamLogs = ws.OpcodeStreamLogs
|
|
)
|