[Update] Define method #5
|
@ -12,6 +12,10 @@ const (
|
||||||
SubjectRequestUserUpsert = "selly.request.user.upsert"
|
SubjectRequestUserUpsert = "selly.request.user.upsert"
|
||||||
SubjectPullUserUpsert = "selly.pull.user.upsert"
|
SubjectPullUserUpsert = "selly.pull.user.upsert"
|
||||||
SubjectRequestUserSearch = "selly.request.user.search"
|
SubjectRequestUserSearch = "selly.request.user.search"
|
||||||
|
|
||||||
|
SubjectRequestKeywordUpsert = "selly.request.keyword.upsert"
|
||||||
|
SubjectPullKeywordUpsert = "selly.pull.keyword.upsert"
|
||||||
|
SubjectRequestKeywordSearch = "selly.request.keyword.search"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
5
pull.go
5
pull.go
|
@ -18,3 +18,8 @@ func (Pull) UserUpsert(payload Payload) (bool, error) {
|
||||||
func (Pull) OrderUpsert(payload Payload) (bool, error) {
|
func (Pull) OrderUpsert(payload Payload) (bool, error) {
|
||||||
return publishWithJetStream(JetStreamSearchService, SubjectPullOrderUpsert, toBytes(payload))
|
return publishWithJetStream(JetStreamSearchService, SubjectPullOrderUpsert, toBytes(payload))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// KeywordUpsert ...
|
||||||
|
func (Pull) KeywordUpsert(payload Payload) (bool, error) {
|
||||||
|
return publishWithJetStream(JetStreamSearchService, SubjectPullKeywordUpsert, toBytes(payload))
|
||||||
|
}
|
||||||
|
|
10
request.go
10
request.go
|
@ -33,3 +33,13 @@ func (Request) OrderSearch(query ESQuery) (*Response, error) {
|
||||||
func (Request) OrderUpsert(payload Payload) (*Response, error) {
|
func (Request) OrderUpsert(payload Payload) (*Response, error) {
|
||||||
return requestNats(SubjectRequestOrderUpsert, toBytes(payload))
|
return requestNats(SubjectRequestOrderUpsert, toBytes(payload))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// KeywordSearch ...
|
||||||
|
func (Request) KeywordSearch(query ESQuery) (*Response, error) {
|
||||||
|
return requestNats(SubjectRequestKeywordSearch, toBytes(query))
|
||||||
|
}
|
||||||
|
|
||||||
|
// KeywordUpsert ...
|
||||||
|
func (Request) KeywordUpsert(payload Payload) (*Response, error) {
|
||||||
|
return requestNats(SubjectRequestKeywordUpsert, toBytes(payload))
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue