elasticsearch/request.go

36 lines
986 B
Go
Raw Normal View History

2022-03-19 04:59:43 +00:00
package elasticsearch
// Request ...
type Request struct {
}
// ProductSearch ...
2022-03-19 06:33:06 +00:00
func (Request) ProductSearch(query ESQuery) (*Response, error) {
2022-03-19 06:12:59 +00:00
return requestNats(SubjectRequestProductSearch, toBytes(query))
2022-03-19 04:59:43 +00:00
}
// ProductUpsert ...
2022-03-19 06:33:06 +00:00
func (Request) ProductUpsert(query UpdateDataPayload) (*Response, error) {
2022-03-19 06:12:59 +00:00
return requestNats(SubjectRequestProductUpsert, toBytes(query))
2022-03-19 04:59:43 +00:00
}
// UserSearch ...
2022-03-19 06:33:06 +00:00
func (Request) UserSearch(query ESQuery) (*Response, error) {
2022-03-19 06:12:59 +00:00
return requestNats(SubjectRequestUserSearch, toBytes(query))
2022-03-19 04:59:43 +00:00
}
// UserUpsert ...
2022-03-19 06:33:06 +00:00
func (Request) UserUpsert(query UpdateDataPayload) (*Response, error) {
2022-03-19 06:12:59 +00:00
return requestNats(SubjectRequestUserUpsert, toBytes(query))
2022-03-19 04:59:43 +00:00
}
// OrderSearch ...
2022-03-19 06:33:06 +00:00
func (Request) OrderSearch(query ESQuery) (*Response, error) {
2022-03-19 06:12:59 +00:00
return requestNats(SubjectRequestOrderSearch, toBytes(query))
2022-03-19 04:59:43 +00:00
}
// OrderUpsert ...
2022-03-19 06:33:06 +00:00
func (Request) OrderUpsert(query UpdateDataPayload) (*Response, error) {
2022-03-19 06:12:59 +00:00
return requestNats(SubjectRequestOrderUpsert, toBytes(query))
2022-03-19 04:59:43 +00:00
}