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