25 lines
459 B
Go
25 lines
459 B
Go
|
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
|
||
|
}
|
||
|
|
||
|
func (t *TestServer) allMsgData() []byte {
|
||
|
return []byte(`{"input": "hello world"}`)
|
||
|
}
|
||
|
|
||
|
func (t *TestServer) onTick() []TopicMsg {
|
||
|
msg := TopicMsg{t.getChannelName(), []byte(`{"input": "hello from GRPC"}`)}
|
||
|
return []TopicMsg{msg}
|
||
|
}
|