nonce 응답 추가
This commit is contained in:
@ -2,6 +2,7 @@ package wshandler
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"reflect"
|
||||
"strings"
|
||||
@ -175,13 +176,10 @@ func (hc *WebsocketPeerApiBroker) ClientDisconnected(recv any, reason string) {
|
||||
}
|
||||
}
|
||||
|
||||
func (hc *WebsocketPeerApiBroker) Call(recv any, funcname string, r io.Reader) {
|
||||
func (hc *WebsocketPeerApiBroker) Call(recv any, funcname string, r io.Reader) (any, error) {
|
||||
if found := hc.methods[funcname]; found != nil {
|
||||
_, err := found(recv, r)
|
||||
if err != nil {
|
||||
logger.Println("api call is failed. err :", err)
|
||||
}
|
||||
} else {
|
||||
logger.Println("api is not found :", funcname)
|
||||
return found(recv, r)
|
||||
}
|
||||
|
||||
return nil, fmt.Errorf("api is not found : %s", funcname)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user