MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / handleWS

Method handleWS

backend/daemon.go:142–169  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

140 return err
141 }
142 if cfg.LongTermMemoryEnabled {
143 if err := cfg.ValidateMemoryConfig(); err != nil {
144 return err
145 }
146 }
147 return Serve(context.Background(), DaemonOptions{
148 Host: *host,
149 Port: *port,
150 Config: cfg,
151 EndpointPath: DefaultEndpointPath(),
152 })
153}
154
155func RunShutdownCLI(args []string) error {
156 flags := flag.NewFlagSet("shutdown", flag.ContinueOnError)
157 endpointPath := flags.String("endpoint", DefaultEndpointPath(), "daemon endpoint file")
158 timeout := flags.Duration("timeout", 10*time.Second, "shutdown wait timeout")
159 defaultAdminJWT := strings.TrimSpace(os.Getenv("LUMINA_ADMIN_JWT"))
160 if defaultAdminJWT == "" {
161 defaultAdminJWT = strings.TrimSpace(os.Getenv("LUMINA_JWT"))
162 }
163 adminJWT := flags.String("jwt", defaultAdminJWT, "cluster admin JWT")
164 if err := flags.Parse(args); err != nil {
165 return err
166 }
167 data, err := os.ReadFile(*endpointPath)
168 if os.IsNotExist(err) {
169 fmt.Fprintf(os.Stderr, "lumina-backend is not running: %s not found\n", *endpointPath)
170 return nil
171 }
172 if err != nil {

Callers

nothing calls this directly

Calls 5

dispatchMethod · 0.95
writeMethod · 0.95
CloseMethod · 0.65
GetMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected