From fd4ed3187c2f25b5d39bbb1b31f323b419a2cd5c Mon Sep 17 00:00:00 2001 From: Minh Nguyen Date: Wed, 23 Mar 2022 10:05:15 +0700 Subject: [PATCH] update --- appier.go | 1 + constant.go | 3 ++- pull.go | 7 ++++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/appier.go b/appier.go index 2ccf2da..3dc67c6 100644 --- a/appier.go +++ b/appier.go @@ -12,6 +12,7 @@ type Client struct { Config Config natsServer natsio.Server natsJetStream natsio.JetStream + Pull Pull } var ( diff --git a/constant.go b/constant.go index f796d14..667ec1b 100644 --- a/constant.go +++ b/constant.go @@ -1,7 +1,8 @@ package appier const ( - SubjectRequestProductUpsert = "selly.request.product.upsert" + SubjectPingPullService = "selly.pull.ping" + SubjectPullProductUpsert = "selly.pull.product.upsert" ) const ( diff --git a/pull.go b/pull.go index 39acfed..8c7e593 100644 --- a/pull.go +++ b/pull.go @@ -5,5 +5,10 @@ type Pull struct{} // ProductUpsert ... func (Pull) ProductUpsert(payload Payload) (bool, error) { - return publishWithJetStream(JetStreamAppierService, SubjectRequestProductUpsert, toBytes(payload)) + return publishWithJetStream(JetStreamAppierService, SubjectPullProductUpsert, payload.Data) +} + +// PingService ... +func (Pull) PingService(payload Payload) (bool, error) { + return publishWithJetStream(JetStreamAppierService, SubjectPingPullService, payload.Data) }