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

Function connDisconnectAllRun

cmd/wsh/cmd/wshcmd-conn.go:161–178  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

159}
160
161func connDisconnectAllRun(cmd *cobra.Command, args []string) error {
162 allConns, err := getAllConnStatus()
163 if err != nil {
164 return err
165 }
166 for _, conn := range allConns {
167 if conn.Status != "connected" {
168 continue
169 }
170 err := wshclient.ConnDisconnectCommand(RpcClient, conn.Connection, &wshrpc.RpcOpts{Timeout: 10000})
171 if err != nil {
172 WriteStdout("error disconnecting %q: %v\n", conn.Connection, err)
173 } else {
174 WriteStdout("disconnected %q\n", conn.Connection)
175 }
176 }
177 return nil
178}
179
180func connConnectRun(cmd *cobra.Command, args []string) error {
181 connName := args[0]

Callers

nothing calls this directly

Calls 3

ConnDisconnectCommandFunction · 0.92
getAllConnStatusFunction · 0.85
WriteStdoutFunction · 0.85

Tested by

no test coverage detected