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

Function SetColor

pkg/wcore/workspace.go:432–445  ·  view source on GitHub ↗
(workspaceId string, color string)

Source from the content-addressed store, hash-verified

430}
431
432func SetColor(workspaceId string, color string) error {
433 ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
434 defer cancel()
435 ws, e := wstore.DBGet[*waveobj.Workspace](ctx, workspaceId)
436 if e != nil {
437 return e
438 }
439 if ws == nil {
440 return fmt.Errorf("workspace not found: %q", workspaceId)
441 }
442 ws.Color = color
443 wstore.DBUpdate(ctx, ws)
444 return nil
445}
446
447func SetName(workspaceId string, name string) error {
448 ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)

Callers

nothing calls this directly

Calls 2

DBGetFunction · 0.92
DBUpdateFunction · 0.92

Tested by

no test coverage detected