Compare commits
39 Commits
Author | SHA1 | Date |
---|---|---|
Minh Nguyen | 02a14a9b62 | |
Nguyen Minh | 5233f269b9 | |
Minh Nguyen | 196ae6eb3a | |
Nguyen Minh | 7c6738e6a9 | |
trunglam | 7645930f1b | |
trunglt251292 | 817cdbf51b | |
trunglt251292 | e56d47bf43 | |
trunglam | 2b11d36267 | |
trunglt251292 | 9d7a75bf7d | |
trunglt251292 | 3717ecc1ae | |
trunglt251292 | bd09ed9585 | |
trunglt251292 | 37a2a21423 | |
trunglt251292 | 7f2ba38040 | |
trunglt251292 | 993f825237 | |
trunglt251292 | f38897a432 | |
Sinh Luu | c0e60f276f | |
Sinh | 8cdc78c5a2 | |
trunglt251292 | 4b897cadba | |
trunglt251292 | 041dbb4124 | |
trunglt251292 | 17ca495206 | |
trunglt251292 | ab08f4fd65 | |
trunglt251292 | cf16596f63 | |
trunglt251292 | 3c3d09940c | |
trunglt251292 | 4b7175bd2b | |
trunglt251292 | ce72c5673c | |
trunglt251292 | 3f01f21b5c | |
trunglt251292 | 26b9392084 | |
Nam Huynh | 7cbc0c5c36 | |
trunglt251292 | 3c44b21812 | |
trunglt251292 | 513981025e | |
Nam Huynh | f1457a0d1a | |
trunglt251292 | 63abe7a598 | |
trunglt251292 | c8a1f992a6 | |
trunglt251292 | d8cb5a1cfd | |
trunglt251292 | f871f5ac5e | |
Nam Huynh | 9f52d2bab4 | |
Nam Huynh | 1f6361f12e | |
Nam Huynh | 34bba1aa32 | |
Nam Huynh | 283dc1285b |
|
@ -1,6 +1,6 @@
|
||||||
package elasticsearch
|
package elasticsearch
|
||||||
|
|
||||||
import "github.com/Selly-Modules/natsio"
|
import "git.selly.red/Selly-Modules/natsio"
|
||||||
|
|
||||||
// Config int client elasticsearch
|
// Config int client elasticsearch
|
||||||
type Config struct {
|
type Config struct {
|
||||||
|
|
10
constants.go
10
constants.go
|
@ -1,6 +1,16 @@
|
||||||
package elasticsearch
|
package elasticsearch
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
SubjectRequestProductSkuUpsert = "selly.request.product_sku.upsert"
|
||||||
|
SubjectPullProductSkuUpsert = "selly.pull.product_sku.upsert"
|
||||||
|
SubjectRequestProductSkuSearch = "selly.request.product_sku.search"
|
||||||
|
SubjectRequestProductSkuCreateIndex = "selly.request.product_sku.create_index"
|
||||||
|
|
||||||
|
SubjectRequestShopProductUpsert = "selly.request.shop_product.upsert"
|
||||||
|
SubjectPullShopProductUpsert = "selly.pull.shop_product.upsert"
|
||||||
|
SubjectRequestShopProductSearch = "selly.request.shop_product.search"
|
||||||
|
SubjectRequestShopProductCreateIndex = "selly.request.shop_product.create_index"
|
||||||
|
|
||||||
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"
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/Selly-Modules/natsio"
|
"git.selly.red/Selly-Modules/natsio"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Client ...
|
// Client ...
|
||||||
|
|
9
go.mod
9
go.mod
|
@ -1,14 +1,13 @@
|
||||||
module github.com/Selly-Modules/elasticsearch
|
module git.selly.red/Selly-Modules/elasticsearch
|
||||||
|
|
||||||
go 1.17
|
go 1.17
|
||||||
|
|
||||||
require github.com/Selly-Modules/natsio v0.0.0-20220419025827-e72bc82991bf
|
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
git.selly.red/Selly-Modules/natsio v1.0.2-0.20221010041139-c11419a3ad33 // indirect
|
||||||
github.com/logrusorgru/aurora v2.0.3+incompatible // indirect
|
github.com/logrusorgru/aurora v2.0.3+incompatible // indirect
|
||||||
github.com/nats-io/nats.go v1.14.0 // indirect
|
github.com/nats-io/nats.go v1.17.0 // indirect
|
||||||
github.com/nats-io/nkeys v0.3.0 // indirect
|
github.com/nats-io/nkeys v0.3.0 // indirect
|
||||||
github.com/nats-io/nuid v1.0.1 // indirect
|
github.com/nats-io/nuid v1.0.1 // indirect
|
||||||
github.com/thoas/go-funk v0.9.2 // indirect
|
github.com/thoas/go-funk v0.9.2 // indirect
|
||||||
golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd // indirect
|
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect
|
||||||
)
|
)
|
||||||
|
|
37
go.sum
37
go.sum
|
@ -1,13 +1,9 @@
|
||||||
github.com/Selly-Modules/natsio v0.0.0-20220318042849-ee34e47598b7 h1:t4kLJt+Q4U4m79Ms9S6zjmIfTXSyrzxzVwLU6nGrQOo=
|
git.selly.red/Selly-Modules/natsio v1.0.2-0.20221010041139-c11419a3ad33 h1:GvQjelaV4XZm++AOihYAKOD6k9510aMAr6B6MGnrXPs=
|
||||||
github.com/Selly-Modules/natsio v0.0.0-20220318042849-ee34e47598b7/go.mod h1:NG55g9ip18nvN5tfP6PcSEKec10/lOeIOZC8HqBVNlQ=
|
git.selly.red/Selly-Modules/natsio v1.0.2-0.20221010041139-c11419a3ad33/go.mod h1:KNODhfeBqxRmHHQHHU+p3JfH42t8s5aNxfgr6X8fr6g=
|
||||||
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/Selly-Modules/natsio v0.0.0-20220419025827-e72bc82991bf h1:EryKoDKmVTGHLBIUFGYqDxSZ/WtzyGAUK6skbGBcbG8=
|
|
||||||
github.com/Selly-Modules/natsio v0.0.0-20220419025827-e72bc82991bf/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/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||||
|
github.com/davecgh/go-spew v1.1.1/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=
|
||||||
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
|
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
|
||||||
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
|
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
|
||||||
|
@ -17,17 +13,24 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw
|
||||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||||
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
|
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
|
||||||
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||||
|
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||||
github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||||
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
|
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
github.com/klauspost/compress v1.13.4 h1:0zhec2I8zGnjWcKyLl6i3gPqKANCCn5e9xmviEEeX6s=
|
github.com/klauspost/compress v1.13.4 h1:0zhec2I8zGnjWcKyLl6i3gPqKANCCn5e9xmviEEeX6s=
|
||||||
github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg=
|
github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg=
|
||||||
|
github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
|
||||||
|
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||||
|
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||||
|
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||||
github.com/logrusorgru/aurora v2.0.3+incompatible h1:tOpm7WcpBTn4fjmVfgpQq0EfczGlG91VSDkswnjF5A8=
|
github.com/logrusorgru/aurora v2.0.3+incompatible h1:tOpm7WcpBTn4fjmVfgpQq0EfczGlG91VSDkswnjF5A8=
|
||||||
github.com/logrusorgru/aurora v2.0.3+incompatible/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
|
github.com/logrusorgru/aurora v2.0.3+incompatible/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
|
||||||
github.com/minio/highwayhash v1.0.1 h1:dZ6IIu8Z14VlC0VpfKofAhCy74wu/Qb5gcn52yWoz/0=
|
github.com/minio/highwayhash v1.0.1 h1:dZ6IIu8Z14VlC0VpfKofAhCy74wu/Qb5gcn52yWoz/0=
|
||||||
github.com/minio/highwayhash v1.0.1/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY=
|
github.com/minio/highwayhash v1.0.1/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY=
|
||||||
|
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
|
||||||
github.com/nats-io/jwt v1.2.2 h1:w3GMTO969dFg+UOKTmmyuu7IGdusK+7Ytlt//OYH/uU=
|
github.com/nats-io/jwt v1.2.2 h1:w3GMTO969dFg+UOKTmmyuu7IGdusK+7Ytlt//OYH/uU=
|
||||||
github.com/nats-io/jwt v1.2.2/go.mod h1:/xX356yQA6LuXI9xWW7mZNpxgF2mBmGecH+Fj34sP5Q=
|
github.com/nats-io/jwt v1.2.2/go.mod h1:/xX356yQA6LuXI9xWW7mZNpxgF2mBmGecH+Fj34sP5Q=
|
||||||
github.com/nats-io/jwt/v2 v2.0.3 h1:i/O6cmIsjpcQyWDYNcq2JyZ3/VTF8SJ4JWluI5OhpvI=
|
github.com/nats-io/jwt/v2 v2.0.3 h1:i/O6cmIsjpcQyWDYNcq2JyZ3/VTF8SJ4JWluI5OhpvI=
|
||||||
|
@ -39,28 +42,42 @@ github.com/nats-io/nats.go v1.13.0 h1:LvYqRB5epIzZWQp6lmeltOOZNLqCvm4b+qfvzZO03H
|
||||||
github.com/nats-io/nats.go v1.13.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w=
|
github.com/nats-io/nats.go v1.13.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w=
|
||||||
github.com/nats-io/nats.go v1.14.0 h1:/QLCss4vQ6wvDpbqXucsVRDi13tFIR6kTdau+nXzKJw=
|
github.com/nats-io/nats.go v1.14.0 h1:/QLCss4vQ6wvDpbqXucsVRDi13tFIR6kTdau+nXzKJw=
|
||||||
github.com/nats-io/nats.go v1.14.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w=
|
github.com/nats-io/nats.go v1.14.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w=
|
||||||
|
github.com/nats-io/nats.go v1.17.0 h1:1jp5BThsdGlN91hW0k3YEfJbfACjiOYtUiLXG0RL4IE=
|
||||||
|
github.com/nats-io/nats.go v1.17.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w=
|
||||||
github.com/nats-io/nkeys v0.2.0/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s=
|
github.com/nats-io/nkeys v0.2.0/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s=
|
||||||
github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8=
|
github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8=
|
||||||
github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4=
|
github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4=
|
||||||
github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw=
|
github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw=
|
||||||
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
|
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
|
||||||
|
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
|
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
|
||||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||||
|
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
|
||||||
|
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
github.com/thoas/go-funk v0.9.1/go.mod h1:+IWnUfUmFO1+WVYQWQtIJHeRRdaIyyYglZN7xzUPe4Q=
|
github.com/thoas/go-funk v0.9.1/go.mod h1:+IWnUfUmFO1+WVYQWQtIJHeRRdaIyyYglZN7xzUPe4Q=
|
||||||
github.com/thoas/go-funk v0.9.2 h1:oKlNYv0AY5nyf9g+/GhMgS/UO2ces0QRdPKwkhY3VCk=
|
github.com/thoas/go-funk v0.9.2 h1:oKlNYv0AY5nyf9g+/GhMgS/UO2ces0QRdPKwkhY3VCk=
|
||||||
github.com/thoas/go-funk v0.9.2/go.mod h1:+IWnUfUmFO1+WVYQWQtIJHeRRdaIyyYglZN7xzUPe4Q=
|
github.com/thoas/go-funk v0.9.2/go.mod h1:+IWnUfUmFO1+WVYQWQtIJHeRRdaIyyYglZN7xzUPe4Q=
|
||||||
|
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
|
||||||
|
github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
|
||||||
|
github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g=
|
||||||
|
github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8=
|
||||||
|
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA=
|
||||||
|
go.mongodb.org/mongo-driver v1.10.1/go.mod h1:z4XpeoU6w+9Vht+jAFyLgVrD+jGSQQe0+CBWFHNiHt8=
|
||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||||
golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
|
golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
|
||||||
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||||
golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd h1:XcWmESyNjXJMLahc3mqVQJcgSTDxFxhETVlfk9uGc38=
|
golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd h1:XcWmESyNjXJMLahc3mqVQJcgSTDxFxhETVlfk9uGc38=
|
||||||
golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||||
|
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d h1:sK3txAijHtOK88l68nt020reeT1ZdKLIYetKl95FzVY=
|
||||||
|
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||||
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||||
|
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
@ -72,6 +89,7 @@ golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9sn
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
|
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||||
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 h1:NusfzzA6yGQ+ua51ck7E3omNUX/JuqbFSaRGqU8CcLI=
|
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 h1:NusfzzA6yGQ+ua51ck7E3omNUX/JuqbFSaRGqU8CcLI=
|
||||||
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
|
@ -87,5 +105,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ
|
||||||
google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ=
|
google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ=
|
||||||
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
|
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
|
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
|
||||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
|
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
|
|
10
pull.go
10
pull.go
|
@ -23,3 +23,13 @@ func (Pull) OrderUpsert(payload Payload) (bool, error) {
|
||||||
func (Pull) KeywordUpsert(payload Payload) (bool, error) {
|
func (Pull) KeywordUpsert(payload Payload) (bool, error) {
|
||||||
return publishWithJetStream(JetStreamSearchService, SubjectPullKeywordUpsert, toBytes(payload))
|
return publishWithJetStream(JetStreamSearchService, SubjectPullKeywordUpsert, toBytes(payload))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ProductSkuUpsert ...
|
||||||
|
func (Pull) ProductSkuUpsert(payload Payload) (bool, error) {
|
||||||
|
return publishWithJetStream(JetStreamSearchService, SubjectPullProductSkuUpsert, toBytes(payload))
|
||||||
|
}
|
||||||
|
|
||||||
|
// ProductShopUpsert ...
|
||||||
|
func (Pull) ProductShopUpsert(payload Payload) (bool, error) {
|
||||||
|
return publishWithJetStream(JetStreamSearchService, SubjectPullShopProductUpsert, toBytes(payload))
|
||||||
|
}
|
||||||
|
|
30
request.go
30
request.go
|
@ -4,6 +4,36 @@ package elasticsearch
|
||||||
type Request struct {
|
type Request struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ProductShopSearch ...
|
||||||
|
func (Request) ProductShopSearch(query ESQuery) (*Response, error) {
|
||||||
|
return requestNats(SubjectRequestShopProductSearch, toBytes(query))
|
||||||
|
}
|
||||||
|
|
||||||
|
// ProductShopUpsert ...
|
||||||
|
func (Request) ProductShopUpsert(payload Payload) (*Response, error) {
|
||||||
|
return requestNats(SubjectRequestShopProductUpsert, toBytes(payload))
|
||||||
|
}
|
||||||
|
|
||||||
|
// ProductShopCreateIndex ...
|
||||||
|
func (Request) ProductShopCreateIndex() (*Response, error) {
|
||||||
|
return requestNats(SubjectRequestShopProductCreateIndex, toBytes(Payload{}))
|
||||||
|
}
|
||||||
|
|
||||||
|
// ProductSkuSearch ...
|
||||||
|
func (Request) ProductSkuSearch(query ESQuery) (*Response, error) {
|
||||||
|
return requestNats(SubjectRequestProductSkuSearch, toBytes(query))
|
||||||
|
}
|
||||||
|
|
||||||
|
// ProductSkuUpsert ...
|
||||||
|
func (Request) ProductSkuUpsert(payload Payload) (*Response, error) {
|
||||||
|
return requestNats(SubjectRequestProductSkuUpsert, toBytes(payload))
|
||||||
|
}
|
||||||
|
|
||||||
|
// ProductSkuCreateIndex ...
|
||||||
|
func (Request) ProductSkuCreateIndex() (*Response, error) {
|
||||||
|
return requestNats(SubjectRequestProductSkuCreateIndex, toBytes(Payload{}))
|
||||||
|
}
|
||||||
|
|
||||||
// ProductSearch ...
|
// ProductSearch ...
|
||||||
func (Request) ProductSearch(query ESQuery) (*Response, error) {
|
func (Request) ProductSearch(query ESQuery) (*Response, error) {
|
||||||
return requestNats(SubjectRequestProductSearch, toBytes(query))
|
return requestNats(SubjectRequestProductSearch, toBytes(query))
|
||||||
|
|
132
struct.go
132
struct.go
|
@ -36,63 +36,81 @@ type DeleteDataPayload struct {
|
||||||
// ESQuery
|
// ESQuery
|
||||||
// Query support to search document
|
// Query support to search document
|
||||||
type ESQuery struct {
|
type ESQuery struct {
|
||||||
IsMatch bool // Search with match or prefix
|
IsMatch bool // Search with match or prefix
|
||||||
Index string // Index
|
Index string // Index
|
||||||
Page int64
|
Page int64
|
||||||
Limit int64
|
Limit int64
|
||||||
Keyword string
|
Keyword string
|
||||||
ProvinceCode int
|
ProvinceCode int
|
||||||
Active string
|
Active string
|
||||||
IsOutOfStock string
|
Display string
|
||||||
CanIssueInvoice string
|
ShopID string
|
||||||
PendingInactive string
|
IsOutOfStock string
|
||||||
Categories []string
|
CanIssueInvoice string
|
||||||
SubCategories []string
|
PendingInactive string
|
||||||
IgnoreIDs []string
|
Categories []string
|
||||||
Suppliers []string
|
SubCategories []string
|
||||||
SlugCites []string
|
IgnoreIDs []string
|
||||||
Type string
|
Suppliers []string
|
||||||
ServiceDelivery string
|
SlugCites []string
|
||||||
SourceDelivery string
|
Type string
|
||||||
Brands []string
|
ServiceDelivery string
|
||||||
NoBrand string
|
SourceDelivery string
|
||||||
Banned string
|
Brands []string
|
||||||
ListUser []string
|
NoBrand string
|
||||||
ListNotUser []string
|
Banned string
|
||||||
PaymentMethod string
|
ListUser []string
|
||||||
Source string
|
ListNotUser []string
|
||||||
FromNewActiveSeller string
|
PaymentMethod string
|
||||||
FromNewActiveBuyer string
|
Source string
|
||||||
EmailStatus string
|
ListSource []string
|
||||||
MerchantStatus string
|
FromNewActiveSeller string
|
||||||
IsCalled string
|
FromNewActiveBuyer string
|
||||||
IsAutoApproved string
|
EmailStatus string
|
||||||
ProcessStatus string
|
MerchantStatus string
|
||||||
OutboundRequestStatus string
|
IsCalled string
|
||||||
IsWholesaleBonus string
|
IsAutoApproved string
|
||||||
IsPreorder string
|
ProcessStatus string
|
||||||
IsDeleted string
|
OutboundRequestStatus string
|
||||||
Tags []string
|
IsWholesaleBonus string
|
||||||
Sorts []ESSort
|
IsPreorder string
|
||||||
ListStatus []string
|
IsDeleted string
|
||||||
ListDeliveryStatus []string
|
Tags []string
|
||||||
FromAt time.Time
|
Sorts []ESSort
|
||||||
ToAt time.Time
|
ListStatus []string
|
||||||
ApprovedFrom time.Time
|
ListDeliveryStatus []string
|
||||||
ApprovedTo time.Time
|
FromAt time.Time
|
||||||
DeliveredFrom time.Time
|
ToAt time.Time
|
||||||
DeliveredTo time.Time
|
ApprovedFrom time.Time
|
||||||
CashbackFrom time.Time
|
ApprovedTo time.Time
|
||||||
CashbackTo time.Time
|
DeliveredFrom time.Time
|
||||||
FromPrice float64
|
DeliveredTo time.Time
|
||||||
ToPrice float64
|
CashbackFrom time.Time
|
||||||
Inventories []string
|
CashbackTo time.Time
|
||||||
NotInventories []string
|
FromPrice float64
|
||||||
ReferralCode string
|
ToPrice float64
|
||||||
MembershipLevel int
|
Inventories []string
|
||||||
Invitee string
|
NotInventories []string
|
||||||
Segments []string
|
ReferralCode string
|
||||||
IsOrderMerchant bool
|
MembershipLevel int
|
||||||
|
Invitee string
|
||||||
|
Segments []string
|
||||||
|
IsOrderMerchant bool
|
||||||
|
ImportHistory string
|
||||||
|
IsSetup string
|
||||||
|
IsAvailable string
|
||||||
|
PlatForm string
|
||||||
|
BusinessType string
|
||||||
|
ServiceEcommerce []string
|
||||||
|
Status string
|
||||||
|
Fraud string
|
||||||
|
PickedFrom time.Time
|
||||||
|
PickedTo time.Time
|
||||||
|
SupplierApproveFrom time.Time
|
||||||
|
SupplierApproveTo time.Time
|
||||||
|
PlanPackage int
|
||||||
|
ProductType string
|
||||||
|
IsBlockedVisibleInSelly string
|
||||||
}
|
}
|
||||||
|
|
||||||
// ESSort
|
// ESSort
|
||||||
|
|
Loading…
Reference in New Issue