Commit Graph

467 Commits

Author SHA1 Message Date
Kevin Wan
1e717f9f5c
feat: add toml config (#1899) 2022-05-13 23:17:43 +08:00
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>
2022-05-13 12:32:34 +08:00
Kevin Wan
6d2b9fd904
chore: improve codecov (#1878) 2022-05-08 13:17:48 +08:00
Kevin Wan
69c2bad410
feat: logx with color (#1872)
* feat: logx with color

* chore: update logs

* fix test error

* chore: change colors of http codes

* chore: add comments

* chore: use faith/color instead of ascii code color

* chore: update colors

* chore: update colors

* chore: fix duplicated slowcall text

* chore: remove slowcall colors
2022-05-07 23:22:39 +08:00
Kevin Wan
d0a59b13a6
chore: fix deprecated usages (#1871)
* add conf documents

* chore: use {} instead of () for environment variables

* chore: fix deprecated usages

* chore: fix unstable tests

* chore: show stack on github actions
2022-05-06 15:13:46 +08:00
Kevin Wan
469e62067c
add conf documents (#1869)
* add conf documents

* chore: use {} instead of () for environment variables
2022-05-06 11:05:06 +08:00
Kevin Wan
a36d58aac9
fix time, duration, slice types on logx.Field (#1868)
* chore: refine tests

* fix #1866
2022-05-05 23:37:18 +08:00
Kevin Wan
aa5118c2aa
chore: refine tests (#1864) 2022-05-04 17:52:58 +08:00
Kevin Wan
974ba5c9aa
test: add codecov (#1863) 2022-05-04 16:19:51 +08:00
Kevin Wan
ec1de4f48d
test: add codecov (#1861)
* test: add codecov

* test: add codecov
2022-05-03 21:22:15 +08:00
Kevin Wan
bab72b7630
chore: use time.Now() instead of timex.Time() because go optimized it (#1860) 2022-05-03 19:51:47 +08:00
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
2022-05-03 17:34:26 +08:00
Kevin Wan
f21970c117
test: add more tests (#1856) 2022-05-02 21:24:20 +08:00
Kevin Wan
3bbc90ec24
refactor: move json related header vars to internal (#1840)
* refactor: move json related header vars to internal

* refactor: use header.ContentType
2022-04-28 15:12:04 +08:00
Kevin Wan
cef83efd4e
fix #1838 (#1839) 2022-04-28 11:25:26 +08:00
Kevin Wan
f7a60cdc24
fix: remove deprecated dependencies (#1837)
* fix: remove deprecated dependencies

* backup

* fix test error
2022-04-27 21:34:54 +08:00
Kevin Wan
1a38eddffe
refactor: simplify the code (#1835) 2022-04-27 10:44:24 +08:00
Kevin Wan
5bcee4cf7c
fix #1806 (#1833)
* fix #1806

* chore: refine error text
2022-04-27 00:01:31 +08:00
chen quan
22b157bb6c
chore: optimize code (#1818)
Signed-off-by: chenquan <chenquan.dev@gmail.com>
2022-04-23 22:02:04 +08:00
Kevin Wan
bc3c9484d1
chore: refactor (#1814) 2022-04-22 09:37:09 +08:00
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>
2022-04-22 09:04:44 +08:00
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
2022-04-19 14:03:04 +08:00
杨圆建
d58cf7a12a
fix: Hdel check result & Pfadd check result (#1801) 2022-04-18 17:38:36 +08:00
Kevin Wan
5d4e7c84ee
revert postgres package refactor (#1796)
* Revert "refactor: move postgres to pg package (#1781)"

This reverts commit ba8ac974aa.

* remove pg, use postgres
2022-04-17 12:07:48 +08:00
Kevin Wan
cb4fcf2c6c
fix marshal ptr in httpc (#1789)
* fix marshal ptr in httpc

* add more tests

* add more tests

* add more tests

* fix issue on options and optional both provided
2022-04-15 19:07:34 +08:00
Kevin Wan
ecc3653d44
fix #1729 (#1783) 2022-04-13 19:06:00 +08:00
Kevin Wan
ba8ac974aa
refactor: move postgres to pg package (#1781) 2022-04-13 12:46:09 +08:00
Kevin Wan
50de01fb49
feat: add httpc.Do & httpc.Service.Do (#1775)
* backup

* backup

* backup

* feat: add httpc.Do & httpc.Service.Do

* fix: not using strings.Cut, it's from Go 1.18

* chore: remove redudant code

* feat: httpc.Do finished

* chore: fix reviewdog

* chore: break loop if found

* add more tests
2022-04-11 11:00:28 +08:00
Kevin Wan
8bc34defc4
chore: avoid deadlock after stopping TimingWheel (#1768) 2022-04-07 11:50:18 +08:00
Kevin Wan
4e48286838
chore: add doc (#1764) 2022-04-06 22:42:40 +08:00
benqi
475d17e17d
feat: support ctx in kv methods (#1759) 2022-04-04 23:19:58 +08:00
Kevin Wan
8472415472
fix #1754 (#1757) 2022-04-04 22:13:08 +08:00
Kevin Wan
e0fa8d820d
feat: return original value of setbit in redis (#1746) 2022-04-02 20:25:51 +08:00
Kevin Wan
2b9fc26c38
refactor: guard timeout on API files (#1726) 2022-03-31 21:39:02 +08:00
Kevin Wan
e9620c8c05
chore: refactor code (#1708) 2022-03-24 22:10:15 +08:00
aimuz
70e51bb352
fix: empty slice are set to nil (#1702)
support for empty slce, Same behavior as json.Unmarshal
2022-03-24 21:41:38 +08:00
Kevin Wan
278cd123c8
feat: remove reentrance in redislock, timeout bug (#1704) 2022-03-24 16:17:01 +08:00
Kevin Wan
ec271db7a0
chore: refactor code (#1699) 2022-03-23 18:24:44 +08:00
benqi
bbac994c8a
feat: add getset command in redis and kv (#1693) 2022-03-23 18:02:56 +08:00
Kevin Wan
fe262766b4
chore: fix lint issue (#1694) 2022-03-22 13:31:05 +08:00
Kevin Wan
f060a226bc
refactor: simplify the code (#1670) 2022-03-20 17:26:12 +08:00
Mervin.Wong
93d524b797
fix: the new RawFieldNames considers the tag with options. (#1663)
Co-authored-by: JinfaWang <wangjinfa@iie.ac.cn>
2022-03-20 16:59:19 +08:00
Kevin Wan
3279a7ef0f
feat: add rest/httpc to make http requests governacible (#1638)
* feat: change x-trace-id to traceparent to follow opentelemetry

* feat: add rest/httpc to make http requests governacible

* chore: remove blank lines
2022-03-13 14:11:14 +08:00
Kevin Wan
c05d74b44c
feat: support cpu stat on cgroups v2 (#1636)
* feat: cpu stat

* feat: add cpu stat for cgroup2

* feat: add cpu stat for cgroup2, tidy mod

* feat: support cpu stat in cgroup v2
2022-03-12 21:00:04 +08:00
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
2022-03-12 18:49:07 +08:00
Kevin Wan
b939ce75ba
chore: refactor code (#1613) 2022-03-04 17:55:13 +08:00
Kevin Wan
3b7ca86e4f
chore: add unit tests (#1615)
* test: add more tests

* test: add more tests
2022-03-04 17:54:09 +08:00
Javen
60760b52ab
model中db标签增加'-'符号以支持数据库查询时忽略对应字段. (#1612) 2022-03-04 17:00:46 +08:00
qi
96c128c58a
fix: HitQuota should be returned instead of Allowed when limit is equal to 1. (#1581) 2022-03-04 16:14:45 +08:00
Kevin Wan
900bc96420
test: add more tests (#1604) 2022-03-02 21:19:04 +08:00