[Update] Define method #5
6
pull.go
6
pull.go
|
@ -5,16 +5,16 @@ type Pull struct {
|
|||
}
|
||||
|
||||
// ProductUpsert ...
|
||||
func (r Pull) ProductUpsert(query UpdateDataPayload) (bool, error) {
|
||||
func (Pull) ProductUpsert(query UpdateDataPayload) (bool, error) {
|
||||
return publishWithJetStream(JetStreamSearchService, SubjectPullProductUpsert, toBytes(query))
|
||||
}
|
||||
|
||||
// UserUpsert ...
|
||||
func (r Pull) UserUpsert(query UpdateDataPayload) (bool, error) {
|
||||
func (Pull) UserUpsert(query UpdateDataPayload) (bool, error) {
|
||||
return publishWithJetStream(JetStreamSearchService, SubjectPullUserUpsert, toBytes(query))
|
||||
}
|
||||
|
||||
// OrderUpsert ...
|
||||
func (r Pull) OrderUpsert(query UpdateDataPayload) (bool, error) {
|
||||
func (Pull) OrderUpsert(query UpdateDataPayload) (bool, error) {
|
||||
return publishWithJetStream(JetStreamSearchService, SubjectPullOrderUpsert, toBytes(query))
|
||||
}
|
||||
|
|
12
request.go
12
request.go
|
@ -5,31 +5,31 @@ type Request struct {
|
|||
}
|
||||
|
||||
// ProductSearch ...
|
||||
func (r Request) ProductSearch(query ESQuery) (*Response, error) {
|
||||
func (Request) ProductSearch(query ESQuery) (*Response, error) {
|
||||
return requestNats(SubjectRequestProductSearch, toBytes(query))
|
||||
}
|
||||
|
||||
// ProductUpsert ...
|
||||
func (r Request) ProductUpsert(query UpdateDataPayload) (*Response, error) {
|
||||
func (Request) ProductUpsert(query UpdateDataPayload) (*Response, error) {
|
||||
return requestNats(SubjectRequestProductUpsert, toBytes(query))
|
||||
}
|
||||
|
||||
// UserSearch ...
|
||||
func (r Request) UserSearch(query ESQuery) (*Response, error) {
|
||||
func (Request) UserSearch(query ESQuery) (*Response, error) {
|
||||
return requestNats(SubjectRequestUserSearch, toBytes(query))
|
||||
}
|
||||
|
||||
// UserUpsert ...
|
||||
func (r Request) UserUpsert(query UpdateDataPayload) (*Response, error) {
|
||||
func (Request) UserUpsert(query UpdateDataPayload) (*Response, error) {
|
||||
return requestNats(SubjectRequestUserUpsert, toBytes(query))
|
||||
}
|
||||
|
||||
// OrderSearch ...
|
||||
func (r Request) OrderSearch(query ESQuery) (*Response, error) {
|
||||
func (Request) OrderSearch(query ESQuery) (*Response, error) {
|
||||
return requestNats(SubjectRequestOrderSearch, toBytes(query))
|
||||
}
|
||||
|
||||
// OrderUpsert ...
|
||||
func (r Request) OrderUpsert(query UpdateDataPayload) (*Response, error) {
|
||||
func (Request) OrderUpsert(query UpdateDataPayload) (*Response, error) {
|
||||
return requestNats(SubjectRequestOrderUpsert, toBytes(query))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue