Stop 停止 AGUI Interface
(ctx context.Context)
| 94 | |
| 95 | // Stop 停止 AGUI Interface |
| 96 | func (i *AGUIInterface) Stop(ctx context.Context) error { |
| 97 | // 取消同步循环 |
| 98 | if i.cancel != nil { |
| 99 | i.cancel() |
| 100 | } |
| 101 | |
| 102 | // 断开连接 |
| 103 | if err := i.disconnect(ctx); err != nil { |
| 104 | return fmt.Errorf("disconnect from control plane: %w", err) |
| 105 | } |
| 106 | |
| 107 | if i.opts.EnableLogging { |
| 108 | fmt.Printf("✓ AGUI Interface stopped\n") |
| 109 | } |
| 110 | |
| 111 | return nil |
| 112 | } |
| 113 | |
| 114 | // OnAgentRegistered Agent 注册事件 |
| 115 | func (i *AGUIInterface) OnAgentRegistered(ag *agent.Agent) error { |
nothing calls this directly
no test coverage detected