From 5999fb7f595a3bd39d20692513355fb96b9de418 Mon Sep 17 00:00:00 2001 From: Sinh Date: Wed, 10 Aug 2022 17:52:00 +0700 Subject: [PATCH] encode connection to pubsub --- server_reqres.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server_reqres.go b/server_reqres.go index cb50938..c21b4dc 100644 --- a/server_reqres.go +++ b/server_reqres.go @@ -34,3 +34,8 @@ func (sv Server) Subscribe(subject string, cb nats.MsgHandler) (*nats.Subscripti } return sub, nil } + +// NewJSONEncodedConn ... +func (sv Server) NewJSONEncodedConn() (*nats.EncodedConn, error) { + return nats.NewEncodedConn(sv.instance, nats.JSON_ENCODER) +} -- 2.34.1