코드 정리 및 websocket도 http와 비슷하게 api handler로 통일

This commit is contained in:
2023-09-08 11:35:57 +09:00
parent eb54fa2e3a
commit 6cbf32c386
10 changed files with 216 additions and 130 deletions

View File

@ -0,0 +1,30 @@
// package main ...
package wshandler
import (
"fmt"
"testing"
)
type TestReceiver struct {
}
func (tr *TestReceiver) Func1([]any) {
}
func (tr *TestReceiver) Func2(args []any) {
fmt.Println(args...)
}
func TestExpTable(t *testing.T) {
// src := []any{"a", 1, false}
// payload, _ := json.Marshal(src)
// tr := new(TestReceiver)
// receiver := MakeWebsocketApiHandler(tr, "test")
// var con WebsocketApiBroker
// con.AddHandler(receiver)
}