[Update] Request nats
This commit is contained in:
parent
d82348ad80
commit
eb2d9fe754
30
constants.go
30
constants.go
|
@ -1,23 +1,25 @@
|
||||||
package elasticsearch
|
package elasticsearch
|
||||||
|
|
||||||
const (
|
const (
|
||||||
SubjectRequestProductUpsert = "selly.request.product.upsert"
|
SubjectRequestProductUpsert = "selly.request.product.upsert"
|
||||||
SubjectPullProductUpsert = "selly.pull.product.upsert"
|
SubjectPullProductUpsert = "selly.pull.product.upsert"
|
||||||
SubjectRequestProductSearch = "selly.request.product.search"
|
SubjectRequestProductSearch = "selly.request.product.search"
|
||||||
|
SubjectRequestProductCreateIndex = "selly.request.product.create_index"
|
||||||
|
|
||||||
SubjectRequestOrderUpsert = "selly.request.order.upsert"
|
SubjectRequestOrderUpsert = "selly.request.order.upsert"
|
||||||
SubjectPullOrderUpsert = "selly.pull.order.upsert"
|
SubjectPullOrderUpsert = "selly.pull.order.upsert"
|
||||||
SubjectRequestOrderSearch = "selly.request.order.search"
|
SubjectRequestOrderSearch = "selly.request.order.search"
|
||||||
|
SubjectRequestOrderCreateIndex = "selly.request.order.create_index"
|
||||||
|
|
||||||
SubjectRequestUserUpsert = "selly.request.user.upsert"
|
SubjectRequestKeywordUpsert = "selly.request.keyword.upsert"
|
||||||
SubjectPullUserUpsert = "selly.pull.user.upsert"
|
SubjectPullKeywordUpsert = "selly.pull.keyword.upsert"
|
||||||
SubjectRequestUserSearch = "selly.request.user.search"
|
SubjectRequestKeywordSearch = "selly.request.keyword.search"
|
||||||
|
SubjectRequestKeywordCreateIndex = "selly.request.order.create_index"
|
||||||
|
|
||||||
SubjectRequestKeywordUpsert = "selly.request.keyword.upsert"
|
SubjectRequestUserUpsert = "selly.request.user.upsert"
|
||||||
SubjectPullKeywordUpsert = "selly.pull.keyword.upsert"
|
SubjectPullUserUpsert = "selly.pull.user.upsert"
|
||||||
SubjectRequestKeywordSearch = "selly.request.keyword.search"
|
SubjectRequestUserSearch = "selly.request.user.search"
|
||||||
|
SubjectRequestUserCreateIndex = "selly.request.user.create_index"
|
||||||
SubjectRequestCreateIndex = "selly.request.es.create_index"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
21
request.go
21
request.go
|
@ -14,6 +14,11 @@ func (Request) ProductUpsert(payload Payload) (*Response, error) {
|
||||||
return requestNats(SubjectRequestProductUpsert, toBytes(payload))
|
return requestNats(SubjectRequestProductUpsert, toBytes(payload))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ProductCreateIndex ...
|
||||||
|
func (Request) ProductCreateIndex() (*Response, error) {
|
||||||
|
return requestNats(SubjectRequestProductCreateIndex, toBytes(Payload{}))
|
||||||
|
}
|
||||||
|
|
||||||
// UserSearch ...
|
// UserSearch ...
|
||||||
func (Request) UserSearch(query ESQuery) (*Response, error) {
|
func (Request) UserSearch(query ESQuery) (*Response, error) {
|
||||||
return requestNats(SubjectRequestUserSearch, toBytes(query))
|
return requestNats(SubjectRequestUserSearch, toBytes(query))
|
||||||
|
@ -24,6 +29,11 @@ func (Request) UserUpsert(payload Payload) (*Response, error) {
|
||||||
return requestNats(SubjectRequestUserUpsert, toBytes(payload))
|
return requestNats(SubjectRequestUserUpsert, toBytes(payload))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// UserCreateIndex ...
|
||||||
|
func (Request) UserCreateIndex() (*Response, error) {
|
||||||
|
return requestNats(SubjectRequestUserCreateIndex, toBytes(Payload{}))
|
||||||
|
}
|
||||||
|
|
||||||
// OrderSearch ...
|
// OrderSearch ...
|
||||||
func (Request) OrderSearch(query ESQuery) (*Response, error) {
|
func (Request) OrderSearch(query ESQuery) (*Response, error) {
|
||||||
return requestNats(SubjectRequestOrderSearch, toBytes(query))
|
return requestNats(SubjectRequestOrderSearch, toBytes(query))
|
||||||
|
@ -34,6 +44,11 @@ func (Request) OrderUpsert(payload Payload) (*Response, error) {
|
||||||
return requestNats(SubjectRequestOrderUpsert, toBytes(payload))
|
return requestNats(SubjectRequestOrderUpsert, toBytes(payload))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// OrderCreateIndex ...
|
||||||
|
func (Request) OrderCreateIndex() (*Response, error) {
|
||||||
|
return requestNats(SubjectRequestOrderCreateIndex, toBytes(Payload{}))
|
||||||
|
}
|
||||||
|
|
||||||
// KeywordSearch ...
|
// KeywordSearch ...
|
||||||
func (Request) KeywordSearch(query ESQuery) (*Response, error) {
|
func (Request) KeywordSearch(query ESQuery) (*Response, error) {
|
||||||
return requestNats(SubjectRequestKeywordSearch, toBytes(query))
|
return requestNats(SubjectRequestKeywordSearch, toBytes(query))
|
||||||
|
@ -44,7 +59,7 @@ func (Request) KeywordUpsert(payload Payload) (*Response, error) {
|
||||||
return requestNats(SubjectRequestKeywordUpsert, toBytes(payload))
|
return requestNats(SubjectRequestKeywordUpsert, toBytes(payload))
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateIndex ...
|
// KeywordCreateIndex ...
|
||||||
func (Request) CreateIndex(payload Payload) (*Response, error) {
|
func (Request) KeywordCreateIndex() (*Response, error) {
|
||||||
return requestNats(SubjectRequestCreateIndex, toBytes(payload))
|
return requestNats(SubjectRequestKeywordCreateIndex, toBytes(Payload{}))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue