commit
e65fca4f5f
|
@ -12,6 +12,7 @@ type Client struct {
|
||||||
Config Config
|
Config Config
|
||||||
natsServer natsio.Server
|
natsServer natsio.Server
|
||||||
natsJetStream natsio.JetStream
|
natsJetStream natsio.JetStream
|
||||||
|
Pull Pull
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
package appier
|
package appier
|
||||||
|
|
||||||
const (
|
const (
|
||||||
SubjectRequestProductUpsert = "selly.request.product.upsert"
|
SubjectPingPullService = "selly.pull.ping"
|
||||||
|
SubjectPullProductUpsert = "selly.pull.product.upsert"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
7
pull.go
7
pull.go
|
@ -5,5 +5,10 @@ type Pull struct{}
|
||||||
|
|
||||||
// ProductUpsert ...
|
// ProductUpsert ...
|
||||||
func (Pull) ProductUpsert(payload Payload) (bool, error) {
|
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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue