update socket client

This commit is contained in:
Sinh 2023-03-27 15:44:39 +07:00
parent 041dd43616
commit a432e7fd44
2 changed files with 8 additions and 0 deletions

View File

@ -19,3 +19,9 @@ func (s Socket) EmitSocketEventDataReward(p model.PayloadEmitSocketEvent) error
_, err := natsio.GetServer().Request(subject.Socket.EmitEventReward, toBytes(p))
return err
}
// EmitEventToUser ...
func (s Socket) EmitEventToUser(p model.PayloadEmitSocketEvent) error {
_, err := natsio.GetServer().Request(subject.Socket.EmitEventToUser, toBytes(p))
return err
}

View File

@ -9,6 +9,8 @@ func getSocketValue(val string) string {
// Socket ...
var Socket = struct {
EmitEventReward string
EmitEventToUser string
}{
EmitEventReward: getSocketValue("emit_event_reward"),
EmitEventToUser: "send_message_to_socket",
}