add request json encode

This commit is contained in:
Sinh 2022-08-25 16:57:42 +07:00
parent caaa9f098d
commit ad51f45871
1 changed files with 5 additions and 0 deletions

View File

@ -26,3 +26,8 @@ func (e JSONEncoder) Subscribe(subject string, cb nats.Handler) (*nats.Subscript
func (e JSONEncoder) Publish(reply string, data interface{}) error { func (e JSONEncoder) Publish(reply string, data interface{}) error {
return e.encConn.Publish(reply, data) return e.encConn.Publish(reply, data)
} }
// Request ...
func (e JSONEncoder) Request(subject string, data interface{}, res interface{}) error {
return e.encConn.Request(subject, data, res, requestTimeout)
}