|
|
|
@ -97,10 +97,10 @@ func (r *GosmContainer) WsContainerSend(method WsCommunicationMethod, conn *webs
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (r *GosmContainer) WsContainerReceive(method WsCommunicationMethod, conn *websocket.Conn, ctx context.Context, dosth func(interface{}) interface{}) (err error, receiveval, sendval interface{}, mtr websocket.MessageType) {
|
|
|
|
|
func (r *GosmContainer) WsContainerReceive[dosthtype (func(interface{}) interface{})| (func([]byte) []byte) ](method WsCommunicationMethod, conn *websocket.Conn, ctx context.Context, dosth dosthtype) (err error, receiveval, sendval interface{}, mtr websocket.MessageType) {
|
|
|
|
|
switch {
|
|
|
|
|
case method == ReceiveTextMethod || method == ReceiveBinaryMethod:
|
|
|
|
|
err, receiveval, sendval, mtr = WsReceive(ctx, conn, dosth.(func([]byte) []byte))
|
|
|
|
|
err, receiveval, sendval, mtr = WsReceive(ctx, conn, dosth)
|
|
|
|
|
case method == ReceiveJsonMethod:
|
|
|
|
|
err, receiveval, sendval = WsjsonReceive(ctx, conn, dosth)
|
|
|
|
|
mtr = websocket.MessageText
|
|
|
|
@ -110,6 +110,8 @@ func (r *GosmContainer) WsContainerReceive(method WsCommunicationMethod, conn *w
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func WsjsonSend(ctx context.Context, conn *websocket.Conn, sendval interface{}) (err error, receiveval interface{}) {
|
|
|
|
|
err = nil
|
|
|
|
|
|
|
|
|
|