MCPcopy Index your code
hub / github.com/LissaGreense/GO4SQL / HandleStreamMode

Function HandleStreamMode

modes/handler.go:35–51  ·  view source on GitHub ↗

HandleStreamMode - Handle GO4SQL use case where client sends input via stdin

(engine *engine.DbEngine)

Source from the content-addressed store, hash-verified

33
34// HandleStreamMode - Handle GO4SQL use case where client sends input via stdin
35func HandleStreamMode(engine *engine.DbEngine) error {
36 reader := bufio.NewScanner(os.Stdin)
37 for reader.Scan() {
38 sequences, err := bytesToSequences(reader.Bytes())
39 if err != nil {
40 fmt.Print(err)
41 } else {
42 evaluate, err := engine.Evaluate(sequences)
43 if err != nil {
44 fmt.Print(err)
45 } else {
46 fmt.Print(evaluate)
47 }
48 }
49 }
50 return reader.Err()
51}
52
53// HandleSocketMode - Handle GO4SQL use case where client sends input via socket protocol
54func HandleSocketMode(port int, engine *engine.DbEngine) {

Callers 1

mainFunction · 0.92

Calls 2

bytesToSequencesFunction · 0.85
EvaluateMethod · 0.80

Tested by

no test coverage detected