Commit Graph

252 Commits (105ab590fff8d9d8187bf2401aba9a6125ca5d5e)

Author SHA1 Message Date
maizige cfda972d50
fix:trace graceful stop,pre loss trace (#2358) 2 years ago
Kevin Wan 2d60f0c65a
fix: logx disable not working in some cases (#2306)
* fix: logx disable not working in some cases

* fix: test fail
2 years ago
chen quan 0316b6e10e
feat(redis): add ZaddFloat & ZaddFloatCtx (#2291) 2 years ago
Kevin Wan 8ed22eafdd
fix #2240 (#2263) 2 years ago
Kevin Wan 1568c3be0e
fix: time repr wrapper (#2255) 2 years ago
Kevin Wan 91b8effb24
chore: refactor redislock (#2210)
* chore: refactor redislock

* chore: add more tests
2 years ago
cong 4879d4dfcd
feat(redislock): support set context (#2208)
* feat(redislock): support set context

* chore: fix test
2 years ago
Kevin Wan 6c94e4652e
chore: better mongo logs (#1965)
* chore: better mongo logs

* chore: add comments
3 years ago
kevin edfaa6d906
🐞 fix: fixed typo (#1916)
Co-authored-by: kevinzhang <kevinzhang@moonton.com>
3 years ago
Kevin Wan 72ebbb9774
feat: update docker alpine package mirror (#1924)
* feat: update docker alpine package mirror

* chore: format code
3 years ago
Kevin Wan 6b1e15cab1
chore: update k8s.io/client-go for security reason, go is upgrade to 1.16 (#1912)
* chore: fix jwt dependency security issue

* chore: update clickhouse driver

* chore: fix a security issue

* chore: update dependencies
3 years ago
Kevin Wan 1e717f9f5c
feat: add toml config (#1899) 3 years ago
chen quan e567a0c718
refactor: refactor trace in redis & sql & mongo (#1865)
* refactor: refactor tracing in redis & sql & mongo

Signed-off-by: chenquan <chenquan.dev@gmail.com>

* fix: fix some tests

Signed-off-by: chenquan <chenquan.dev@gmail.com>

* refactor: add missing content

Signed-off-by: chenquan <chenquan.dev@gmail.com>

* refactor: adjust `log` and `return`

Signed-off-by: chenquan <chenquan.dev@gmail.com>

* refactor: reformat code

Signed-off-by: chenquan <chenquan.dev@gmail.com>

* refactor: reformat code

Signed-off-by: chenquan <chenquan.dev@gmail.com>

* refactor: reformat code

Signed-off-by: chenquan <chenquan.dev@gmail.com>

* refactor: simpler span name

Signed-off-by: chenquan <chenquan.dev@gmail.com>

* refactor: fix a bug

Signed-off-by: chenquan <chenquan.dev@gmail.com>

* refactor: fix a bug

Signed-off-by: chenquan <chenquan.dev@gmail.com>
3 years ago
Kevin Wan 974ba5c9aa
test: add codecov (#1863) 3 years ago
Kevin Wan ec1de4f48d
test: add codecov (#1861)
* test: add codecov

* test: add codecov
3 years ago
Kevin Wan ac321fc146
feat: add fields with logx methods, support using third party logging libs. (#1847)
* backup

* simplify

* chore: remove unused pool

* chore: fix lint errors

* chore: use strings.Builder instead of bytes.Buffer

* test: add more tests

* chore: fix reviewdog

* test: fix data race

* feat: make logger customizable

* chore: fix reviewdog

* test: fix fails

* chore: fix set writer twice

* chore: use context instead of golang.org context

* chore: specify uint32 for level types
3 years ago
Kevin Wan f7a60cdc24
fix: remove deprecated dependencies (#1837)
* fix: remove deprecated dependencies

* backup

* fix test error
3 years ago
Kevin Wan 1a38eddffe
refactor: simplify the code (#1835) 3 years ago
Kevin Wan 5bcee4cf7c
fix #1806 (#1833)
* fix #1806

* chore: refine error text
3 years ago
chen quan 22b157bb6c
chore: optimize code (#1818)
Signed-off-by: chenquan <chenquan.dev@gmail.com>
3 years ago
Kevin Wan bc3c9484d1
chore: refactor (#1814) 3 years ago
chen quan 162e9cef86
feat: add trace in redis & mon & sql (#1799)
* feat: add sub spanId with redis

Signed-off-by: chenquan <chenquan.dev@gmail.com>

* add tests

Signed-off-by: chenquan <chenquan.dev@gmail.com>

* fix a bug

Signed-off-by: chenquan <chenquan.dev@gmail.com>

* feat: add sub spanId in sql

Signed-off-by: chenquan <chenquan.dev@gmail.com>

* feat: add sub spanId in mon

Signed-off-by: chenquan <chenquan.dev@gmail.com>

* chore: optimize code

Signed-off-by: chenquan <chenquan.dev@gmail.com>

* feat: add breaker in warpSession

Signed-off-by: chenquan <chenquan.dev@gmail.com>

* chore: optimize code

Signed-off-by: chenquan <chenquan.dev@gmail.com>

* test: add tests

Signed-off-by: chenquan <chenquan.dev@gmail.com>

* chore: reformat code

Signed-off-by: chenquan <chenquan.dev@gmail.com>

* fix: fix typo

Signed-off-by: chenquan <chenquan.dev@gmail.com>

* fix a bug

Signed-off-by: chenquan <chenquan.dev@gmail.com>
3 years ago
Kevin Wan 2cdff97934
feat: use mongodb official driver instead of mgo (#1782)
* wip: backup

* wip: backup

* wip: backup

* backup

* backup

* backup

* add more tests

* fix wrong dependency

* fix lint errors

* remove test due to data race

* add tests

* fix test error

* add mon.Model

* add mon.Model unmarshal

* add monc

* add more tests for monc

* add more tests for monc

* add docs for mon and monc packages

* fix doc errors

* chhore: add comment

* chore: fix test bug

* chore: refine tests

* chore: remove primitive.NewObjectID in test code

* chore: rename test files for typo
3 years ago
杨圆建 d58cf7a12a
fix: Hdel check result & Pfadd check result (#1801) 3 years ago
Kevin Wan 5d4e7c84ee
revert postgres package refactor (#1796)
* Revert "refactor: move postgres to pg package (#1781)"

This reverts commit ba8ac974aa.

* remove pg, use postgres
3 years ago
Kevin Wan ba8ac974aa
refactor: move postgres to pg package (#1781) 3 years ago
benqi 475d17e17d
feat: support ctx in kv methods (#1759) 3 years ago
Kevin Wan e0fa8d820d
feat: return original value of setbit in redis (#1746) 3 years ago
Kevin Wan 2b9fc26c38
refactor: guard timeout on API files (#1726) 3 years ago
Kevin Wan 278cd123c8
feat: remove reentrance in redislock, timeout bug (#1704) 3 years ago
Kevin Wan ec271db7a0
chore: refactor code (#1699) 3 years ago
benqi bbac994c8a
feat: add getset command in redis and kv (#1693) 3 years ago
Kevin Wan f060a226bc
refactor: simplify the code (#1670) 3 years ago
Mervin.Wong 93d524b797
fix: the new RawFieldNames considers the tag with options. (#1663)
Co-authored-by: JinfaWang <wangjinfa@iie.ac.cn>
3 years ago
mlr3000 32c88b6352
feat: support oracle :N dynamic parameters (#1552)
* chore:use struct pointer

* feat: support oracle :N dynamic parameters

* Update utils.go

* Update utils.go

* Update utils.go

pg argIndex will not always go up

* Update utils_test.go

* Keep the original

* Update utils_test.go
3 years ago
Kevin Wan b939ce75ba
chore: refactor code (#1613) 3 years ago
Javen 60760b52ab
model中db标签增加'-'符号以支持数据库查询时忽略对应字段. (#1612) 3 years ago
Kevin Wan 900bc96420
test: add more tests (#1604) 3 years ago
Kevin Wan 607bae27fa
feat: support ctx in sqlx/sqlc, listed in ROADMAP (#1535)
* feat: support ctx in sqlx/sqlc

* chore: update roadmap

* fix: context.Canceled should be acceptable

* use %w to wrap errors

* chore: remove unused vars
3 years ago
Kevin Wan 9e113909b3
ignore context.Canceled for redis breaker (#1545) 3 years ago
Kevin Wan 2732d3cdae
chore: refactor cache (#1532) 3 years ago
chenquan e8c307e4dc
feat: support ctx in `Cache` (#1518)
* feature: support ctx in `Cache`

Signed-off-by: chenquan <chenquan.dev@foxmail.com>

* fix: `errors.Is` instead of `=`

Signed-off-by: chenquan <chenquan.dev@foxmail.com>
3 years ago
Kevin Wan a40254156f
refactor: refactor yaml unmarshaler (#1517) 3 years ago
Kevin Wan 822ee2e1c5
feat: update go-redis to v8, support ctx in redis methods (#1507)
* feat: update go-redis to v8, support ctx in redis methods

* fix compile errors

* chore: remove unused const

* chore: add tracing log on redis
3 years ago
Kevin Wan 0fdd8f54eb
ci: add test for win (#1503)
* ci: add test for win

* ci: update check names

* ci: use go build instead of go test to verify win test

* fix: windows test failure

* chore: disable logs in tests
3 years ago
shenbaise9527 13db7a1931
feat: 支持redis的LTrim方法 (#1443) 3 years ago
Kevin Wan eb4b86137a
fix: golint issue (#1423) 3 years ago
Kevin Wan a91c3907a8
feat: rename module from tal-tech to zeromicro (#1413) 3 years ago
Kevin Wan 8745ed9c61
chore: add 1s for tolerance in redislock (#1367) 3 years ago
种豆得豆 836726e710
fix redis try-lock bug (#1366)
#issue_id: 1338

Co-authored-by: zhangwei <>
3 years ago
Kevin Wan d1c2a31af7
chore: add tests & refactor (#1346)
* chore: add tests & refactor

* chore: refactor
3 years ago
MarkJoyMa 3e6c217408
Feature: support adding custom cache to mongoc and sqlc (#1313)
* merge

* Feature: support adding custom cache to mongoc and sqlc
3 years ago
Kevin Wan b299f350be
chore: add comments (#1345) 3 years ago
Kevin Wan 776e6e647d
feat: tidy mod, add go.mod for goctl (#1328) 3 years ago
Kevin Wan 4ccdf4ec72
chore: format code (#1327) 3 years ago
CrazyZard a7bd993c0c
commit missing method for redis (#1325)
* commit `decr ` `decrby` `lindex` missing method for redis

* fix(store_test):TestRedis_DecrBy

* add unit tests for redis commands. And put the functions in alphabetical order

* put the functions in alphabetical order

* add `lindex` unit test

* sort func
3 years ago
Kevin Wan 4f5c30e083
chore: remove unused const (#1224) 3 years ago
an 3a510a9138
chore: redislock use stringx.randn replace randomStr func (#1220) 3 years ago
anqiansong 69a4d213a3
Fix issue 1205 (#1211)
* fix #1205

* move builder into stores

* remove xrom

* Remove unused code

* Remove unused code

* refactor builderx to builder

Co-authored-by: anqiansong <anqiansong@bytedance.com>
3 years ago
Kevin Wan e8efcef108
update dependencies. (#1210)
* chore: update dependencies

* chore: update dependencies

* chore: update dependencies

* chore: update dependencies

* chore: fix test failure
3 years ago
yedf2 6aba5f74fc
feat: add NewSessionFromTx to interact with other orm (#1202)
Co-authored-by: yedongfu <dongfuye@163.com>
3 years ago
Kevin Wan 785d100be9
feat: slow threshold customizable in sqlx (#1188) 3 years ago
Kevin Wan f13e6f1149
feat: slow threshold customizable in redis (#1187) 3 years ago
Kevin Wan 8be0f77d96
feat: slow threshold customizable in mongo (#1186) 3 years ago
Kevin Wan 429f85a9de
feat: slow threshold customizable in redis (#1185)
* feat: slow threshold customizable in redis

* chore: improve config robustness
3 years ago
Kevin Wan e43357164c
chore: replace redis.NewRedis with redis.New (#1103) 3 years ago
Kevin Wan cd21c9fa74
chore: mark redis.NewRedis as Deprecated, use redis.New instead. (#1100)
* chore: mark redis.NewRedis as Deprecated

* chore: mark redis.NewRedis as Deprecated
3 years ago
Kevin Wan 8403ed16ae
ci: add Lint check on commits (#1086)
* ci: add Lint check on commits

* ci: fix Lint script error

* test: fix go vet errors

* test: fix go vet errors, remove gofumpt to check go vet

* test: fix go vet errors, try gofumpt

* test: fix go vet errors, try gofumpt, round 1

* test: fix go vet errors, try gofumpt, round 2

* ci: fix Lint errors
3 years ago
Kevin Wan 24fd34413f
fix golint issues (#1027) 3 years ago
Kevin Wan 0b6bc69afa
reorg imports, format code (#1024) 3 years ago
Kevin Wan 5cc9eb0de4
rename sharedcalls to singleflight (#1017) 3 years ago
Kevin Wan f070d447ef
refactor for better error reporting on sql error (#1016)
* refactor for better error reporting on sql error

* fix errors

* add docs
3 years ago
Kevin Wan f6d9e19ecb
expose sql.DB to let orm operate on it (#1015)
* expose sql.DB to let orm operate on it

* add missing RawDB methods

* add NewSqlConnFromDB for cooperate with dtm
3 years ago
Kevin Wan bf3ce16823
fix #820 (#934) 3 years ago
lucaq e77747cff8
redis.go,type StringCmd = red.StringCmd (#790)
* Add Sinter,Sinterstore; Modify TestRedis_Set

* type StringCmd

* redis.go,type StringCmd = red.StringCmd

Co-authored-by: lucq <lucq@toopsoon.com>
3 years ago
Kevin Wan 5b22823018
fix bug that empty query in transaction (#801) 3 years ago
lucaq c9a2a60e28
Add Sinter,Sinterstore & Modify TestRedis_Set (#779)
* Add Sinter,Sinterstore; Modify TestRedis_Set

* Update redis_test.go

fix test failure

Co-authored-by: lucq <lucq@toopsoon.com>
Co-authored-by: Kevin Wan <wanjunfeng@gmail.com>
3 years ago
Kevin Wan aaa3623404
optimize nested conditional (#709) 4 years ago
Kevin Wan aaa39e17a3
print entire sql statements in logx if necessary (#704) 4 years ago
Bo-Yi Wu 73906f996d
chore(format): change by gofumpt tool (#697)
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
4 years ago
Kevin Wan 9adc7d4cb9
fix comment function names (#649) 4 years ago
Bo-Yi Wu afd9ff889e
chore: update code format. (#628) 4 years ago
Kevin Wan ee630b8b57
add code coverage (#615)
* add code coverage

* simplify redis code
4 years ago
Kevin Wan 9963ffb1c1
simplify redis tls implementation (#606) 4 years ago
r00mz 8cb6490724
redis增加tls支持 (#595)
* redis连接增加支持tls选项

* 优化redis tls config 写法

* redis增加tls支持

* 增加redis tls测试用例,但redis tls local server不支持,测试用例全部NotNil

Co-authored-by: liuyi <liuyi@fangyb.com>
Co-authored-by: yi.liu <yi.liu@xshoppy.com>
4 years ago
Kevin Wan bd623aaac3
support postgresql (#583)
support postgresql
4 years ago
hanhotfox c954568b61
Hdel support for multiple key deletion (#542)
* Hdel support for multiple key deletion

* Hdel field -> fields

Co-authored-by: duanyan <duanyan@xiaoheiban.cn>
4 years ago
Kevin Wan 39540e21d2
fix golint issues (#540) 4 years ago
hexiaoen b321622c95
暴露redis EvalSha 以及ScriptLoad接口 (#538)
Co-authored-by: shanehe <shanehe@zego.im>
4 years ago
kingxt a25cba5380
fix collection breaker (#537)
* fix collection breaker

* optimized

* optimized

* optimized
4 years ago
Kevin Wan 791e76bcf0
fix broken build (#528) 4 years ago
Kevin Wan c566b5ff82
fix golint issues in core/stores (#527) 4 years ago
Zcc、 fdeacfc89f
add redis bitmap command (#490)
Co-authored-by: zhoudeyu <zhoudeyu@xiaoheiban.cn>
4 years ago
Kevin Wan c376ffc351
fix golint issues in core/filex (#485) 4 years ago
Kevin Wan 802549ac7c
fix golint issues in core/executors (#484) 4 years ago
Zcc、 72580dee38
redis add bitcount (#483)
Co-authored-by: zhoudeyu <zhoudeyu@xiaoheiban.cn>
4 years ago
Kevin Wan 457048bfac
fix golint issues in core/collection, refine cache interface (#475) 4 years ago
Kevin Wan 03b5fd4a10
fix golint issues (#458) 4 years ago
Kevin Wan 5e969cbef0
fix golint issues, else blocks (#457) 4 years ago
Kevin Wan 42883d0899
fix golint issues, redis methods (#455) 4 years ago
Kevin Wan 06f6dc9937
fix golint issues, package comments (#454) 4 years ago
Kevin Wan 745e76c335
add more tests for stores (#446) 4 years ago
Kevin Wan 852891dbd8
add more tests for stores (#445) 4 years ago
Kevin Wan 316195e912
add more tests for mongoc (#443) 4 years ago
Kevin Wan 8e889d694d
add more tests for sqlx (#442)
* add more tests for sqlx

* add more tests for sqlx
4 years ago
Kevin Wan c282bb1d86
add more tests for sqlx (#440) 4 years ago
Kevin Wan b88ba14597
fixes issue #425 (#438) 4 years ago
Kevin Wan 30f5ab0b99
update readme for broken links (#432) 4 years ago
foyon 8b273a075c
Support redis command Rpop (#431)
* ss

* ss

* add go-zero:stores:redis-command:Rpop and redis_test

* Delete 1.go

* support redis command Rpop

Co-authored-by: fanhongyi <fanhongyi@tal.com>
4 years ago
Hkesd 04284e31cd
support hscan in redis (#428) 4 years ago
Kevin Wan c3b9c3c5ab
use english readme as default, because of github ranking (#427) 4 years ago
Kevin Wan a784982030
support zunionstore in redis (#410) 4 years ago
Kevin Wan 7a82cf80ce
support k8s deployment yaml generation (#247)
* simplify code, format makefile

* simplify code

* some optimize by kevwan and benying (#240)

Co-authored-by: 杨志泉 <zhiquan.yang@yiducloud.cn>

* optimization (#241)

* optimize docker file generation, make docker build faster

* support k8s deployment yaml generation

Co-authored-by: benying <31179034+benyingY@users.noreply.github.com>
Co-authored-by: 杨志泉 <zhiquan.yang@yiducloud.cn>
Co-authored-by: bittoy <bittoy@qq.com>
4 years ago
bittoy 3819f67cf4
add redis geospatial (#209)
* add redis geospatial

* fix go test error
4 years ago
kevin afbd565d87 rename postgres 4 years ago
kevin f87d9d1dda refine code style 4 years ago
kevin 88333ee77f faster the tests 4 years ago
kevin d0b76b1d9a move redistest into redis package 4 years ago
kevin b004b070d7 refine tests 4 years ago
kevin 1fd2ef9347 make tests faster 4 years ago
kevin c9b0ac1ee4 add more tests 4 years ago
mywaystay 33faab61a3
add redis Zrevrank (#137)
* update goctl rpc template log print url

* add redis Zrevrank

Co-authored-by: zhangkai <zhangkai@laoyuegou.com>
4 years ago
kevin fe3739b7f3 fix golint issues 4 years ago
kevin da1a93e932 faster the tests 4 years ago
kevin a1b141d31a make tests faster 4 years ago
kevin fe855c52f1 avoid bigint converted into float64 when unmarshaling 4 years ago
kevin 7c354dcc38 add more tests 4 years ago
kevin 8115a0932e add more tests 4 years ago
kevin 4df5eb760c add more tests 4 years ago
kevin 305b6749fd add more tests 4 years ago
kevin 10b855713d add more tests 4 years ago
kevin 02ce8f82c8 add more tests 4 years ago
kevin 8a585afbf0 add more tests 4 years ago
kevin 14dee114dd add more tests 4 years ago
kevin 173b347c90 add more tests 4 years ago
kevin 6749c5b94a add more tests 4 years ago
kevin 44ae5463bc add more tests 4 years ago
kevin 40dbd722d7 add more tests 4 years ago
kevin 709574133b add more tests 4 years ago
kevin 6ecf575c00 add more tests 4 years ago
kevin 096fe3bc47 add more tests 4 years ago
kevin e37858295a add more tests 4 years ago
kevin 5a4afb1518 add more tests 4 years ago
kevin 63f1f39c40 fix int64 primary key problem 4 years ago
kevin d1b303fe7e export cache package, add client interceptor customization 4 years ago
bittoy 0a36031d48
use default mongo db (#103) 4 years ago
kevin 55c9c3f3dd replace clickhouse driver to the official one 4 years ago
kevin e79c42add1 add go report badge 4 years ago
kevin 9e14820698 fix golint warnings 4 years ago
kevin 8745039877 move lang.Must into logx.Must to make sure output fatal message as json 4 years ago