MCPcopy Create free account
hub / github.com/Cyinx/einx / doRun

Function doRun

console/console.go:17–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15}
16
17func doRun() {
18 for {
19 read_line, err := reader.ReadString('\n')
20 if err != nil {
21 break
22 }
23
24 read_line = strings.TrimSuffix(read_line[:len(read_line)-1], "\r")
25 contents := strings.Fields(read_line)
26
27 if len(contents) < 2 {
28 continue
29 }
30
31 module_name := contents[0]
32 command := contents[1]
33 args_strings := contents[2:]
34 args := make([]interface{}, len(args_strings))
35 for k, v := range args_strings {
36 args[k] = v
37 }
38 m := module.FindModule(module_name)
39 if m != nil {
40 m.RpcCall(command, args...)
41 } else {
42 slog.LogWarning("console", "module [%v] not found!", module_name)
43 }
44 }
45}

Callers 1

RunFunction · 0.85

Calls 1

RpcCallMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…