MCPcopy Create free account
hub / github.com/astercloud/aster / Start

Method Start

pkg/asteros/interfaces/agui.go:70–93  ·  view source on GitHub ↗

Start 启动 AGUI Interface

(ctx context.Context, os *asteros.AsterOS)

Source from the content-addressed store, hash-verified

68
69// Start 启动 AGUI Interface
70func (i *AGUIInterface) Start(ctx context.Context, os *asteros.AsterOS) error {
71 i.os = os
72
73 // 创建可取消的上下文
74 ctx, cancel := context.WithCancel(ctx)
75 i.cancel = cancel
76
77 // 连接到控制平面
78 if err := i.connect(ctx); err != nil {
79 return fmt.Errorf("connect to control plane: %w", err)
80 }
81
82 // 启动自动同步
83 if i.opts.EnableAutoSync {
84 go i.syncLoop(ctx)
85 }
86
87 if i.opts.EnableLogging {
88 fmt.Printf("✓ AGUI Interface started\n")
89 fmt.Printf(" → Control Plane: %s\n", i.opts.ControlPlaneURL)
90 }
91
92 return nil
93}
94
95// Stop 停止 AGUI Interface
96func (i *AGUIInterface) Stop(ctx context.Context) error {

Callers

nothing calls this directly

Calls 3

connectMethod · 0.95
syncLoopMethod · 0.95
PrintfMethod · 0.80

Tested by

no test coverage detected