* #155 refactor and synchronise writing to CodeOcean. * Reduce complexity of input parsing. * Update typo in internal/api/ws/codeocean_writer.go Co-authored-by: Sebastian Serth <MrSerth@users.noreply.github.com>
This commit is contained in:
14
internal/api/ws/connection.go
Normal file
14
internal/api/ws/connection.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package ws
|
||||
|
||||
import (
|
||||
"io"
|
||||
)
|
||||
|
||||
// Connection is an internal interface for websocket.Conn in order to mock it for unit tests.
|
||||
type Connection interface {
|
||||
WriteMessage(messageType int, data []byte) error
|
||||
Close() error
|
||||
NextReader() (messageType int, r io.Reader, err error)
|
||||
CloseHandler() func(code int, text string) error
|
||||
SetCloseHandler(handler func(code int, text string) error)
|
||||
}
|
Reference in New Issue
Block a user