add pulsar client

This commit is contained in:
w1ndyb0y
2021-02-01 15:35:13 +08:00
parent 9a14fb2cef
commit 3ad4c76acd
8 changed files with 246 additions and 5 deletions
+4 -1
View File
@@ -47,7 +47,7 @@ func Listen(address string) {
}
func WriteToClient(data string) error {
if client != nil {
if Tcp {
_, err := client.Write([]byte(data + "\r\n"))
if err != nil {
Log.Error("error in write data to client socket ", zap.Error(err))
@@ -55,6 +55,9 @@ func WriteToClient(data string) error {
}
return err
}
if Pulsar {
return PulsarSend(data)
}
return nil
}