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) }