MCPcopy
hub / github.com/wavetermdev/waveterm / ConnEnsureCommand

Method ConnEnsureCommand

pkg/wshrpc/wshserver/wshserver.go:598–606  ·  view source on GitHub ↗
(ctx context.Context, data wshrpc.ConnExtData)

Source from the content-addressed store, hash-verified

596}
597
598func (ws *WshServer) ConnEnsureCommand(ctx context.Context, data wshrpc.ConnExtData) error {
599 ctx = genconn.ContextWithConnData(ctx, data.LogBlockId)
600 ctx = termCtxWithLogBlockId(ctx, data.LogBlockId)
601 if strings.HasPrefix(data.ConnName, "wsl://") {
602 distroName := strings.TrimPrefix(data.ConnName, "wsl://")
603 return wslconn.EnsureConnection(ctx, distroName)
604 }
605 return conncontroller.EnsureConnection(ctx, data.ConnName)
606}
607
608func (ws *WshServer) ConnDisconnectCommand(ctx context.Context, connName string) error {
609 if conncontroller.IsLocalConnName(connName) {

Callers

nothing calls this directly

Calls 4

ContextWithConnDataFunction · 0.92
EnsureConnectionFunction · 0.92
EnsureConnectionFunction · 0.92
termCtxWithLogBlockIdFunction · 0.85

Tested by

no test coverage detected