rts-sim-testing-service/grpcproto/test_server.go

25 lines
483 B
Go
Raw Normal View History

2023-07-26 17:51:32 +08:00
package apiproto
import "time"
type TestServer struct {
data map[string]string
}
func (t *TestServer) getChannelName() string {
return "test"
}
func (t *TestServer) getInterval() time.Duration {
return time.Second
}
2023-07-31 08:41:42 +08:00
func (t *TestServer) allMsgData(params map[string]string) []byte {
2023-07-26 17:51:32 +08:00
return []byte(`{"input": "hello world"}`)
}
func (t *TestServer) onTick() []TopicMsg {
msg := TopicMsg{t.getChannelName(), []byte(`{"input": "hello from GRPC"}`)}
return []TopicMsg{msg}
}