mirror of
https://github.com/openflocon/Flocon.git
synced 2026-05-14 20:27:23 +00:00
feat: [NETWORK] websockets (#305)
Co-authored-by: Florent Champigny <florent@bere.al>
This commit is contained in:
parent
29f76976b3
commit
bf86ba4e6a
34 changed files with 673 additions and 115 deletions
|
|
@ -4,12 +4,20 @@ import io.github.openflocon.flocon.core.FloconPlugin
|
|||
import io.github.openflocon.flocon.plugins.network.model.BadQualityConfig
|
||||
import io.github.openflocon.flocon.plugins.network.model.FloconNetworkCallRequest
|
||||
import io.github.openflocon.flocon.plugins.network.model.FloconNetworkCallResponse
|
||||
import io.github.openflocon.flocon.plugins.network.model.FloconWebSocketEvent
|
||||
import io.github.openflocon.flocon.plugins.network.model.MockNetworkResponse
|
||||
|
||||
|
||||
|
||||
interface FloconNetworkPlugin : FloconPlugin {
|
||||
val mocks: Collection<MockNetworkResponse>
|
||||
val badQualityConfig: BadQualityConfig?
|
||||
|
||||
fun logRequest(request: FloconNetworkCallRequest)
|
||||
fun logResponse(response: FloconNetworkCallResponse)
|
||||
|
||||
fun logWebSocket(
|
||||
event: FloconWebSocketEvent,
|
||||
)
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
package io.github.openflocon.flocon.plugins.network.model
|
||||
|
||||
class FloconWebSocketEvent(
|
||||
val websocketUrl: String,
|
||||
val timeStamp: Long,
|
||||
val event: Event,
|
||||
val size: Long,
|
||||
val message: String? = null,
|
||||
val error: Throwable? = null,
|
||||
) {
|
||||
enum class Event {
|
||||
Closed,
|
||||
Closing,
|
||||
Error,
|
||||
ReceiveMessage,
|
||||
SendMessage,
|
||||
Open,
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue