V1 #7

Merged
trunglt251292 merged 5 commits from v1 into master 2022-04-18 07:41:39 +00:00
4 changed files with 45 additions and 17 deletions

View File

@ -4,20 +4,24 @@ 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"
SubjectPullUserUpsert = "selly.pull.user.upsert"
SubjectRequestUserSearch = "selly.request.user.search"
SubjectRequestKeywordUpsert = "selly.request.keyword.upsert" SubjectRequestKeywordUpsert = "selly.request.keyword.upsert"
SubjectPullKeywordUpsert = "selly.pull.keyword.upsert" SubjectPullKeywordUpsert = "selly.pull.keyword.upsert"
SubjectRequestKeywordSearch = "selly.request.keyword.search" SubjectRequestKeywordSearch = "selly.request.keyword.search"
SubjectRequestKeywordCreateIndex = "selly.request.keyword.create_index"
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"
SubjectRequestDeleteMultipleIndex = "selly.request.delete.multiple_index"
) )
const ( const (

2
go.mod
View File

@ -2,7 +2,7 @@ module github.com/Selly-Modules/elasticsearch
go 1.17 go 1.17
require github.com/Selly-Modules/natsio v0.0.0-20220318042849-ee34e47598b7 require github.com/Selly-Modules/natsio v0.0.0-20220330121714-2a9897e137f8
require ( require (
github.com/logrusorgru/aurora v2.0.3+incompatible // indirect github.com/logrusorgru/aurora v2.0.3+incompatible // indirect

4
go.sum
View File

@ -1,5 +1,9 @@
github.com/Selly-Modules/natsio v0.0.0-20220318042849-ee34e47598b7 h1:t4kLJt+Q4U4m79Ms9S6zjmIfTXSyrzxzVwLU6nGrQOo= github.com/Selly-Modules/natsio v0.0.0-20220318042849-ee34e47598b7 h1:t4kLJt+Q4U4m79Ms9S6zjmIfTXSyrzxzVwLU6nGrQOo=
github.com/Selly-Modules/natsio v0.0.0-20220318042849-ee34e47598b7/go.mod h1:NG55g9ip18nvN5tfP6PcSEKec10/lOeIOZC8HqBVNlQ= github.com/Selly-Modules/natsio v0.0.0-20220318042849-ee34e47598b7/go.mod h1:NG55g9ip18nvN5tfP6PcSEKec10/lOeIOZC8HqBVNlQ=
github.com/Selly-Modules/natsio v0.0.0-20220330105528-1e3bfd73927d h1:BtY+WFNqlz16xeYOqz97jghHylowTonJ9DLauOy/0bY=
github.com/Selly-Modules/natsio v0.0.0-20220330105528-1e3bfd73927d/go.mod h1:NG55g9ip18nvN5tfP6PcSEKec10/lOeIOZC8HqBVNlQ=
github.com/Selly-Modules/natsio v0.0.0-20220330121714-2a9897e137f8 h1:KbDjZorOkDgnPp8FaWG5XqChimLV7OseCcA52hQd+Lc=
github.com/Selly-Modules/natsio v0.0.0-20220330121714-2a9897e137f8/go.mod h1:NG55g9ip18nvN5tfP6PcSEKec10/lOeIOZC8HqBVNlQ=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=

View File

@ -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,12 @@ 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{}))
}
// DeleteMultipleIndex ...
func (Request) DeleteMultipleIndex(indexes []string) (*Response, error) {
return requestNats(SubjectRequestDeleteMultipleIndex, toBytes(indexes))
} }