special I/O wrappers for wshrpc * terminal (wrap with OSC codes) * stream (json lines) * websocket (json packets)
(input io.Reader, output chan baseds.RpcInputChType, readCallback func())
| 17 | // * websocket (json packets) |
| 18 | |
| 19 | func AdaptStreamToMsgCh(input io.Reader, output chan baseds.RpcInputChType, readCallback func()) error { |
| 20 | return utilfn.StreamToLines(input, func(line []byte) { |
| 21 | output <- baseds.RpcInputChType{MsgBytes: line} |
| 22 | }, readCallback) |
| 23 | } |
| 24 | |
| 25 | func AdaptOutputChToStream(outputCh chan []byte, output io.Writer) error { |
| 26 | drain := false |
no test coverage detected