Compare commits

...

1781 Commits

Author SHA1 Message Date
a2b322a31b improve gtime.ParseTimeFromContent 2021-01-27 23:37:04 +08:00
69e1628a0d improve unit testing case for package gtimer 2021-01-27 23:08:43 +08:00
6307af1096 travis updates 2021-01-27 21:02:39 +08:00
6e4e1abf1e improve tracing by adding constants for attribute and event names 2021-01-27 20:25:57 +08:00
2c15aad0e7 add common tracing labels 2021-01-27 19:50:32 +08:00
152c472bc2 add common tracing labels 2021-01-27 19:24:04 +08:00
8f6f17c341 add common tracing labels 2021-01-27 19:15:14 +08:00
f2fe084988 improve tracing feature 2021-01-27 13:28:12 +08:00
f5ba665c59 improve package gcfg 2021-01-27 00:55:45 +08:00
9cc5d7a691 improve package gdebug/gfile 2021-01-27 00:20:23 +08:00
94adc50487 version updates 2021-01-26 21:20:06 +08:00
1c93c2b000 merge develop 2021-01-26 21:19:43 +08:00
6bad31f1be move tracing examples to new repo. 2021-01-26 20:07:40 +08:00
24e2c7926e go mod tidy 2021-01-26 16:53:39 +08:00
e3be3bac92 add tracing example for grpc 2021-01-26 16:50:16 +08:00
c72c7dbe9a improve tracing feature 2021-01-26 16:06:20 +08:00
52c17dfce0 add example for tracing feature 2021-01-26 14:33:35 +08:00
c01b520ba6 improve package gcache 2021-01-26 14:11:36 +08:00
796774efe4 improve package gcache 2021-01-26 13:33:24 +08:00
0baa52afee improve statement features for package gdb 2021-01-26 11:09:50 +08:00
4c6d9f5eff improve tracing feture for package glog/gdb/gredis 2021-01-26 01:19:55 +08:00
99dd889ff0 add tracing feature for package gredis 2021-01-25 21:59:44 +08:00
b89d8d2740 add tracing feature for package gdb 2021-01-25 21:17:32 +08:00
cc1e340585 add tracing middleware for ghttp.Client/Server; add package gtrace 2021-01-25 18:43:47 +08:00
3f2ae3ba62 add tracing feature for ghttp.Client 2021-01-25 14:54:38 +08:00
e622ece861 merge develop 2021-01-25 10:23:46 +08:00
9f2e69a9e6 improve model relation feature for package gdb 2021-01-25 00:04:01 +08:00
9b02f5220a imprive uint testing case for package gtimer 2021-01-24 22:33:47 +08:00
2dd2144dcd improve unit testing case for package gdb/gcron 2021-01-24 21:52:34 +08:00
a5f53f158a improve unit testing case for package gcron; improve package gdb; 2021-01-23 01:01:24 +08:00
2c7a257b5a remove parseTime parameter for mysql driver for package gdb 2021-01-22 23:49:17 +08:00
f579c724c6 fix issue in batch number for package gdb 2021-01-22 23:21:29 +08:00
ab9d7ed509 improve package gcron 2021-01-22 23:09:42 +08:00
9524263803 improve unit testing cases for package gcron 2021-01-22 23:07:11 +08:00
c27ddb1d79 opentelemetry 2021-01-22 23:04:29 +08:00
ce640048b8 improve package gcfg 2021-01-22 15:30:39 +08:00
e222d92fb5 improve unit testing case for package gcron 2021-01-22 15:19:11 +08:00
f1ed9b31b6 add g.Listen for automatic signal handling feature 2021-01-22 12:57:21 +08:00
da0669c739 improve middleware feature for ghttp.Client 2021-01-22 01:06:44 +08:00
5679972d8d Merge pull request #1130 from eyasliu/develop-ghttp-middleware
New feature: ghttp client middleware
2021-01-22 00:36:57 +08:00
0aca2f0501 fix issue in package g; improve package ghttp 2021-01-22 00:36:28 +08:00
0fb32b63e7 add signal handler feature for package gproc; improve package ghttp/g for signal listening feature 2021-01-21 21:14:17 +08:00
b38a4610eb improve unit testing case for package gtimer 2021-01-20 14:19:14 +08:00
59285709a6 fix issue in filds filter in join statements for package gdb 2021-01-20 13:09:59 +08:00
a304ca8f5b improve unit testing case for package gcron 2021-01-20 00:18:29 +08:00
333e5b27aa add more unit testing case for package gdb 2021-01-19 21:08:01 +08:00
5f4293a803 make unnecessaryly exported resource private for package ghttp 2021-01-19 19:33:21 +08:00
fe80881ec9 improve package ghttp 2021-01-19 19:18:39 +08:00
e1418a2caa fix blocking issue in roration feature for package glog 2021-01-19 16:44:37 +08:00
68247acab1 improve package gjson/gvar 2021-01-19 14:26:17 +08:00
6d05512c2f improve unit testing case for package gtimer 2021-01-19 12:35:10 +08:00
bf6d6a29c0 improve package gtmer 2021-01-19 11:27:23 +08:00
353286fd84 fix issue in gtimer 2021-01-19 10:40:07 +08:00
c801df497f fix issue in package gtimer 2021-01-19 00:12:22 +08:00
93a648ba15 fixing gtimer 2021-01-18 21:20:10 +08:00
826b9b1b1f fix issue in struct converting for package ghttp 2021-01-18 09:22:46 +08:00
e661b160d8 const name renaming 2021-01-17 22:10:45 +08:00
8b6d00b193 improve package gconv 2021-01-17 22:06:07 +08:00
093034acd1 copyright comment update 2021-01-17 21:46:25 +08:00
6f968a125e improve time converting for package gconv 2021-01-17 21:39:17 +08:00
5c9cee7fb9 improve package gconv 2021-01-17 20:56:38 +08:00
7676837337 fix abort test 2021-01-17 18:05:29 +08:00
c5145dc4f6 remove abort, actually the abort is unuse 2021-01-17 17:26:53 +08:00
91e29e23a4 improve package gcfg for searching priority 2021-01-16 22:31:48 +08:00
1e309e570d Merge branch 'master' into develop 2021-01-16 20:42:44 +08:00
8362322d63 Merge pull request #1129 from eyasliu/develop-ghttp-wrap-std-handler
add util: WrapF and WrapH to transform net/http handler to ghttp.HandlerFunc
2021-01-16 20:41:57 +08:00
aefa54f04b improve package gredis 2021-01-16 20:37:59 +08:00
2c5e6b379f improve package gres 2021-01-16 20:20:30 +08:00
c20f3f0595 add Wrapf and WrapH to transform net/http.HandlerFunc and net/http.Handler to ghttp.HandlerFunc 2021-01-16 17:53:26 +08:00
5b17108f71 trigger CI 2021-01-15 18:43:28 +08:00
1fee3eb5f0 fix review change 2021-01-15 13:58:16 +08:00
bc4d84b60f improve comment for package gtime 2021-01-14 00:27:01 +08:00
6a67dceca7 Merge pull request #1092 from tiansin/master
feat: 🎨 some time features.
2021-01-14 00:15:44 +08:00
9c8a68f742 add MarshalJSON for package gerror 2021-01-14 00:05:15 +08:00
2d67d31f90 improve benckmark for package grand 2021-01-13 23:38:10 +08:00
c1b52e0f35 add more unit testing cases for package gredis 2021-01-13 20:00:31 +08:00
55a7c01f73 feat: 🚑 Add function comment 2021-01-13 16:14:21 +08:00
6cf48f9479 improve package gstr 2021-01-13 10:56:17 +08:00
f9905f2bb5 gofmt code 2021-01-12 19:09:45 +08:00
c07c74bf1b fix lint 2021-01-12 19:01:33 +08:00
14536e9abc add http client middleware feature 2021-01-12 18:08:50 +08:00
73c68e48a1 improve package gvalid 2021-01-12 10:46:39 +08:00
a9aa021914 add json tag for configuration struct for package gdb/gredis/ghttp/glog/gview 2021-01-12 00:42:33 +08:00
2ae32ed2c2 add QueryTimeout/ExecTimeout/TranTimeout/PrepareTimeout for package gdb 2021-01-11 20:48:35 +08:00
8ee3793f8f add SessionCookieMaxAge configuration for ghttp.Server 2021-01-11 20:06:09 +08:00
6f5b0c393e add more unit testing case for package gdb 2021-01-11 19:30:22 +08:00
a4152347e5 improve comment for package ghttp 2021-01-10 23:37:20 +08:00
bb2dad6d5e improve package gdb of empty value handling for struct convertion 2021-01-09 23:02:16 +08:00
92b791eb08 improve Struct convertion for package gdb; improve IsNil function for package internal/empty 2021-01-09 21:05:47 +08:00
8365ce9d29 change name *Case to Case* for case functions of package gstr 2021-01-08 16:24:08 +08:00
e141b8e098 shutdown server gracefully when reveiving TERM signal 2021-01-08 00:58:58 +08:00
c7ce8cf943 fix issue in resource searching for package gcfg 2021-01-08 00:39:52 +08:00
788ade2db0 improve package gres 2021-01-07 19:34:46 +08:00
a9f332fdd6 version updates 2021-01-07 13:00:53 +08:00
c6f1ae9426 add file name configuration from command line or environment for package gcfg 2021-01-07 01:17:03 +08:00
b12c909fd6 add logging level configuration for package ghttp 2021-01-06 01:00:49 +08:00
1a62f22a5b Merge branch 'master' into develop 2021-01-06 00:39:54 +08:00
5c2574da7c improve package ghttp 2021-01-06 00:39:50 +08:00
9fbdb9712b improve package gtime 2021-01-04 19:50:44 +08:00
7bc42e6eaa improve Fields filtering for package gdb 2021-01-04 19:46:46 +08:00
b6b1bc8813 improve time converting for package gconv 2021-01-04 19:22:55 +08:00
a62d2589bc improve time zone feature for package gtime 2021-01-04 16:33:33 +08:00
e4069bdb93 improve package gtime 2021-01-04 15:46:51 +08:00
1e100ac0ec improve package gtime 2021-01-04 15:43:54 +08:00
9d865e4ac6 improve package gtime 2021-01-04 15:32:55 +08:00
b3b1418e11 improve packge gi18n 2021-01-04 14:43:17 +08:00
3ab32faccc improve package gins 2021-01-04 14:15:42 +08:00
2eb09efc81 fix issue of data race in unit testing case for package gtime 2021-01-04 14:03:22 +08:00
dd2dfbf58d fix issue of data race in unit testing case for package gtime 2021-01-04 13:50:23 +08:00
d549311210 fix issue in uint testing case for package gdb 2021-01-04 13:04:57 +08:00
8a91592839 fix issue in eq for package gview 2021-01-04 00:05:02 +08:00
4d962c5aa5 improve packge gdb for treat int8 as int64 for pgsql 2021-01-03 23:44:44 +08:00
d9bd3153ea improve time parsing for package gtime 2021-01-03 23:37:45 +08:00
4991e14dff improve error message when failed in Mkdir 2021-01-03 12:05:04 +08:00
5629020538 fix issue in incorrect datetime string argument for oracle 2021-01-02 21:06:51 +08:00
361742c4a0 fix issue in incorrect datetime string argument for oracle 2021-01-02 20:31:25 +08:00
4272ac16c7 README updates 2021-01-02 15:12:08 +08:00
6c08d5fd81 fix issue missing build-in variable Request for template parsing of ghttp.Response 2021-01-02 01:53:36 +08:00
2a9c20bfa2 README updates 2021-01-02 01:24:42 +08:00
8dab319a7f README updates 2021-01-02 00:51:53 +08:00
5d01c9fff3 version updates 2020-12-31 00:27:42 +08:00
020b6bde68 README updates 2020-12-30 16:42:50 +08:00
036bc03ebf improve error handling for package gconv 2020-12-30 13:27:27 +08:00
86e70ad55c improve package gerror 2020-12-30 13:18:43 +08:00
bdf23ef48f fix issue of error code lost in middleware handling for package ghttp 2020-12-30 12:56:24 +08:00
820befa1a0 improve insert function for package gdb 2020-12-29 20:30:29 +08:00
0d5b93bd07 fix issue in incorrect parsing error message for gview 2020-12-29 19:43:25 +08:00
dbafe01064 feat: 🎨 some time features. 2020-12-29 18:05:00 +08:00
51d9f7ff12 fix issue in configuration string parsing error when there're special chars(especially '?') in redis password 2020-12-29 16:49:15 +08:00
4beeeb92ac improve gerror.Stack 2020-12-29 14:28:26 +08:00
662f1ed6b7 add Query/Exec/Prepare back for gdb.Link 2020-12-29 14:01:49 +08:00
05703ec3d7 improve ghttp.RouterGroup.ALLMap 2020-12-29 13:39:40 +08:00
bfab4a4952 comment updates for package gdb 2020-12-29 13:30:15 +08:00
9d25e17fcb readme updates 2020-12-29 09:09:12 +08:00
4828ddcdd7 add example/unit testing cases for package gdb 2020-12-29 00:01:27 +08:00
d25a3909d1 improve context feature for package gdb 2020-12-28 23:03:13 +08:00
695d333d2f add example cases for package gerror 2020-12-28 14:59:49 +08:00
5f28adec36 add benchmark testing case for package gerror 2020-12-28 13:43:17 +08:00
c893817e56 Merge branch 'master' of https://github.com/gogf/gf 2020-12-27 00:12:34 +08:00
65785db659 improve Model.Data for shallow value copy for value type of map/slice 2020-12-27 00:11:26 +08:00
85a7723b13 Merge pull request #1084 from tiansin/master
feat: 🐛 fix GetWhereConditionOfStruct where AND
2020-12-25 20:36:54 +08:00
ac827d3154 revert default interval from 100ms to 50ms 2020-12-25 20:31:09 +08:00
95b09aa5fe feat: 🐛 fix GetWhereConditionOfStruct where AND 2020-12-25 16:03:01 +08:00
4e79b90863 add gutil.SliceToMap 2020-12-25 15:34:54 +08:00
306c02bcd4 fix issue for gfile.ReadLinesBytes, and improve callback function definition for gfile.ReadLinesBytes/ReadLines 2020-12-25 11:37:47 +08:00
fc66a0715a comment updates for package internal/empty 2020-12-25 01:44:07 +08:00
9c7aecf0fd Merge pull request #1058 from viken2/master
improve function empty
2020-12-25 01:38:33 +08:00
9f5a51e854 fix Strings/String function for package gvalid, issue:1077 2020-12-23 21:13:47 +08:00
a7f19e9e45 README updates 2020-12-23 20:23:11 +08:00
9b5862b61f README updates 2020-12-23 13:28:12 +08:00
176533e1a5 README updates 2020-12-23 13:26:33 +08:00
c243637d44 improve gstr.TrimStr/TrimLeftStr/TrimRightStr 2020-12-20 22:02:14 +08:00
7c52a6f9f6 ass SetCtx for ghttp.Request 2020-12-18 22:57:08 +08:00
446f8e7110 comment update 2020-12-16 01:15:22 +08:00
7db1cfa898 add gutil.MapToSlice/StructToSlice 2020-12-16 00:50:42 +08:00
9a6aa01115 constant name changes; version update 2020-12-15 20:16:17 +08:00
4a88e0255d improve shutdown feature for ghttp.Server 2020-12-15 19:24:38 +08:00
edc56949b7 improve package glog for rotation feature 2020-12-15 13:03:12 +08:00
63bc06d0fe improve package gview 2020-12-15 00:09:55 +08:00
9b58b66172 fix issue of HAVING statement before ORDER BY 2020-12-14 23:34:23 +08:00
3517295e96 improve package gcdm 2020-12-14 23:00:22 +08:00
c685876e6f improve package gparser 2020-12-14 21:22:04 +08:00
cb2c9c43a8 rename constant names 2020-12-14 19:34:02 +08:00
751a567e84 add Is* functions for package gvar 2020-12-14 18:54:14 +08:00
0a99bb9a7d improve gconv.Interfaces 2020-12-14 16:56:41 +08:00
a2e7aec37f change constant variable names 2020-12-14 13:26:48 +08:00
102e2d07d9 improve package gcfg for automatic configuration file type checks; change const variables for package gcfg/glog/gtimer/gmode/gins/gi18n 2020-12-14 13:02:08 +08:00
5400d22bc2 improve function empty 2020-12-12 21:57:07 +08:00
8d3fd21be5 Merge pull request #1 from gogf/master
merge master
2020-12-12 13:15:30 +08:00
bb39ed136f Merge branch 'fix/json' 2020-12-12 01:42:56 +08:00
363f6eba44 remove automatic stack content printing for error that has stack infomation 2020-12-11 01:12:53 +08:00
0ca305a1bf improve package gerror 2020-12-11 01:08:15 +08:00
1d1e64b834 improve package gerror 2020-12-11 00:45:15 +08:00
688e327f15 improve unit testing case for package ghttp 2020-12-10 23:38:59 +08:00
8c7ec0e7d9 Merge branch 'master' of https://github.com/gogf/gf 2020-12-10 23:33:43 +08:00
84fef8dea3 add error code feature for package gerror 2020-12-10 23:33:24 +08:00
c1d2ad68b3 Merge pull request #1051 from dozysun/master
fix InsertIgnore didn't work
2020-12-10 20:17:43 +08:00
a577605726 improve package gtimer 2020-12-10 20:10:07 +08:00
71444736ae fix InsertIgnore didn't work
fix InsertIgnore didn't work
2020-12-10 14:40:58 +08:00
b7e41ec32c improve package gvalid 2020-12-09 21:00:30 +08:00
7fa09596b0 improve package gsession 2020-12-09 16:22:03 +08:00
7316e6648f change errors to gerror; update copyright in comment 2020-12-09 16:04:29 +08:00
e9d346ce4f improve package glog 2020-12-09 13:54:27 +08:00
4b91e709f7 Merge branch 'master' of https://github.com/gogf/gf into develop 2020-12-09 13:48:50 +08:00
7de89286da Merge pull request #1045 from prcseraph/master 2020-12-09 13:48:33 +08:00
569a953b43 inprove package gconv for empty string converting to number array 2020-12-09 13:39:09 +08:00
1e7f795c69 remove package github.com/json-iterator/go 2020-12-09 01:38:56 +08:00
d2ae383b83 improve unit testing case for package gdb 2020-12-09 01:33:02 +08:00
8978112433 add gdb.Raw for raw sql instead of prepare argument feature 2020-12-09 01:29:23 +08:00
117eaea720 add support for cert and key file reading from resource manager for ghttp.Server 2020-12-09 00:06:56 +08:00
278e85357d * 日志根据大小切片时,文件重命名读写冲突。 2020-12-08 18:54:42 +08:00
60ec59fa4a improve package gsession 2020-12-07 20:39:52 +08:00
0aa82ad020 improve package gpool 2020-12-07 18:57:40 +08:00
7bd319ddc7 Merge branch 'master' of https://github.com/gogf/gf into develop 2020-12-07 13:19:42 +08:00
7ceb667486 Merge pull request #1040 from Wlvs530/master
Not Callback ExpireFunc In Pool.Get()
2020-12-07 13:18:48 +08:00
80c4786afd Not Callback ExpireFunc In Pool.Get() 2020-12-05 13:21:18 +08:00
2f741d3b24 add genv.SetMap 2020-12-05 00:06:03 +08:00
d2b65f0f91 add gcmd.GetWithEnv/genv.GetWithCmd; remove package cmdenv; 2020-12-04 23:44:54 +08:00
c226782f23 improve package gcmd,internal/cmdenv 2020-12-04 23:29:20 +08:00
57a82ebcc0 improve gconv.Struct 2020-12-04 18:17:11 +08:00
416885a726 gdb driver example updates 2020-12-04 15:42:35 +08:00
9b4d2d9172 fix issue in unit testing case for package gjson/gparser 2020-12-04 15:41:26 +08:00
d4b2bf20bb gdb driver example updates 2020-12-04 15:37:14 +08:00
ce9a0555c5 improve gconv.Interfaces by adding support for type map as its parameter 2020-12-04 14:33:47 +08:00
5171250a9d improve gutil.Keys,gdb.Model.Fields,internal/structs 2020-12-04 14:22:50 +08:00
80b629916a fix issue in function Clone for package gmap/garray/gtree 2020-12-02 21:38:29 +08:00
ecaf0da228 improve package glog; add more unit testing case for package gmlock 2020-12-02 21:33:07 +08:00
8c0a905a9f improve package gconv for custom type converting 2020-12-01 15:57:06 +08:00
5a0326f666 fix issue in unit testing case for package gconv 2020-11-30 09:07:44 +08:00
790a651ac1 fix typo 2020-11-29 23:55:32 +08:00
6f93bd17f2 add context feature for package gdb 2020-11-29 23:54:38 +08:00
3419d66c4b add context feature for package gdb 2020-11-29 23:50:16 +08:00
cabf684ec9 add context feature for package gdb 2020-11-29 23:47:57 +08:00
2b6e6ce28e improve update counter feature for package gdb 2020-11-29 22:26:16 +08:00
32101189a2 Merge branch 'master' of https://github.com/gogf/gf into develop 2020-11-29 21:46:36 +08:00
600c081801 Merge pull request #1028 from arieslee/gdb-counter
add update counter method for package gdb.
2020-11-29 21:46:17 +08:00
0899a9d49a Merge pull request #1027 from arieslee/gvalid-phone-loose
Add 172-segment verification rules, add loose mobile number verificat…
2020-11-29 21:45:28 +08:00
c56f4eabca inprove gconv.Interfaces for struct type 2020-11-29 21:34:28 +08:00
bfe89e0b12 add build-in fuction json for package gview 2020-11-28 22:48:01 +08:00
6cb38cfa92 add update counter method for package gdb. 2020-11-28 14:56:21 +08:00
09bb0c9397 更新gdb.Update方法 2020-11-28 13:52:17 +08:00
fa47b0306d Add 172-segment verification rules, add loose mobile number verification rules. 2020-11-28 12:23:18 +08:00
55429ad589 fix data race issue in unit testing case of package gdb 2020-11-28 00:11:22 +08:00
9592fb099f Change time string argument wrapping with TO_DATE function for DriverOracle in package gdb 2020-11-27 23:11:55 +08:00
18ec6116ad improve time argument timezone handling for package gdb 2020-11-27 22:51:34 +08:00
9d0f306684 improve time argument timezone handling for package gdb 2020-11-27 21:03:22 +08:00
3eba8d690f add TimeMaintainDisabled configuration for automatic time maintaining feature 2020-11-27 13:28:18 +08:00
c0b59007ce improve configuration for package gdb 2020-11-27 13:24:05 +08:00
3485ba2a5d improve package gtime 2020-11-26 22:40:55 +08:00
43ecfc7484 Merge branch 'develop' of https://github.com/gogf/gf into develop 2020-11-26 22:12:48 +08:00
5ba53e56c9 improve join feature for sub-query for gdb.Model 2020-11-26 22:11:58 +08:00
af1d14ace6 Merge pull request #1021 from tiansin/develop
fix: 🐛 fix model chunk page
2020-11-26 21:40:45 +08:00
c02bf715c5 improve gutil.ListItemValues/ListItemValuesUnique supporting retrieving values from slice attributes 2020-11-26 21:13:44 +08:00
0c0e902b07 if CreatedAt/UpdatedAt/DeletedAt field name configured, just use it, ignore the default field names 2020-11-26 20:17:24 +08:00
750b53d7aa improve debug infor for argument of time.Time for package gdb 2020-11-26 19:53:44 +08:00
1d807c095a Merge branch 'master' into develop 2020-11-26 19:28:25 +08:00
69b5873bf9 fix: 🐛 fix model chunk page 2020-11-26 14:26:32 +08:00
60fc9b6417 add gerror.ApiCurrent impements for gerror.Error 2020-11-25 19:06:29 +08:00
0bc8944a08 change ghttp.NewClient to g.Client 2020-11-25 16:40:45 +08:00
33292f54e0 improve status handler by supporting multiple status handler for package ghttp 2020-11-25 16:37:41 +08:00
fc215ef0b2 add function ghttp.RouterGroup.ALLMap 2020-11-24 21:19:01 +08:00
65c67427d4 compatible with Case of https://github.com/pkg/errors 2020-11-23 16:32:57 +08:00
bc8142974f version update 2020-11-21 14:08:29 +08:00
fadb7a8f8f fix issue 1002 2020-11-21 13:20:32 +08:00
e1bfe90833 improve package gdb for structire retrieving in transaction operations 2020-11-21 12:24:32 +08:00
042dc0b33f improve package gdb for structire retrieving in transaction operations 2020-11-21 11:42:50 +08:00
8ca535dbf0 fix issue in session cookie feature 2020-11-21 11:18:21 +08:00
e20183e7a1 improve gutil.Keys/Values for embedded struct 2020-11-20 00:53:12 +08:00
df86ffb61e improve package glog for nil file pointer 2020-11-19 20:43:44 +08:00
bfcf133c91 improve sqlite.Open 2020-11-19 20:37:27 +08:00
24a377d3a8 fix issue in custom mapping for gconv.Struct 2020-11-19 14:52:19 +08:00
baf51bc68f merge develop 2020-11-18 10:57:14 +08:00
5f4b585164 version updates 2020-11-18 10:52:53 +08:00
17a11187b0 fix issue in gdb.Model.Fields 2020-11-18 00:32:09 +08:00
7caf7976cf add gdb.Model.Args 2020-11-18 00:16:34 +08:00
1a31792c14 add SpecialCharsMapOrStruct for package ghtml 2020-11-15 16:49:44 +08:00
d56eb49e41 improve performance for gconv.Struct/Structs using directly reflect set 2020-11-15 15:13:40 +08:00
a1236b5e16 donator updates 2020-11-15 11:08:26 +08:00
8f278be0dc improve build-in varables for view of ghttp 2020-11-14 10:24:06 +08:00
f8ab71e7f0 Merge branch 'master' of https://github.com/gogf/gf 2020-11-12 20:52:23 +08:00
9cca3a3ec1 version updates 2020-11-12 20:51:04 +08:00
97bcf2a438 Merge pull request #980 from lutherlau/patch-4
Update garray_sorted_str.go
2020-11-12 20:44:48 +08:00
85dd2e9f4f Merge pull request #978 from lutherlau/patch-1
Update gtimer_timer.go
2020-11-12 20:39:57 +08:00
23d62da87f Merge pull request #981 from lutherlau/patch-3
Update garray_sorted_int.go
2020-11-12 20:39:44 +08:00
b4d947fecd Merge pull request #979 from lutherlau/patch-2
Update garray_sorted_any.go
2020-11-12 20:39:17 +08:00
650c95af31 Merge pull request #982 from lutherlau/patch-5
Update gtree_btree.go
2020-11-12 20:38:51 +08:00
943116d495 appaned parameters to url if http method is GET for ghttp.Client 2020-11-12 20:09:05 +08:00
644df7c16e Merge branch 'master' of https://github.com/gogf/gf 2020-11-12 18:58:05 +08:00
638773b216 improve client dump for package ghttp 2020-11-12 18:57:18 +08:00
889e7914e2 Merge pull request #983 from coolhihi/master
Update gjson_api_new_load.go to make gjson work when sometimes the xml end with space or `\n`
2020-11-12 18:41:36 +08:00
68cc85f2b2 improve file extension handling for package glog 2020-11-12 18:38:58 +08:00
c273ce576b add default configuration for MaxOpenConnCount for package gdb 2020-11-10 21:19:15 +08:00
f8d57096a8 add slice parameter support for gdb.Model.Where 2020-11-10 13:43:12 +08:00
d7542e87ae improve gdb.Model.Count 2020-11-10 10:37:42 +08:00
b178210a31 fix issue in gconv.Map for embedded struct attributes converting 2020-11-10 09:53:12 +08:00
3e6a23b0e1 add more unit testing case for package gview 2020-11-08 18:01:09 +08:00
ee8d2afe58 add build-in function map/maps for package gview 2020-11-08 17:11:04 +08:00
11e102e137 fix issue in internal/structs.MapField 2020-11-08 16:21:09 +08:00
e06b62ecf2 add default value from struct tag for ghttp.Request 2020-11-08 15:44:04 +08:00
d178102f82 remove third party package 'structs'; improve performance for package internal/structs 2020-11-08 14:25:17 +08:00
e1dd5cce7d improve performance for gconv.Struct 2020-11-08 00:06:05 +08:00
1edc1f35fb add individual cache for package gdb/gfile 2020-11-07 20:00:35 +08:00
4df47be521 Make it work when the xml content end with \s* 2020-11-07 18:32:50 +08:00
9cb88bca5a improve fields quoting for gdb.Model 2020-11-06 21:32:10 +08:00
fa8cc1d3f4 improve gutil.Keys 2020-11-06 21:21:09 +08:00
9ae8a7ca33 improve Fields/FieldsEx by adding support for map/struct parameters for gdb.Model 2020-11-06 20:52:16 +08:00
f4da179140 there should be WHERE statement in Update/Delete operations 2020-11-06 00:00:41 +08:00
13330658cb add function Keys/Values for package gutil 2020-11-05 23:32:56 +08:00
9f04e46166 mark gconv.StructDeep/StructsDeep deprecated 2020-11-05 23:02:29 +08:00
1072ea3fb0 Update gtree_btree.go
bugfix: avoid overflow
2020-11-05 22:44:09 +08:00
ea9e8055a4 Update garray_sorted_str.go
bugfix: avoid overflow
2020-11-05 22:42:15 +08:00
784abf2a30 Update garray_sorted_int.go
bugfix: avoid overflow
2020-11-05 22:41:43 +08:00
ed4a70deff Update garray_sorted_any.go
bugfix: avoid overflow
2020-11-05 22:37:36 +08:00
fef20d10a2 Update gtimer_timer.go
bugfix: avoid overflow
2020-11-05 22:33:33 +08:00
176dcdc7cc fix issue in gconv.Struct for json string parameter 2020-11-05 22:19:34 +08:00
12ed05f846 improva package internal/empty by adding more common types assertion 2020-11-05 20:40:34 +08:00
5999f22f76 fix issue in embeded struct validation for package gvalid 2020-11-04 20:04:54 +08:00
c056fd2a06 improve word quoting for function FieldsEx 2020-11-04 19:53:50 +08:00
cb422f043e improve slice converting for package gconv 2020-10-30 22:26:26 +08:00
4ae89dc9f6 improve package internal/structs 2020-10-30 22:04:34 +08:00
4f6f07db1d temporaryly remove guid.N 2020-10-30 14:31:31 +08:00
cd981c7294 improve snowflake number generating for package guid 2020-10-30 12:47:39 +08:00
557d2967fa improve snowflake number generating for package guid 2020-10-30 12:40:35 +08:00
a7a70636dd improve snowflake number generating for package guid 2020-10-30 12:33:56 +08:00
2215661f89 comment update for package guid 2020-10-30 12:24:18 +08:00
a22b590b43 comment update for package guid 2020-10-30 12:22:09 +08:00
1b0b209662 add unique number generating for package guid 2020-10-30 12:11:21 +08:00
2a2761c54f donator updates 2020-10-29 21:11:52 +08:00
1c83d72f39 donator updates 2020-10-28 23:54:40 +08:00
fcea774b59 donator updates 2020-10-28 23:34:19 +08:00
da2ec21571 fix issue 2020-10-27 10:41:18 +08:00
ebb8d8a2f7 fix issue in 2020-10-27 10:40:47 +08:00
9706a9c768 version updates 2020-10-26 21:20:34 +08:00
cee67a8d4e improve urlencoding handling for parameters posted along with file uploading 2020-10-26 20:21:09 +08:00
87650557fd remove debugging codes from package gtime 2020-10-26 19:06:27 +08:00
d3bf52f12f fix issue in unit testing case for package gi18n 2020-10-26 19:00:11 +08:00
6b13a4849b improve package gi18n 2020-10-25 17:33:14 +08:00
8e380c0d9d improve package gtime/gconv for map converting 2020-10-25 11:33:30 +08:00
0caf4bfcec improve gconv.StructDeep 2020-10-25 10:47:47 +08:00
9c3b978b50 improve package ghttp and internal/structs 2020-10-22 15:16:31 +08:00
ab689a7792 improve gutil.Dump 2020-10-22 09:24:57 +08:00
846646d92d improve json validation rule for package gvalid 2020-10-22 09:11:38 +08:00
2eb2b89432 improve gconv.Struct* by doing the converting using json.Unmarshal if given params is json string/bytes 2020-10-21 14:09:16 +08:00
43441a8218 allow custom validation rule validate empty or nil values 2020-10-21 00:08:36 +08:00
561a541fa1 add custom CreatedAt/UpdatedAt/DeletedAt filed name configuration for package gdb 2020-10-20 21:01:39 +08:00
ffe9ecc141 improve package internal/empty 2020-10-20 14:07:01 +08:00
77f7884604 add function gutil.Try/g.Try;improve error string for gconv.Struct 2020-10-20 13:36:43 +08:00
0a203d1e22 fix issue in struct converting for ghttp.Request 2020-10-19 11:29:41 +08:00
f4f4550483 improve package gerror 2020-10-18 20:18:55 +08:00
e87226a092 improve package gerror 2020-10-18 11:29:09 +08:00
391a3ec9bd version update 2020-10-18 11:26:19 +08:00
dd5cd31ef5 add automatic data key to field name mapping feature for package gdb 2020-10-17 18:16:13 +08:00
de92e804fe Merge branch 'master' of https://github.com/gogf/gf 2020-10-17 17:17:27 +08:00
7725d9aaaf add Current/Next function for package gerror 2020-10-17 17:17:10 +08:00
bd3e25adea Merge pull request #946 from yuancjun/patch-1
Update ghttp_server_config.go
2020-10-15 20:41:07 +08:00
0b1d49af4b upgrade fsnotify to v1.4.9 2020-10-15 20:14:35 +08:00
7efa9e351e remove default initialization function and add lazy initialization feature for package gfsnotify 2020-10-15 20:07:21 +08:00
0b0141954b Update ghttp_server_config.go 2020-10-15 18:04:32 +08:00
82b531fbfb add domain support for domain of ghttp.Server 2020-10-14 21:18:11 +08:00
67fb626339 add configuration SessionCookieOutput for ghttp.Server 2020-10-14 20:52:26 +08:00
9044d5f05d fix issue in custom session id lost for ghttp.Request 2020-10-13 20:34:31 +08:00
47663aa1f1 fix issue of EOF in ghttp.Request when no data posted using form-data 2020-10-13 20:12:54 +08:00
63c0aab19c improve package gtime 2020-10-12 23:32:32 +08:00
261216f5e4 improve structure sql for package gdb 2020-10-12 23:22:56 +08:00
f88b799d67 add more unit testing case for package gdb 2020-10-11 22:21:03 +08:00
9c48dd172c add auto-json support for slice/struct attribute for data inserting of package gdb 2020-10-10 17:29:38 +08:00
09ce105eee improve gdb.Model.Fields/FieldsEx for package gdb 2020-10-10 14:00:10 +08:00
651aa895f8 improve function addWordBoundariesToNumbers for package gstr 2020-10-10 13:38:28 +08:00
0509e41198 recover number for unit testing case of package gconv 2020-10-10 00:04:55 +08:00
1b40d6a53a do tx.Rollback if there's panic in gdb.Transaction 2020-10-09 23:42:33 +08:00
f9189d48d1 remove type ValueFunc from package gcache 2020-10-09 23:36:39 +08:00
849874a247 improve adapter definition for package gcache 2020-10-09 20:59:49 +08:00
3f6510bae7 fix issue in gconv.Struct 2020-09-29 23:47:37 +08:00
a585a26c39 improve custom rule function type for package gvalid 2020-09-29 23:25:20 +08:00
9943966a86 improva function formatSql for package gdb 2020-09-29 22:53:44 +08:00
3617e51c01 improve gdb.Model.ScanList 2020-09-28 23:52:02 +08:00
c931032f08 comment update for gdb.Model.Unscoped 2020-09-27 23:37:40 +08:00
37b286eaa4 improve performance for gconv.Maps;comment update for package gcache 2020-09-27 22:35:02 +08:00
619287c273 improve cache feature for package gdb 2020-09-27 00:15:11 +08:00
aeb9b68298 improve adapter feature for package gcache 2020-09-26 22:44:07 +08:00
bae8f6315b comment updat 2020-09-26 21:13:09 +08:00
a6f70f8935 comment updat 2020-09-26 21:00:28 +08:00
acca6f4009 add adapter feature for package gcache 2020-09-26 20:47:29 +08:00
727fdd2391 improve unit testing case for association feature for package gdb 2020-09-25 08:33:22 +08:00
1d174e00c0 improve package internal/intlog 2020-09-24 23:46:19 +08:00
a5e3e2f5ba change g.SetDebug function to control the debugging information for framework 2020-09-24 23:40:44 +08:00
da43c2d52f improve example for package gview 2020-09-22 20:12:34 +08:00
262f27748c improve custom validation rule feature for package gvalid 2020-09-22 08:45:22 +08:00
a29aef7e1c improve package gvalid for custom rule 2020-09-21 23:51:30 +08:00
1671391195 comment updates 2020-09-21 22:56:48 +08:00
28b0d59c61 improve package gcfg/gjson for data loading 2020-09-21 21:30:58 +08:00
86433cef25 improve gtime.New, gconv.String 2020-09-18 23:59:49 +08:00
e96ccd5f71 v1.13.6 2020-09-17 23:49:03 +08:00
50a087bb3d Merge branch 'master' of https://github.com/gogf/gf 2020-09-17 23:41:23 +08:00
1ec049c52f improve gf server for routes check while starting 2020-09-17 23:27:10 +08:00
ec38805542 Merge pull request #908 from cai1111/patch-2
Update gdb_driver_mssql.go
2020-09-17 19:23:25 +08:00
4c8517d075 Update gdb_driver_mssql.go 2020-09-17 11:06:24 +08:00
edf06da6ea add struct which implements Interfaces function parameter support for gdb.Model.Insert/Save 2020-09-13 11:21:10 +08:00
eb43a2040e add ghttp.Client.RedirectLimit and gfile.ScanDirFileFunc 2020-09-09 22:26:46 +08:00
9d0ecc7d3e add more unit testing case for package gdb 2020-09-07 20:25:59 +08:00
ad943c5e02 improve gjson.New by using gconv.MapDeep for map/struct 2020-09-07 19:44:11 +08:00
bdb4fd0d25 donator updates 2020-09-07 19:10:04 +08:00
2440e05457 fix issue in limit operations for database driver oracle 2020-09-03 22:38:07 +08:00
1337c6c0d1 add sub query sql support for join functions 2020-09-03 21:57:58 +08:00
957689e07c up 2020-09-02 23:22:16 +08:00
3952d74f87 up 2020-09-02 21:36:21 +08:00
6dc4b81693 add max recursive depth for directory scanning for function gfile.Scan* 2020-09-02 21:25:02 +08:00
9cd953b7be improve function FieldsEx by filtering fields from custom fields specified by function Fields for package gdb 2020-09-02 20:37:02 +08:00
631810dda2 add function String for package gmap 2020-09-02 19:53:58 +08:00
8c12bc5506 change panic to internal logging for package glog 2020-09-01 21:22:19 +08:00
d4091a4826 improve some transaction operations by directly calling model operations, making their implements logic the same 2020-08-31 15:57:04 +08:00
a7c269886b improve support for dynamic database configurations in codes 2020-08-31 15:39:27 +08:00
f54593037b improve CURD functions for package gdb 2020-08-31 00:59:42 +08:00
0415cf6a08 fix issue in nil gtime attribute for model entity for package gdb 2020-08-31 00:39:12 +08:00
87c22d32b0 version updates 2020-08-26 14:49:53 +08:00
27dd15b403 improve initialization for logger of package glog 2020-08-26 14:37:02 +08:00
dd452c19ce add example for custom uploading file name for ghttp.Server 2020-08-24 23:05:30 +08:00
acc0846cf3 fix issue in unit testing case of package gvalid 2020-08-24 22:26:12 +08:00
5a6738841f travis ci update 2020-08-22 00:21:24 +08:00
bea451c9d6 improve date type support for package gdb; improve datetime string for gtime.StrToTime; improve function gtime.New for more types 2020-08-21 23:41:12 +08:00
676e904ec6 improve package gvalid 2020-08-21 00:00:00 +08:00
49aa5c61bc improve package gvalid 2020-08-20 23:37:02 +08:00
a2272b852c improve package gvalid 2020-08-20 23:28:58 +08:00
1fa77630f9 improve package gvalid 2020-08-20 23:28:10 +08:00
a841c4cc05 improve package gvalid 2020-08-20 23:25:36 +08:00
1874808e3b improve unit testing case for package gcache 2020-08-19 21:37:26 +08:00
149b67916b README updates 2020-08-19 21:10:40 +08:00
7fb6f58162 README updates 2020-08-19 21:09:25 +08:00
a309114a18 donator updates 2020-08-15 21:58:03 +08:00
35cbde9530 comment update for package gstr 2020-08-15 21:28:24 +08:00
b9211b182a comment update for function ghttp.Request. 2020-08-15 12:35:56 +08:00
81ec499ae9 Merge pull request #867 from pingyeaa/master
Solve the problem of invalid modification of request parameters
2020-08-15 12:33:24 +08:00
f2e276eabd add function Test_Params_Modify for ghttp_unit_param_test.go 2020-08-14 20:02:52 +08:00
f6dbaba1f8 add function ReloadParam for ghttp_request.go 2020-08-14 18:34:43 +08:00
65dcff052a add function ReloadParam for ghttp_request.go 2020-08-14 18:19:48 +08:00
e3861567c7 add function ReloadParam for ghttp_request.go 2020-08-14 16:22:37 +08:00
e89a20c725 add ReloadParam func to ghttp_request.go 2020-08-14 15:19:56 +08:00
a8acc6bd28 update unit testing case for package gdb 2020-08-14 00:51:22 +08:00
eb5efc735e improve unit testing case of ScanList for package gdb 2020-08-13 23:45:22 +08:00
737af527cd improve *Struct functions for ghttp.Request 2020-08-13 23:29:00 +08:00
875d2b7e63 donator updates 2020-08-13 19:25:51 +08:00
bf1cb0e1bd donator updates 2020-08-13 19:23:31 +08:00
2bfeb1b06c README updates 2020-08-13 18:59:13 +08:00
820e4302b7 improve function *Struct for ghttp.Request 2020-08-13 18:51:59 +08:00
84d761b418 add function AddWithRecover for package grpool 2020-08-12 23:53:05 +08:00
e5e27f2ac4 add function GetRouterMap for ghtt.Request 2020-08-12 21:01:17 +08:00
efca9b18a8 improve content type checks for package gjson 2020-08-12 20:53:47 +08:00
607821ecbc add function LoadContentType for package gjson 2020-08-12 20:38:48 +08:00
7cc1b239d4 add functions Update/UpdateExpire/GetExpire for package gcache 2020-08-12 20:13:13 +08:00
efa8de34da Merge pull request #860 from XWR940711/master
add func gcache.SetVar/gcache.SetExpire/gcacge.GetExpire.
2020-08-12 19:19:19 +08:00
bcf45e3c5a CI-glog失败重测 2020-08-12 10:32:40 +08:00
0a3cd1d2ab 修正方法代码.使用Benchmark测试. 2020-08-12 09:57:47 +08:00
3e621856c8 change the port range for unit testing cases of ghttp.Server 2020-08-12 09:10:50 +08:00
32e4d64ddb improve package gjson for automatic content type checking 2020-08-12 00:11:25 +08:00
46e45ca84b improve package gjson for automatic content type checking 2020-08-11 23:46:21 +08:00
fcb13bd8ee improve package gjson for automatic content type checking 2020-08-11 23:36:40 +08:00
eacad9b453 improve package gjson for automatic content type checking 2020-08-11 23:22:09 +08:00
ed479e2a13 improve package gjson for automatic content type checking 2020-08-11 23:20:22 +08:00
19937cb75d improve MapDeep for package gconv 2020-08-11 20:13:47 +08:00
a95093222c add GetRemoteIp for ghttp.Request; add *Var feature for ghttp.Client 2020-08-11 15:23:42 +08:00
7b599d1882 Merge branch 'master' of https://github.com/gogf/gf 2020-08-10 23:04:28 +08:00
4d501fd2f4 improve function Set for package gjson 2020-08-10 23:03:35 +08:00
c3d3053ded improve GetOrSetFunc for package gcache 2020-08-09 21:28:31 +08:00
14d5fd3e11 add translation format feature for package gi18n 2020-08-08 16:46:52 +08:00
9f79453334 improve ghttp.Server by closing the request and response body to release the file descriptor in time 2020-08-08 11:09:58 +08:00
c7f1c881c0 Merge pull request #850 from coderzhuang/master
fix: Access-Control-Request-Headers
2020-08-08 09:59:45 +08:00
c39c032b4e Merge pull request #844 from qinyuguang/scan
gcmd.Scan supports read line that contains whitespace
2020-08-08 09:58:32 +08:00
fa96c18308 add function MapOmitEmpty for package gutil 2020-08-08 09:53:32 +08:00
d90145a47f add goroutine id retrieving feature for package gdebug 2020-08-08 09:42:24 +08:00
4871f86346 adjust TestCache_Expire_SetVar Test Code. 2020-08-07 16:26:26 +08:00
919eaf1e9a adjust TestCache_Expire_SetVar Test Code. 2020-08-07 14:05:21 +08:00
8a84ca16d1 add func gcache.SetVar/gcache.SetExpire/gcacge.GetExpire.
add test TestCache_Expire_SetVar.
2020-08-07 13:24:41 +08:00
12b4fdd692 fix: Access-Control-Request-Headers 2020-08-04 11:57:42 +08:00
3d8451d5d0 comment update for gdb.Model.Page 2020-08-04 09:22:21 +08:00
cf88f28519 gcmd.Scanf supports read line that contains whitespace 2020-08-03 21:00:02 +08:00
15d99eee46 add more unit testing case for ghttp.Server 2020-08-03 20:49:19 +08:00
6d68277db8 improve cookie feature for ghttp.Server 2020-08-03 20:00:00 +08:00
3e3b5557f7 readme updates 2020-08-03 18:58:43 +08:00
ba1a9d9f8e gcmd.Scan supports read line that contains whitespace 2020-08-01 02:13:42 +08:00
3e1a7953ec Merge branch 'master' of https://github.com/gogf/gf 2020-07-31 09:57:45 +08:00
073fb2d717 improve sql logging structure for package gdb 2020-07-31 09:57:26 +08:00
7f33021184 Merge pull request #825 from chenall/gjson-support-utf8-with-bom
fix configfile with UTF8-BOM issue
2020-07-31 00:08:05 +08:00
b396096721 improve dry-run feature by adding global dry-run variable reading from environment or command options 2020-07-30 23:08:27 +08:00
0a5c6d832f add configration group name for logging content for package gdb 2020-07-30 23:00:20 +08:00
d279566114 Merge pull request #769 from fxk2006/master 2020-07-30 22:55:39 +08:00
2693cbb136 add more unit testing case for ghttp.Server 2020-07-30 22:45:50 +08:00
f7a9be4292 improve package glog for rotation feature 2020-07-30 21:09:45 +08:00
a926033b66 move Separator from const to variable for package gfile 2020-07-30 20:57:08 +08:00
dbcdd06b19 Merge branch 'master' of https://github.com/gogf/gf 2020-07-30 20:49:32 +08:00
ff5dab5c70 improve package glog for rotation feature 2020-07-30 20:49:11 +08:00
84b576418f Merge pull request #835 from XWR940711/master
add func gtimer.Entry.Reset()
2020-07-30 20:20:50 +08:00
253b124903 fix issue in database configuration for package gind 2020-07-30 20:18:18 +08:00
33dc5ddf79 fix issue in database configuration for package gind 2020-07-30 18:52:27 +08:00
a456fa537c fix logger configure issue for package gdb 2020-07-30 17:16:29 +08:00
9e1fb93e08 adjust gtimer.Entry.Reset() Test Code. 2020-07-30 11:00:19 +08:00
5d24f702be adjust gtimer.Entry.Reset() Test Code. 2020-07-30 10:37:48 +08:00
ca8e2c2986 version updates 2020-07-29 23:19:59 +08:00
2f0e5a45c5 improve package gcron 2020-07-29 23:03:31 +08:00
c4b28b0bc4 improve gtime.ParseDuration 2020-07-29 11:44:58 +08:00
6cc4747965 add func gtimer.Entry.Reset() 2020-07-29 11:22:46 +08:00
91cd34b26a improve multiple seperator chars handling for router of ghttp.Server 2020-07-29 00:32:54 +08:00
e35a2f028c add timeout feature for Do/Receive functions of package gredis 2020-07-28 23:48:12 +08:00
9cff2bd10f add function ParseDuration and time unit 'd' support for package gtime 2020-07-28 22:46:15 +08:00
6d406498db improve result data type converting for package gdb 2020-07-28 20:31:50 +08:00
939ae37baf example codes update for package gdb 2020-07-28 19:55:13 +08:00
4d6c8744e5 upgrade mxj 2020-07-25 15:31:51 +08:00
e252d8b740 add function ListItemValuesUnique for package gdb 2020-07-25 15:05:08 +08:00
9b8d63e21b improve graceful reload feature for ghttp.Server 2020-07-25 14:09:03 +08:00
437fc04620 improve testCfg_With_UTF8_BOM unit_test 2020-07-25 14:07:33 +08:00
04dee090a3 improve graceful reload feature for ghttp.Server 2020-07-25 13:50:04 +08:00
245c6d24a1 improve ghttp.Client 2020-07-25 11:24:35 +08:00
e92fd05f9f Merge pull request #815 from tikrgo/camelcaseConvert 2020-07-25 11:07:51 +08:00
937f8e6919 fix configfile with UTF8-BOM issue 2020-07-25 10:57:40 +08:00
f489e6273e fix issue 819 2020-07-25 10:54:48 +08:00
4f99bdbc87 Merge branch 'master' of https://github.com/gogf/gf into camelcaseConvert 2020-07-24 09:49:53 +08:00
1250b33220 将正则移到全局提高效率 2020-07-24 09:48:51 +08:00
b57aee4595 Merge pull request #800 from chenghonour/master
Add database method
2020-07-23 21:30:24 +08:00
d9da51933d improve gconv.Struct 2020-07-23 21:15:54 +08:00
9fca93e7d8 Merge branch 'master' of https://github.com/gogf/gf 2020-07-23 21:01:37 +08:00
854b2ed185 improve function convertValue for package gdb 2020-07-23 21:01:16 +08:00
cfac03bc40 Merge pull request #814 from xbkaishui/support-redis-tls
support redis tls
2020-07-22 19:49:29 +08:00
a3cb4a6ae8 驼峰转换下划线时,不连续大写字母首位加下划线规范 2020-07-22 16:15:06 +08:00
2798fa4444 revert unit test 2020-07-22 15:27:00 +08:00
8bac0614f5 format code 2020-07-22 15:13:40 +08:00
646280a6a9 remove tls unit test case 2020-07-22 15:08:32 +08:00
208bdffdf7 update comment 2020-07-22 14:02:21 +08:00
9e7291903f support redis tls 2020-07-22 13:28:45 +08:00
d56835fc00 go fmt 2020-07-21 13:28:25 +08:00
1d5e717a80 update err return 2020-07-21 12:40:13 +08:00
2f44d9ae18 add unit test 2020-07-21 12:37:04 +08:00
0627ab81d6 Merge pull request #810 from chenall/master
fix ghttp_client upload filename issue #809
2020-07-21 10:52:39 +08:00
8167a398fc add function GetHeader for ghttp.Request 2020-07-21 10:17:31 +08:00
6291751014 fix ghttp_client upload filename issue #809 2020-07-21 09:57:13 +08:00
ee5ddaab52 fix place holder for pgsql 2020-07-20 22:47:12 +08:00
207476be1f Merge pull request #807 from tiancai45/master
fix issue pq: syntax error at or near $
2020-07-20 22:15:20 +08:00
b9b470c2ae Merge branch 'master' into master 2020-07-20 22:14:29 +08:00
52b6e8ef9d fix place holder for mssql 2020-07-20 21:55:34 +08:00
48c84bf74a fix place holder for mssql 2020-07-20 21:48:44 +08:00
5be30b3684 fix issue in logging file rotation 2020-07-20 21:32:28 +08:00
54a2b13825 Merge pull request #802 from csrgxtu/bug/log-file-rotate
bug/log-file-rotate: fix big file even with rotate-by-size and rotate…
2020-07-20 21:30:52 +08:00
d44ddae3dc debug postgre 2020-07-20 19:13:15 +08:00
7bbc2459ba postgre 报错 pq: syntax error at or near $ 2020-07-19 23:24:35 +08:00
0cb77caa2a Merge pull request #803 from housemecn/master
update tencent site
2020-07-18 10:40:18 +08:00
3f5f76458d Update README_ZH.MD
update tencent site
2020-07-18 10:36:48 +08:00
835e07e8de Update README.MD
update tencent site
2020-07-18 10:34:32 +08:00
3fc5e43abe readme update 2020-07-18 10:21:17 +08:00
9c8cb26bd6 readme update 2020-07-18 10:17:05 +08:00
540f4d2d0c donation update 2020-07-18 10:06:26 +08:00
51be255821 remove gfcache usage from repo 2020-07-18 09:44:15 +08:00
7d278fea25 users update in readme 2020-07-18 09:40:39 +08:00
ca72d3b23a remove gfcache usage from repo 2020-07-18 08:32:35 +08:00
534cd3be1c add table field method 2020-07-17 14:28:50 +08:00
78536de1b5 add database method 2020-07-17 11:28:47 +08:00
edc67d9ec3 bug/log-file-rotate: fix big file even with rotate-by-size and rotate-back-expire 2020-07-17 10:39:14 +08:00
4dd12434b7 add file cache feature for package gfile and remove package gfcache 2020-07-16 12:31:13 +08:00
f654bb2eda comment update for package gtree 2020-07-16 11:46:11 +08:00
205f98cfeb improve gconv.Struct for interface UnmarshalValue 2020-07-15 23:30:07 +08:00
69fa5bf464 improve package gtime for nil gtime.Time object 2020-07-15 20:37:13 +08:00
e7dc58ac6c unit testing case update for package gdb 2020-07-15 20:21:04 +08:00
2033299632 improve placeholder for pgsql 2020-07-15 20:15:09 +08:00
639d34d5d9 fix issue in incorrect debug sql information for package gdb 2020-07-15 20:10:54 +08:00
605181da32 fix issue in gins.Database 2020-07-15 19:17:42 +08:00
183f631190 improve Model.One for package gdb 2020-07-15 09:15:03 +08:00
64c99b9871 add configuration updating feature for package gcfg 2020-07-15 00:07:07 +08:00
d29b0a27ff Merge pull request #760 from kirileec/master
add a SetProxy function and a chaining function Proxy for ghttp.Clien…
2020-07-14 23:09:06 +08:00
aaa726e6dc add limit 1 for function One of package gdb 2020-07-14 21:42:28 +08:00
05cc0c4644 improve gconv.Struct for nil attribute interface 2020-07-14 21:34:29 +08:00
e1c0a92e60 improve the performance when converting struct that implements UnmarshalValue 2020-07-13 23:51:36 +08:00
c770e4779a Merge pull request #758 from wnstar/log
log added function name display
2020-07-13 23:21:49 +08:00
c135122ca1 improve package gconv for detailed handling of interface attributes 2020-07-13 23:13:50 +08:00
1d87df2afe add more unit testing case for package ghttp 2020-07-13 22:45:20 +08:00
8efc0ca0ea comment update for package gvalid 2020-07-12 10:33:24 +08:00
001d524ff7 readme update 2020-07-12 10:25:15 +08:00
5c5dce9dc3 comment update for admin controller of package ghttp 2020-07-12 09:56:07 +08:00
293256c2ca improve package gmode 2020-07-12 09:34:43 +08:00
4e027c1de3 improve argument handling for empty slice for package gdb 2020-07-11 09:53:16 +08:00
6712a33164 fix issue 785 in function Unique for packge garray 2020-07-10 22:26:02 +08:00
98531143a6 donator updates 2020-07-10 21:32:53 +08:00
71127ba308 improve package gins 2020-07-10 00:20:46 +08:00
0f6f571ccb remove the space trimming of the validation value for package gvalid 2020-07-08 20:53:56 +08:00
9b6936a4fb deprecate function DB.Table; improve the configuration node name case-insensitive and ignoring special chars 2020-07-08 20:48:29 +08:00
8b78609412 add more unit testing case for package gdb 2020-07-08 19:12:48 +08:00
4a31082f8c improve function Struct/StructDeep for package gconv 2020-07-08 11:32:35 +08:00
3643a69d8d improve function Struct/StructDeep for package gconv 2020-07-08 10:52:45 +08:00
adbaa4aa89 donator updates 2020-07-07 22:06:35 +08:00
0e025eda1b improve function Struct for package gconv 2020-07-06 22:37:37 +08:00
7c44bf8e94 Merge branch 'develop' of https://github.com/gogf/gf into develop 2020-07-06 21:18:51 +08:00
e6718f1113 improve function Struct for package gconv 2020-07-06 21:18:25 +08:00
f3f6adb03a read Client's timeout for net.Dialer
make sure Client.Transport is *http.Transport
2020-07-05 20:52:33 +08:00
977827e453 add examples for SetProxy function and Proxy chaining function 2020-07-05 20:52:33 +08:00
bcc9153991 add a SetProxy function and a chaining function Proxy for ghttp.Client to do HTTP request via proxy. #285 2020-07-05 20:52:32 +08:00
c04be14cd9 add custom validation rule feature for package gvalid 2020-07-05 18:55:38 +08:00
de8f29751d improve function ScanList for package gdb 2020-07-05 12:17:56 +08:00
12d58e4d08 add ScanList feature for gdb.Model 2020-07-05 11:54:37 +08:00
3ae44185f4 add ScanList feature for gdb.Result 2020-07-05 11:23:39 +08:00
1290f42f75 improving package gdb 2020-07-04 08:50:52 +08:00
17b91dcad7 add ListItemValues/ListItemValuesUnique functions and associated unit testing cases for package gutil/gvar 2020-07-02 23:40:34 +08:00
72da1642ee add more unit testing case for ghttp.Client 2020-07-02 19:12:01 +08:00
76d93b3a61 donator updates 2020-07-01 23:05:39 +08:00
7be0ee9566 donator updates 2020-07-01 23:02:07 +08:00
326e1f8da5 donator updates 2020-07-01 22:53:34 +08:00
e4e44ddd19 revert gvar.Var from interface to struct 2020-06-29 17:23:49 +08:00
46bdde9265 revert gvar.Var from interface to struct 2020-06-29 13:40:19 +08:00
09eba58927 add more unit testing case for ghttp.Client 2020-06-28 23:23:09 +08:00
0e884c78f5 fix issue of https://github.com/gogf/gf/issues/765 2020-06-28 23:03:41 +08:00
2f44721086 fix issue in reload feature in ghttp.Server 2020-06-28 20:52:33 +08:00
6e08eebcbe 修改sql打印debug信息,增加数据库配置的group名称,用于区分sql来源,尤其是多数据库配置的时候 2020-06-28 16:58:43 +08:00
d9422d00ac 修改sql打印debug信息,增加数据库配置的group名称,用于区分sql来源,尤其是多数据库配置的时候 2020-06-28 16:50:13 +08:00
efc0501548 Merge branch 'master' of https://github.com/gogf/gf 2020-06-22 21:56:29 +08:00
bb07c60838 rename CopySlice to SliceCopy for package gutil 2020-06-22 21:56:10 +08:00
330ea05ca3 Merge pull request #755 from wnstar/master
add SetRedirectLimit function to do HTTP client. #714
2020-06-22 21:21:05 +08:00
1f534b48a3 Merge pull request #757 from leoleoasd/patch-1
Fix typo in git ignore
2020-06-22 20:30:35 +08:00
aceae5eee3 add todo for package gpool 2020-06-22 20:08:27 +08:00
d4d66fd529 improve package gtime 2020-06-22 19:46:39 +08:00
b7686d6d37 log added function name display 2020-06-22 11:04:57 +08:00
Leo
b97e397354 Fix typo in gitignore 2020-06-22 09:41:02 +08:00
ab8fbf171e add SetRedirectLimit function to client 2020-06-21 19:17:39 +08:00
2c0cfa24b0 fix issue in package gjson for struct to map converting 2020-06-18 20:40:24 +08:00
f28a76d470 merge develop 2020-06-17 23:59:20 +08:00
f3525c84a3 fix issue in debug infor for soft deleting feature of package gdb 2020-06-17 23:47:47 +08:00
abe9b54112 embarrassing jsoniter of another incompatibility with stdlib json 2020-06-17 21:43:51 +08:00
b2aa59d893 import third-party library json-iterator to improve the performance for json operations 2020-06-17 21:16:25 +08:00
9e9865afa7 author updates 2020-06-17 18:58:24 +08:00
ecc439d4e8 author update 2020-06-17 14:44:16 +08:00
452f0fc99e add Scan/ScanDeep for package gvar 2020-06-17 11:40:37 +08:00
54f47845f6 entity feature developing for package gdb 2020-06-17 11:37:45 +08:00
cb238cd6d9 add todo for gconv.Convert 2020-06-16 20:44:57 +08:00
897a9f4584 Merge branch 'develop' 2020-06-16 20:42:26 +08:00
55f9b121de Merge pull request #738 from fxk2006/fix_SessionRedis 2020-06-16 20:41:53 +08:00
386f38af5e improve gconv.Struct 2020-06-16 20:18:40 +08:00
65cea430c2 improva gconv.Struct 2020-06-16 19:30:35 +08:00
4d38b508a3 improve gvar by changig gvar.Var from type struct to interface 2020-06-16 17:38:05 +08:00
5c774fd391 improve function Structs for package gconv 2020-06-16 11:37:00 +08:00
f6d760e90f 1、修复redis存储session时,最大过期时间问题: ttl.Seconds()返回float64在redis中报错 2020-06-16 11:19:08 +08:00
c3ffa40bad improve Response/ResponseWriter by implementing http.Flusher for package ghttp 2020-06-15 23:36:20 +08:00
5ce5d0e593 improve auto marshal for struct slice for package gredis 2020-06-15 23:19:38 +08:00
b83f1efde8 remove panic for stdout error for package glog 2020-06-15 22:57:27 +08:00
ca5f14c366 comment updates for package gtcp 2020-06-15 22:51:44 +08:00
95a8b51fb4 improve map slice converting for package gconv 2020-06-15 18:59:18 +08:00
2b64979730 Merge branch 'master' of https://github.com/gogf/gf 2020-06-15 16:48:17 +08:00
508cb7db88 add and improve Scan/ScanDeep feature for package gdb/gvar/gjson/gconv 2020-06-15 16:46:48 +08:00
e8d6d96883 fix issue in error field name lost for package gvalid 2020-06-14 17:28:48 +08:00
9378a6e7bf readme update 2020-06-13 16:22:49 +08:00
1d609fc5c7 fix issue in unit testing case for package ghttp 2020-06-13 14:52:36 +08:00
49d1e3dbaf fix issue of attribute name lost in package gvalid 2020-06-12 22:25:58 +08:00
b0e9334852 go.mod updates 2020-06-12 14:10:33 +08:00
95bd369959 improve function GetClientIp for ghttp.Request 2020-06-11 18:47:56 +08:00
a433890097 Merge pull request #721 from kuiye/master
add get client realIp
2020-06-11 18:45:42 +08:00
c9c3be517c fix issue in example of package glist 2020-06-11 18:43:35 +08:00
89e122cd31 marge getip func 2020-06-11 09:49:16 +08:00
27c2a03ea8 add example for package gset 2020-06-10 23:07:07 +08:00
b56eb3a948 example update for package garray 2020-06-10 19:50:22 +08:00
fb1b0bfd88 example update for package g/garray/gmap/gset/ghttp 2020-06-10 19:47:25 +08:00
dd10167ec2 example updates for package garray 2020-06-10 19:09:14 +08:00
3138ad10ec add get client realIp 2020-06-10 10:44:41 +08:00
080ca82605 release updates 2020-06-09 21:29:28 +08:00
0290de2360 improve dump feature for ghttp.Request 2020-06-09 20:46:04 +08:00
9b330adc1d Merge pull request #718 from sanrentai/master
improve mssql TableFields func
2020-06-09 19:04:56 +08:00
f3ff1ae08b improve example for package gmap 2020-06-09 16:24:54 +08:00
4f699af051 improve pointer type convertion for package gconv 2020-06-09 14:19:23 +08:00
7ebc7259cb improve mssql TableFields func 2020-06-09 14:02:43 +08:00
9d22edbdb8 donator updates 2020-06-08 23:08:58 +08:00
7e95058cb5 donator updates 2020-06-08 22:34:48 +08:00
f33753e0cd add example for package ghttp/glog 2020-06-08 20:21:35 +08:00
ac71e1d753 rename Dump to RawDump for ghttp.ClientResponse 2020-06-08 19:26:14 +08:00
8151b6efd6 add more example for package gredis 2020-06-08 19:17:24 +08:00
94de306c93 add zero time filtering for package gdb 2020-06-08 13:46:45 +08:00
51f8ea26de add example for package gredis 2020-06-06 18:12:42 +08:00
29d9bb17cd improve function Unscoped for package gdb 2020-06-06 16:28:16 +08:00
30501a882d improve function Struct for package gconv 2020-06-06 15:31:04 +08:00
f2f98e1d16 rename testing file names for package gdb 2020-06-06 14:38:05 +08:00
cbf465eeea improve body interface implements for ghttp.Reqest/Response 2020-06-06 13:34:58 +08:00
79c400e912 Merge branch 'master' of https://github.com/gogf/gf 2020-06-06 10:10:05 +08:00
cc4c49b5b0 add unit testing case for pointer attribute mapping for function Parse 2020-06-06 10:09:19 +08:00
96ea2c911d Merge pull request #696 from sanrentai/master
the sqlserver type money  should be converted to float64
2020-06-05 21:08:49 +08:00
131b11680a readme update 2020-06-05 20:36:05 +08:00
3c6ab96283 fix issue in function Walk and add more example for package gset 2020-06-04 21:46:22 +08:00
d2c4fa921a add more example for package gmap 2020-06-04 20:45:18 +08:00
dbb51a9328 improve package glist 2020-06-04 20:13:33 +08:00
55bfc3fa73 add more examples for package garray 2020-06-04 18:28:33 +08:00
d9c5182d1a gitignore updates 2020-06-04 17:56:32 +08:00
899fcbf2da add mor example for package garray 2020-06-04 17:55:43 +08:00
6e2c0d8706 comment and readme update 2020-06-04 17:29:16 +08:00
c4e599ce63 improve random bytes buffer hanlding for package grand 2020-06-04 14:45:56 +08:00
9cad9e4467 add more unit testing cases for package gstr 2020-06-04 00:03:30 +08:00
48019444ea README and DONATOR update 2020-06-03 23:49:12 +08:00
76d31a7fbb improve slice result handling by treating it as string slice for package gredis 2020-06-03 23:44:21 +08:00
facb9d93c0 fix issue of multiple slice arguments handling in function where 2020-06-03 21:36:16 +08:00
1d6bd46c5e README updates 2020-06-03 20:33:21 +08:00
8646dc1825 Merge pull request #702 from misitebao/master
更新 readme 中文版
2020-06-03 18:49:35 +08:00
2992bdeed7 修改之前的捐赠名称 2020-06-03 11:38:21 +08:00
c5601e6c88 更新 readme 中文版 2020-06-03 10:59:20 +08:00
ef1d9a561c improve the route feature for ghttp.Server 2020-06-03 00:09:51 +08:00
2d3b32c94a money 类型转换错误 2020-05-29 15:41:37 +08:00
269378aa0d fix issue in unit testing case for package gsession; version updates 2020-05-28 20:28:07 +08:00
6889542801 improve package guid 2020-05-27 11:26:05 +08:00
8e6f1f1740 improve performance of random buffer usage for package grand 2020-05-25 23:39:09 +08:00
b6ab1a992c improve empty checks for common interfaces implementer 2020-05-25 14:26:08 +08:00
a5a267567c comment update for package garray 2020-05-22 12:04:58 +08:00
f05f855c07 improve default max header bytes from 1KB to 10KB for ghttp.Server 2020-05-21 20:10:38 +08:00
bc5f773ba6 make WriteTimeout default to 0 for ghttp.Server 2020-05-19 19:16:47 +08:00
55308cc37c improve package gipv4 by formating the value retrieving fuctions to Get* 2020-05-18 23:50:31 +08:00
4d9db6edf0 improve package gconv for map converting 2020-05-18 20:58:19 +08:00
38111a64e3 improve files listing for ghttp.Server 2020-05-18 20:09:00 +08:00
bd8d3fca08 improve domain rule for package gvalid 2020-05-18 19:44:15 +08:00
89ccaa3915 improve function Do for package gredis, adding auto marshal feature for arguments 2020-05-18 19:18:53 +08:00
7c2cff7d99 add function GetVar for package gcache 2020-05-17 18:16:26 +08:00
788e15dbb6 comment update for package guid 2020-05-17 15:40:24 +08:00
a0172d9d7e README updates 2020-05-17 15:16:13 +08:00
bc1a7a1644 README updates 2020-05-17 15:11:07 +08:00
c98234d3e6 improve session feature by allowing custom session id creating function for ghttp.Server 2020-05-17 14:33:27 +08:00
45a94d23d5 improve session feature by allowing custom session id creating function for ghttp.Server 2020-05-17 14:33:21 +08:00
351de5ee6a fix concurrent issue in buffer handling of package grand 2020-05-17 12:46:28 +08:00
3559436d1e improve package guid 2020-05-17 08:50:37 +08:00
189f4c1637 improve package gsession 2020-05-16 22:08:16 +08:00
caead810e2 add package guid; improve performance of package grand 2020-05-16 21:56:31 +08:00
ebdc5d9c9d comment update for package grand 2020-05-16 16:08:30 +08:00
4164059211 add function B for package grand; improve package grand 2020-05-16 16:05:31 +08:00
bd27258c46 donator updates 2020-05-16 15:43:16 +08:00
ddf0605bc4 go mod tidy 2020-05-16 15:36:04 +08:00
991dbe50e0 add more functions for package gipv4; move package guuid to standalone package of gogf 2020-05-16 15:35:21 +08:00
8050efb835 improve package gfile 2020-05-16 14:06:35 +08:00
9355bc73a2 improve package gvalid 2020-05-16 13:31:24 +08:00
acc2a6a353 improve copy feature for package gfile 2020-05-16 00:50:01 +08:00
09e83e7b8d improve version functions for package gstr 2020-05-16 00:12:23 +08:00
c0df8a3d80 improve version functions for package gstr 2020-05-16 00:11:08 +08:00
33e890d225 improve version functions for package gstr 2020-05-16 00:10:12 +08:00
750e5df962 improve gstr.CompareVersion 2020-05-15 23:42:17 +08:00
74c65439fc add function ScanDirFunc for package gfile 2020-05-15 21:51:03 +08:00
f290bd7170 fix issue in http.File implements for package gres 2020-05-14 21:25:54 +08:00
d398b749d4 improve support for types of database pgsql 2020-05-14 21:15:44 +08:00
2fd5a1574a improve package gres 2020-05-14 20:32:01 +08:00
a7504f0629 add more unit testing cases for package gdb 2020-05-13 23:21:11 +08:00
3c35bb85ee improve unit testing cases for package gi18n/ghttp 2020-05-13 19:35:56 +08:00
6621edb04c improve i18n of chinese for package gvalid 2020-05-13 19:10:38 +08:00
b0c722e297 improve package gvalid 2020-05-10 22:34:16 +08:00
47a6284274 improve package gvalid 2020-05-10 22:32:10 +08:00
150b8edb70 improve package gvalid 2020-05-10 17:49:23 +08:00
aa5d3285eb improve package gvalid 2020-05-10 16:48:00 +08:00
993d6e3076 improve package gvalid 2020-05-10 10:56:11 +08:00
78ad9d8c2d improve error message of package gvalid 2020-05-10 09:05:52 +08:00
feff3ddce3 comment update for package ghttp 2020-05-09 19:19:42 +08:00
80fddad64d fix issue in PopRight function for package garray; improve json.Marshal for package garray 2020-05-08 21:08:06 +08:00
1e6dd0be02 readme updates 2020-05-08 19:16:52 +08:00
22ecf4f1b6 add context feature for package glog 2020-05-08 17:12:37 +08:00
5d21148657 comment updates for package ghttp 2020-05-07 23:05:33 +08:00
edb745ed92 version updates 2020-05-07 11:31:34 +08:00
61f4e0da6f improve package gcache 2020-05-06 21:09:02 +08:00
767afa3106 improve package gcache 2020-05-06 19:06:49 +08:00
16779359ee remove package gchan 2020-05-06 18:43:19 +08:00
770653fafa enable the route dump for unit testing of logging feature for ghttp.Server 2020-05-05 00:09:39 +08:00
0c021b6da7 add unit testing case of status handler feature for ghttp.Server 2020-05-05 00:01:09 +08:00
ec92b08f25 add function Maps for package gvar; add function GetMaps for package gjson; improve MapToMap* functions for package gconv 2020-05-04 23:42:51 +08:00
13e2353729 fix lock issue in function search for package garray 2020-05-03 23:08:18 +08:00
90d19a84ce improve package garray/gset, adding function ContainsI 2020-05-03 22:52:04 +08:00
b4c0b95d8a add support for old version of gres 2020-05-03 22:16:12 +08:00
b7e8255066 add support for old version of gre 2020-05-03 22:08:08 +08:00
5f8e6ad9ed comment update for package ghttp 2020-05-01 03:31:04 +08:00
c8d253eb56 change binary content from hex string to base64 string for package gres 2020-05-01 02:35:24 +08:00
4814624cff change binary content from hex string to base64 string for package gres 2020-05-01 02:16:42 +08:00
cc67f3d388 improve package gcompress 2020-05-01 01:47:02 +08:00
f7c2a51c9f fix issue in zip feature for package gcompress; improve package gres 2020-05-01 00:18:45 +08:00
3db83e1159 improve package gtimer 2020-04-30 22:22:35 +08:00
3bb002796c donator update 2020-04-30 20:46:27 +08:00
45170bc53e add ClientMaxBodySize configuration for ghttp.Server 2020-04-30 20:37:09 +08:00
b79ff84c6f add struct slice conversion for request parameters for ghttp.Request; improve package gconv 2020-04-30 16:53:47 +08:00
938c46fec9 readme update 2020-04-29 19:33:14 +08:00
8a13d94526 improve Record.Struct for package gdb 2020-04-29 09:12:13 +08:00
1e844d505a comment update for package ghttp/gconv; readme update 2020-04-29 00:14:29 +08:00
a123a2c086 improve struct conversion of empty result/record for package gdb 2020-04-28 21:03:25 +08:00
1eeeeb853e improve unit testing case of error logging for ghttp.Server 2020-04-28 15:21:17 +08:00
6e7224e306 improve error handling for gconv.Struct/ghttp.Server; add NewSkip/NewfSkip function for package gerror 2020-04-28 15:04:07 +08:00
9e064e2651 donator updates 2020-04-27 23:34:22 +08:00
8d9dd17eac add Walk function for package gset; improve fields handling feature for package gdb 2020-04-27 21:18:42 +08:00
cf1d3d3d2b improve package gdebug; add more unit testing case for package gdb 2020-04-27 17:56:04 +08:00
9480ffcdc0 improve function SetPath/AddPath for package gview 2020-04-27 17:07:00 +08:00
5db10add4a fix issue in unnacessary quoting of fields in select statement of gdb.Model 2020-04-27 16:30:53 +08:00
fa66bf5d9d improve cache feature of package gdb.Model 2020-04-26 21:31:55 +08:00
f69da3ace1 add function Transaction for package gdb 2020-04-26 17:47:19 +08:00
e01bfa05c3 listening ports change for unit testing cases of ghttp.Server 2020-04-26 17:13:48 +08:00
231238c157 improve parameter handing for ghttp.Request 2020-04-26 17:08:07 +08:00
7edec099ab improve raw request/response content dump for ghttp.Client 2020-04-24 00:00:52 +08:00
83eb8be064 Merge pull request #609 from kirileec/master
add Raw* method in ClientResponse to get request and response string
2020-04-23 22:58:04 +08:00
7af30df494 Merge branch 'master' into master 2020-04-23 22:57:23 +08:00
f026686fda fix issue in dupicated expiration handling in response cookies og ghttp.Client 2020-04-23 21:12:32 +08:00
35a50b9c6c readme update 2020-04-23 21:06:42 +08:00
010e2f951a downgrade the required golang version from v1.13 to v1.11 2020-04-23 20:38:25 +08:00
f7f86ad65a downgrade the required golang version from v1.13 to v1.11 2020-04-23 20:25:59 +08:00
1e19f447d1 improve ghttp.Client in context handling 2020-04-23 20:23:23 +08:00
8cc378331d add one unit testing case for ghttp.Server 2020-04-23 20:10:10 +08:00
4721f68fd8 add performance testing result 2020-04-23 19:51:08 +08:00
0d11c0a1f8 add performance testing result 2020-04-23 19:41:34 +08:00
5076613a8f add performance testing result 2020-04-23 17:25:11 +08:00
c5a44daa65 add performance testing result 2020-04-23 17:23:57 +08:00
520970b71f add performance testing result 2020-04-23 17:19:08 +08:00
ebfb08ee3f add performance testing result 2020-04-23 17:18:15 +08:00
9e38b2cb90 add performance testing result 2020-04-23 17:14:11 +08:00
71b1f00dc5 improve package gdb/gstr/gvalid 2020-04-20 22:36:28 +08:00
59d6830ab1 version update 2020-04-18 13:42:06 +08:00
8779a3f211 add function Walk for package garray; improve comment for package garray 2020-04-18 13:30:49 +08:00
c10149baa0 fix issue in stack trace for package gdebug; improve package gsmtp 2020-04-18 10:17:54 +08:00
4f87668780 improve retry feature for ghttp.Client 2020-04-16 15:43:21 +08:00
63f33d1d8c improve package gdb supporting gtime.Time parameter for Where condition 2020-04-15 18:02:32 +08:00
734aa5a6fe improve create_at,update_at,delete_at feature for package gdb 2020-04-15 12:56:41 +08:00
371aef224d donator updates 2020-04-15 11:41:44 +08:00
362e380ada improve SetConfigWithMap function for package ghttp/glog/gview; reveal some logger functions for default logger of package glog 2020-04-15 11:04:39 +08:00
e995bd8c9a add unit testing cases of https feature for ghttp.Server 2020-04-15 09:55:44 +08:00
81b211dd1a improve select operation details handling for package gdb 2020-04-15 09:37:46 +08:00
0515fc94cb add MapMerge/MapMargeCopy functions for package gutil; improve template view feature for indefinite parameters 2020-04-14 21:11:12 +08:00
46ee070f0a fix issue in package gfsnotify when gset changes 2020-04-14 00:20:39 +08:00
b17e3a6804 improve package gset 2020-04-13 23:44:43 +08:00
9160bee1af change comments 2020-04-11 12:16:53 +08:00
8e6018cfff improve soft deleting feature for package gdb 2020-04-11 10:14:49 +08:00
c08739b5a3 add function Having for gdb.Model 2020-04-11 10:11:52 +08:00
385a503d31 add soft deleting feature, improve chars handling for package gdb 2020-04-11 09:09:25 +08:00
ef286b0c15 add unit testing case for auto time and soft deleting features for package gdb 2020-04-09 22:48:21 +08:00
53aba2d4b8 add unit testing case of cache feature for package gdb 2020-04-09 22:00:02 +08:00
f22da4ba3a improve gconv.MapDeep with anonymous checks for attribute struct field 2020-04-09 15:34:23 +08:00
23c2f12672 improve MapDeep function for package gconv; improve gjson.New function for loading struct parameter 2020-04-09 13:37:27 +08:00
7fd53673ce add automatic time and soft deleting features: create_at/update_at/delete_at for package gdb; improve schema changing feature for package gdb 2020-04-08 21:26:14 +08:00
e64fd088b9 fix when no response 2020-04-08 20:11:06 +08:00
15672e7a09 #591 add Raw* method in ClientResponse to get request and response string 2020-04-08 19:24:03 +08:00
2ea1d2c7b2 update build-in template function substr/strlimit for package gview 2020-04-07 23:53:17 +08:00
90d751f98d add function SubStrRune/StrLimitRune/PosRune/PosIRune/PosRRune/PosRIRune for package gstr; remove unicode support in function SubStr/StrLimit for package gstr 2020-04-07 23:51:48 +08:00
25a91c732c improve String/Map converting for package gconv 2020-04-07 21:29:41 +08:00
01995f5501 improve function Marge for package garray using interface feature; improve slice converting using interface feature for package gconv 2020-04-07 21:25:52 +08:00
68abb3cf3d improve package glist for var initilalization feature 2020-04-07 20:58:58 +08:00
77cc323d0e improve package gset/gmap for initialization 2020-04-07 20:41:49 +08:00
c7a9c03495 improve package garray/gmap for initialization 2020-04-07 20:06:26 +08:00
f7850e3ed3 improve package garray 2020-04-07 11:29:42 +08:00
82125416a2 comment update for package ghttp 2020-04-06 22:31:45 +08:00
2c1e2155e3 improve function Server.Handler for package ghttp 2020-04-06 20:29:35 +08:00
2d30a53c3a remove function From for package gdb; add function g.Table; add ServeHTTP interface implements for ghttp.Server 2020-04-04 22:46:52 +08:00
ccceeae29c change third party package for yaml parsing to gopkg.in/yaml.v3 2020-04-03 19:51:33 +08:00
f22b98456f add default value of MaxActive configuration for package gredis 2020-04-03 15:18:35 +08:00
e7f1bd692b remove Content-Type header set in Response.WriteStatus for package ghttp 2020-04-03 14:16:26 +08:00
f82f7ab199 change default value of safe from false to true for gdb.Model 2020-04-03 10:16:57 +08:00
4d33b527b6 readme update 2020-04-03 09:32:04 +08:00
7bcc596308 add GetVar function for package genv; add DryRun feature for package gdb 2020-04-02 20:52:37 +08:00
be2d4b080e Merge pull request #601 from bdliyq/master
Get ghttp a chance to add custom host.
2020-04-01 19:55:25 +08:00
c96e5f5a9e readme update 2020-04-01 18:08:20 +08:00
3c23766674 readme update 2020-04-01 18:05:17 +08:00
718089fc11 Get ghttp a chance to add custom host. 2020-03-31 23:28:21 +08:00
8ab44dcb44 Get ghttp a chance to add custom host. 2020-03-31 21:50:15 +08:00
992522342c version/readme update 2020-03-30 23:56:26 +08:00
040898cdc3 improve unit testing case for package gmutex 2020-03-30 22:55:03 +08:00
343126ef22 fix usage for garray.PopRand 2020-03-30 20:56:00 +08:00
05760d1eac fix usage for garray.PopRand 2020-03-30 20:47:50 +08:00
c10f73f1f7 add zero time.Time filtering for omitempty feature of gdb.Model 2020-03-30 20:44:36 +08:00
7e0fa8e0cd improve package garray 2020-03-30 20:31:47 +08:00
6fe6218505 README updates 2020-03-29 20:23:10 +08:00
6059782de8 add unit testing case of basic auth for ghttp.Client; remove intlog for New function of package gspath 2020-03-29 19:36:49 +08:00
4844eea0ab add convenience function g.Client for ghttp.Client 2020-03-29 09:52:37 +08:00
8ecd62d3de add example for package gres 2020-03-28 21:32:29 +08:00
4c610b4f58 improve session storage file for ghttp.Server 2020-03-28 20:02:57 +08:00
1932c4ec44 Merge pull request #575 from wenzi1/master
Fix the bug of MSSQL paging
2020-03-28 19:59:31 +08:00
bd2e51ddca improve unit testing case for package glog 2020-03-28 00:47:34 +08:00
ddcb7121c1 improve temporary path producing from gfile.Join to gfile.TempDir 2020-03-28 00:41:12 +08:00
f1f575fd5c improve package gins/gfile/intlog 2020-03-28 00:37:23 +08:00
99adb7cdc4 comment update 2020-03-26 23:48:21 +08:00
6b7ea97777 improve quote handling of table string for package gdb; improve rotation feature for package glog 2020-03-26 22:25:43 +08:00
495b5758ec improve quote handling of table string for package gdb; improve rotation feature for package glog 2020-03-26 22:22:27 +08:00
ba56eb87b1 improve rotation feature for package glog 2020-03-26 20:58:57 +08:00
4258a3bbc9 improve StrToSize function for package gfile 2020-03-26 15:54:57 +08:00
4912331ddc improve mtime feature for gfile; improve rotation feature for glog 2020-03-26 09:29:36 +08:00
e87b7ecf5d improve unit testing case for package gfpool 2020-03-26 08:52:50 +08:00
23bce7bde6 reduce the goroutine count for unit testing cases of package gfpool/glog 2020-03-25 23:49:33 +08:00
926b664615 improve package garray for crossing border handling; improve rotation feature for package glog 2020-03-25 23:36:56 +08:00
fa8257c85b improve ghttp.Client 2020-03-25 17:13:05 +08:00
abb9c88c23 improve ghttp.Client 2020-03-25 15:17:18 +08:00
f89976cad5 improve ghttp.Client 2020-03-25 15:09:13 +08:00
0389778725 improve package glog for file lock 2020-03-25 00:03:52 +08:00
3c36285126 improve Model.Data function for package gdb 2020-03-24 20:58:11 +08:00
75054ee109 fix issue in rebinding feature for grou router of ghttp.Server 2020-03-24 19:48:10 +08:00
8447b1a42b add function LevelStr/StackWithFilter functions for package glog 2020-03-24 00:05:11 +08:00
e5265a1c46 add level string feature for package glog 2020-03-23 22:40:44 +08:00
6e8ef8d0b0 add level string feature for package glog 2020-03-23 22:36:06 +08:00
75c081afc9 fix issue of char '/' in URL.Path handling of ghttp.Server 2020-03-23 20:57:34 +08:00
060fd9eaba improve comment for package gdb 2020-03-23 20:44:20 +08:00
63e5a60344 improve package gdb 2020-03-22 23:26:15 +08:00
75dc1d82c1 example names change 2020-03-22 12:49:46 +08:00
a5e048eb5f example name changes 2020-03-22 12:34:12 +08:00
65bc1d5eb8 comment update for package gjson 2020-03-22 09:24:45 +08:00
bfa64705b5 update comment for package gsession 2020-03-22 00:15:59 +08:00
17aea8d7d4 improve unit testing cases by changing creating testdata path using gdebug.TestdataPath function 2020-03-21 23:47:33 +08:00
a6a01fd7f2 improve template cache for ParseContent function of package gview 2020-03-21 23:42:34 +08:00
41a9e91b4c improve example for package gpage 2020-03-21 23:13:31 +08:00
e2c1e11f95 improve package gjson 2020-03-21 21:32:02 +08:00
c2966817ce improve function gdebug.TestDataPath and update all usage codes 2020-03-21 19:41:05 +08:00
16958413bb improve autoencode feature for package gview 2020-03-21 19:31:58 +08:00
c0a0913d4b add more unit testing case for template feature of ghttp.Server 2020-03-21 13:45:33 +08:00
6d47810782 improve context feature for ghttp.Request; improve comment for package gjson 2020-03-21 13:32:43 +08:00
7a9ea2e546 improve context feature for ghttp.Request 2020-03-20 23:22:32 +08:00
7881b2dee4 improve unit testing cases 2020-03-20 22:34:56 +08:00
5f223ef049 Merge pull request #4 from gogf/master
update
2020-03-20 10:06:50 +08:00
e57942b374 improve unit testing cases 2020-03-20 08:56:17 +08:00
f18e6f078c improve unit testing cases 2020-03-20 08:49:40 +08:00
f667cbc2a2 Fix the bug of MSSQL paging 2020-03-20 00:33:20 +08:00
07e65c14a9 improve unit testing cases 2020-03-19 23:53:03 +08:00
0b6d04485e improve unit testing cases 2020-03-19 22:56:12 +08:00
36401a063d improve gutil.Dump, improve sqlite file searching when opening db file 2020-03-19 13:38:42 +08:00
849e7370d1 improve gutil.Dump, improve sqlite file searching when opening db file 2020-03-19 11:37:31 +08:00
f01dca0895 version updates 2020-03-17 22:36:05 +08:00
55137b2aa3 README, DONATOR updates 2020-03-17 22:35:09 +08:00
22540921b3 improve codes typing for package package gvalid 2020-03-17 22:23:29 +08:00
6174097a07 Merge pull request #3 from gogf/master
update
2020-03-17 22:11:51 +08:00
52de11b1fe Merge pull request #564 from arieslee/master 2020-03-17 22:08:31 +08:00
5a646179ad fix issue in limit...offset statement of postgresql for packagegdb 2020-03-17 21:38:49 +08:00
33ae93e050 improve CORS feature for ghttp.Server 2020-03-17 17:46:43 +08:00
f3d859159d improve router group for duplicated router registering for package ghttp.Server 2020-03-17 14:48:52 +08:00
4fb01e68f7 移除字符串ip地址与Long类型互转的方法,修改中文长度校验的方法 2020-03-17 14:26:36 +08:00
2812a247aa 添加验证中英文混合字符串长度的判断规则,按utf8计算,一个中文算一个字符,cn-length,cn-min-length,cn-max-length 2020-03-17 11:19:43 +08:00
2b46e765c4 change function time.Duration.Milliseconds to time.Duration.Nanoseconds for compatibility of Golang version < 1.13 2020-03-16 23:03:37 +08:00
c7f911cae2 change function time.Duration.Milliseconds to time.Duration.Nanoseconds for compatibility of Golang version < 1.13 2020-03-16 23:03:35 +08:00
9f0548c03d improve testdata directory retrieving for unit testing cases 2020-03-16 22:47:39 +08:00
c578df06a3 fix issue in unit testing case of package gfile 2020-03-16 20:51:19 +08:00
8ed3cf9c97 fix issue in unit testing case of package gcdg 2020-03-16 20:46:03 +08:00
2438f565e9 添加字符串ip地址与Long类型互转的方法 2020-03-16 11:18:06 +08:00
8230c72ec6 improve file uploading feature for ghttp.Request 2020-03-15 20:11:38 +08:00
d716037caa improve package gcfg adding default configuration file searching for instance 2020-03-15 19:56:07 +08:00
855a4ddb2c add file rotation feature for package glog; improve gpool/gfpool; fix issue in gfile.MTimeMillisecond 2020-03-15 19:32:29 +08:00
74be9fac18 add file rotation feature for package glog; improve gpool/gfpool; fix issue in gfile.MTimeMillisecond 2020-03-15 19:32:26 +08:00
e9fba5a166 readme updates 2020-03-14 17:15:25 +08:00
0a92df691b improve package gpool/gfpool; donator updates 2020-03-14 17:12:44 +08:00
e513cd10ed add Lock* functions for gdb.Model and improve Data/Where functions for gdb.Model 2020-03-13 17:21:30 +08:00
b702d98700 version updates 2020-03-12 10:05:38 +08:00
99f1d9d0ed improve package gudp 2020-03-11 23:59:43 +08:00
707b08c585 improve package gudp 2020-03-11 23:56:58 +08:00
f44c19868c improve package gudp 2020-03-11 23:54:35 +08:00
13ab139afc add more unit testing case for package gdb 2020-03-11 23:24:19 +08:00
cacb2f142b Merge pull request #548 from wenzi1/master
add Tables and TableFields method for sqlite
2020-03-11 23:18:59 +08:00
11f0317e92 add Array feature for package gdb 2020-03-11 23:17:41 +08:00
9a667c8803 add Tables and TableFields method for sqlite 2020-03-11 22:45:38 +08:00
c1cce17934 add unit testing cases for gudp 2020-03-11 16:08:17 +08:00
5a92d7de0d fix issue in router group registering for controller 2020-03-11 15:51:24 +08:00
53bf378868 Merge pull request #550 from fulltimelove/master 2020-03-11 15:07:30 +08:00
cd7c45c00c improve default connection pool configuration for gredis 2020-03-11 14:35:23 +08:00
f13a5ad82e 分组路由对象绑定时支持多方法绑定 2020-03-11 10:10:00 +08:00
2e9be609c8 fix issue in unit testing of gins 2020-03-11 09:22:13 +08:00
2f2f6e1ffe add Tables and TableFields method 2020-03-11 00:29:25 +08:00
f3bd2b67f7 change attribute Context to context.Context for ghttp.Request 2020-03-10 20:45:22 +08:00
645cecdffb improve template view instance initialization for instance of ghttp.Server 2020-03-10 20:13:36 +08:00
22e9965629 improve template view instance initialization for instance of ghttp.Server 2020-03-10 08:57:37 +08:00
24ea9f9245 Merge pull request #2 from gogf/master
update
2020-03-09 23:35:59 +08:00
9dbde6e8f1 change function HandleSqlBeforeExec to HandleSqlBeforeCommit for package gdb 2020-03-09 22:00:01 +08:00
fe0b34544d fix missing of pgsql driver support for package gdb 2020-03-09 21:56:53 +08:00
5e489d59b4 improve HandleSqlBeforeExec function for package gdb 2020-03-09 21:53:58 +08:00
61f49574a9 fix issue in unit testing case for gparser 2020-03-09 20:56:10 +08:00
2fabcb62a8 remove binary from git 2020-03-09 19:48:51 +08:00
3bc3b652c1 improve unit testing case for gjson 2020-03-09 09:00:38 +08:00
042a6f12f5 add map conversion support for result of HGetAll for package gredis 2020-03-08 23:16:06 +08:00
5acce82e63 add slice support for gconv.Map 2020-03-08 23:09:37 +08:00
4732bf46ad add Context map for internal context workflow parameter exchanges for ghttp.Request 2020-03-08 22:53:20 +08:00
5bed5a1532 improve unit testing case for driver feature og package gdb 2020-03-08 12:18:07 +08:00
5b7576430f improve unit testing case for driver feature og package gdb 2020-03-08 12:16:44 +08:00
356f4cd701 improve unit testing case for driver feature og package gdb 2020-03-08 12:04:24 +08:00
c444630d1e add workaround for package gdb for json infinite loop bug of Golang version < v1.14 2020-03-08 11:56:19 +08:00
8e40cded42 add custom driver feature for package gdb 2020-03-08 11:03:18 +08:00
0e52d467d3 improving package gdb 2020-03-08 00:17:42 +08:00
6665d62e7e improve package gfile 2020-03-07 20:28:00 +08:00
5bdf1a71b8 improve uploading file feature for ghttp.Server 2020-03-07 20:20:52 +08:00
a34ca0ff4b improve uploading file feature for ghttp.Server; improve package gfile/gstr/gdebug 2020-03-07 19:31:33 +08:00
7f0163d958 improve gconv.Struct* functions for custom types conversion 2020-03-06 23:22:08 +08:00
31f19b0eee improve package gcompress 2020-03-06 15:38:32 +08:00
93d0760898 add GetPage function for ghttp.Request 2020-03-06 11:01:03 +08:00
4863e7a6ae Merge pull request #529 from wenzi1/master 2020-03-05 22:02:16 +08:00
a161b44cc7 improve package gpage 2020-03-05 18:07:07 +08:00
7072244420 improve comment for ghttp.Server 2020-03-05 16:08:55 +08:00
f68b66e606 update comment for ghttp.Server 2020-03-04 23:32:27 +08:00
4e7c6c1fb4 improve CORS feature for ghttp.Server 2020-03-04 22:52:56 +08:00
d8a7e36478 improve router feature for ghttp.Server 2020-03-04 17:29:23 +08:00
8971ad8445 Add tables method of MSSQL, Oracle and PgSQL 2020-03-02 23:41:33 +08:00
270af8accb Merge pull request #1 from gogf/master
update
2020-02-29 22:46:00 +08:00
b0ef63fc9d improve bindArgsToQuery for surpport for pgsql/mssql/oracle for package gdb 2020-02-29 19:55:53 +08:00
6e1f8c3cfc version updates 2020-02-29 08:54:18 +08:00
e58d7e8dda add internal log for gi18n; improve unit testing case for ghttp.Server 2020-02-28 23:00:05 +08:00
3a3384cf06 Merge branch 'master' of https://github.com/gogf/gf 2020-02-27 17:09:44 +08:00
ef2a9f6fd1 fix issue in log paatern for ghttp.Server 2020-02-27 17:09:12 +08:00
63f756f731 Merge pull request #514 from kevinlincg/master
fix typo in gpool_bench_test.go
2020-02-26 23:38:33 +08:00
bb1c27c36a add more unit testing cases for glog 2020-02-26 23:26:24 +08:00
87cd0703c0 change internal log prefix from '[GF]' to '[INTE]' 2020-02-26 11:57:26 +08:00
6317d9de53 add ci for golang v1.14 2020-02-26 11:54:46 +08:00
7acf16fdba add UploadFile feature for ghttp.Server 2020-02-26 01:01:28 +08:00
a52b454d3e add UploadFile feature for ghttp.Server 2020-02-26 00:48:27 +08:00
816e075c52 add more unit testing cases for package garray 2020-02-25 23:19:37 +08:00
9882b361a8 add more unit testing cases for package gstr 2020-02-25 23:01:51 +08:00
4415dcf1c1 add HasPrefix/HasSuffix for package gstr 2020-02-25 21:03:07 +08:00
42fd583bfd add more inernal logging points for core components 2020-02-24 21:09:19 +08:00
c70bc7c96a improve pakage g/gins 2020-02-23 20:25:55 +08:00
02bd780a33 readme and donator update 2020-02-22 17:06:58 +08:00
24a2192ce2 README updates 2020-02-22 15:36:31 +08:00
d8ef8a1f5d add gf.debug options and GF_DEBUG env control params for internal logging feature 2020-02-22 14:51:44 +08:00
745a913cfb add FilterNil/FilterEmpty functions for package garray; add FieldsStr/FieldsExStr for gdb.Model 2020-02-22 14:26:36 +08:00
13dba407a2 fix parameter issue in benchmark of internal/rwmutex 2020-02-21 13:15:40 +08:00
34e7c5f809 rename grand.Str to grand.S; add different function Str for grand 2020-02-21 00:01:27 +08:00
d570624caa fix typo in gpool_bench_test.go 2020-02-20 09:01:09 +08:00
f18312419b improve CORS feature for ghttp.Server 2020-02-16 23:18:37 +08:00
89f869dd44 remove internal logging for gsession.StorageFile; improve example codes for CORS feature of ghttp.Server 2020-02-16 23:00:42 +08:00
20b64507b1 improve string conversion for gtime.Time 2020-02-16 22:39:12 +08:00
7443246e05 add gtime.TimeWrapper 2020-02-16 18:07:05 +08:00
f9e7823c14 improve configuration for package gdb 2020-02-16 16:36:39 +08:00
52943b283c go.mod updates; add search path configuration in file for package ghttp.Server 2020-02-16 16:34:30 +08:00
36403fdc08 improve configuration for mssql 2020-02-16 16:25:03 +08:00
0317f6812e add more unit testing cases for gtime 2020-02-16 15:11:21 +08:00
5169137069 improve unit testing case for CORS feature for package ghttp 2020-02-16 13:32:06 +08:00
7d9bccf912 README updates 2020-02-15 12:00:20 +08:00
14f56ea18f donator updates 2020-02-14 22:21:53 +08:00
1736d271d2 add more unit testing case 2020-02-14 22:13:41 +08:00
19755ad233 improve gcfg 2020-02-14 21:57:35 +08:00
cfdd043e4e add OctStr function for gstr 2020-02-12 10:48:15 +08:00
78917ed5cb comment updates for package ghttp 2020-02-11 10:00:10 +08:00
88684ca00a add panic if internal watcher creation fails for gfsnotify; improve codes and change comment from chinese to english for gdb 2020-02-10 20:37:53 +08:00
784983806a add InserIgnore feature for package gdb 2020-02-08 23:46:10 +08:00
cdb3b94e22 add NewWithTag function for gjson/gparser 2020-02-08 14:07:32 +08:00
83dcc4a5e0 fix issue for overwriting the route item if allowed 2020-02-08 11:17:09 +08:00
a6c0b281a3 add struct support for where condition statement of gdb 2020-02-07 20:58:47 +08:00
3120f24553 add struct support for where condition statement og gdb 2020-02-07 19:44:11 +08:00
ac9be6134b add global schema access support for mssql in gdb 2020-02-07 17:21:05 +08:00
4c1b4f7858 change time measuing unit from microtime to millitime for ghttp.Request; change graceful reload feature from true to false in default 2020-02-07 16:29:14 +08:00
1e45bf93d8 remove error printing when decoding error in communication feature of gproc 2020-02-06 19:21:17 +08:00
e8dd3979b6 add more unit testing cases for ghttp/gview 2020-02-06 15:17:10 +08:00
374ee4c0ea improve ghttp.Request for making the request body reusable for multiple times 2020-02-06 11:22:36 +08:00
95411aff77 improve ghttp.Request for making the request body reusable for multiple times 2020-02-06 11:14:38 +08:00
1999ef95c1 fix issue in gconv.Struct* functions panic when converting attribute value is nil 2020-02-05 22:06:24 +08:00
b15075fdfe fix issue in gconv.Struct* functions panic when converting attribute value is nil 2020-02-05 22:02:49 +08:00
4d2b244319 fix issue in gres.UnpackContent; fix issue in gtime.NewFromTimeStamp 2020-02-04 17:09:18 +08:00
4c3af63076 improve time string parsing for invalid datetime 2020-02-01 20:14:24 +08:00
91bbff6ced architecture updates 2020-01-23 15:04:12 +08:00
26aab44ec8 fix issue in char '-' support for parameter retrieving for ghttp.Request 2020-01-22 20:28:42 +08:00
2e10ce421b improve plugin feature 2020-01-21 22:18:49 +08:00
8eda69b11e improve the plugin feature for ghttp.Server 2020-01-21 17:18:03 +08:00
7d7b242968 Merge branch 'master' of https://github.com/gogf/gf 2020-01-21 15:42:19 +08:00
202419202f improve logger feautre, add unit testing cases for ghttp.Server; add SetDefaultLogger function for glog 2020-01-21 15:42:08 +08:00
55078beed1 Merge pull request #484 from chikaku/remove_redundant
Remove redundant code in gsession
2020-01-21 15:40:35 +08:00
d9f4e6eaa6 remove redundant code in gsession 2020-01-21 14:55:08 +08:00
2ba0913bea comment update for gtimer 2020-01-21 14:46:23 +08:00
8f2dcf21ff improve gconv.Map 2020-01-20 21:25:55 +08:00
01b06e0745 improve ghttp.BuildParams 2020-01-20 20:32:39 +08:00
665b5960c8 fix issue in minus number converting for gconv.Int 2020-01-20 20:18:24 +08:00
eb6a7a4728 add function UnmarshalValue feature for package garray/gmap/gset/gtype/gvar/gjson/gconv 2020-01-20 19:56:42 +08:00
7df53ff55e rename all timestamp function names from *Second to Timestamp* 2020-01-20 14:14:11 +08:00
8021f39710 version updates 2020-01-19 21:21:41 +08:00
f2af08270b improve gproc 2020-01-19 20:42:21 +08:00
c2f028848c readme updates 2020-01-18 22:35:07 +08:00
d9c7224861 readme updates 2020-01-18 22:21:37 +08:00
f59a1ada88 improve static service feature, add plugin feature for ghttp.Server 2020-01-17 21:12:52 +08:00
705ab1d33f improve garray; add RemoveValue function for garray 2020-01-17 19:48:50 +08:00
c07c4d7217 version updates 2020-01-16 21:26:34 +08:00
b867b2a0bc add return parameter name for function Cas of gtype;improve Response.Redirect* functions by adding optional parameter code 2020-01-16 21:04:28 +08:00
872d674182 fix issue in database 'time' type support in package gdb 2020-01-15 21:23:40 +08:00
4682abafdf fix concurrent issue in gdb.Model.Count 2020-01-15 10:38:02 +08:00
b7d194cf52 improva gcmd.Parser/gres 2020-01-15 09:36:58 +08:00
edf2366296 improve gzip feature for gcompress; add gzip compression for package gres 2020-01-15 00:15:56 +08:00
22af5be71f rename parameter name for gipv4.Ip2Long/Long2Ip 2020-01-13 14:50:06 +08:00
f662ff8051 add pprof unit testing case for ghttp; reame updates 2020-01-12 22:26:07 +08:00
8c51121b3b version updates 2020-01-11 10:40:13 +08:00
e9a0805801 add function Schema for gdb 2020-01-10 23:48:19 +08:00
afadbc6621 improve genv.Remove/gproc.Kill 2020-01-10 22:32:07 +08:00
ca546fc30b why the goland auto removed my genv import? 2020-01-10 09:39:54 +08:00
7c7c168c3d improve gproc.SearchBinary 2020-01-09 23:05:03 +08:00
16f0bb96db improve strict parsing feature for gcmd 2020-01-08 23:06:01 +08:00
33a899d32e add As function for gdb.Model; improve string quote handling for gdb 2020-01-08 21:24:33 +08:00
f3a208f02f fix issue in router value retrieving for ghttp.Request 2020-01-08 20:00:42 +08:00
81fd3d06bb make parser default unstrict for gcmd 2020-01-08 19:30:56 +08:00
9227139cf8 add schema changing feature for gdb 2020-01-07 22:14:32 +08:00
f2190e50b2 improve unit testing for gdb 2020-01-06 20:43:59 +08:00
c4537b4753 improve ghttp.Client.Get 2020-01-06 17:57:07 +08:00
167d58490b Merge pull request #455 from gnever/191229_gfile_add_readline_mst
Add ReadLines and ReadByteLines read file content line by line
2020-01-06 17:52:41 +08:00
d36aceb9f1 Merge pull request #463 from sth4me/patch-1
fix mysql debug time
2020-01-06 17:51:33 +08:00
eb31922124 fix mysql debug time
调试模式时间格式改为毫秒,原来是微秒.
2020-01-06 10:28:34 +08:00
bec9f5a847 add buildin function 'concat' for gview 2020-01-05 19:55:17 +08:00
506552c3a9 example codes update; donator updates 2020-01-04 17:19:50 +08:00
2bacc77224 improve JSON/XML parsing feature for ghttp.Request 2020-01-04 15:35:21 +08:00
bc53f265af improve gconv.Map/String 2020-01-03 20:23:10 +08:00
344f232c36 add Timestamp*Str functions for gtime; improve unit testing cases for gfile 2020-01-02 21:29:06 +08:00
27b677b0c0 improve Map converting feature for gconv; improve package gproc for local shell searching; improve JSON/XML response for ghttp.Response 2020-01-02 19:45:41 +08:00
a5a0e381bd add more examples for ghttp.Server 2020-01-01 16:45:43 +08:00
d528d7f5ab donator updates 2020-01-01 15:24:10 +08:00
821c71bd8d improve parameter parsing feature for ghttp.Request 2020-01-01 15:20:03 +08:00
604a10400d improve parameter parsing feature for ghttp.Request 2020-01-01 14:57:57 +08:00
9219471f67 improve parameter parsing feature for ghttp.Request 2020-01-01 14:26:00 +08:00
fe5d2e5685 improve parameter parsing feature for ghttp.Request 2020-01-01 14:18:00 +08:00
0a89daa513 add more unit testing cases for gdb.TX 2019-12-31 16:02:18 +08:00
d6e6ddf996 Add gfile.ReadLines and gfile.ReadByteLines read file content line by line 2019-12-29 19:24:56 +08:00
5dbda8aedc fix issue in unit testing codes in gfile 2019-12-29 14:15:17 +08:00
134e4cf28f improve gfile.CopyDir function; add Model function for gdb.Model 2019-12-28 13:55:05 +08:00
56a85abef7 add AutoEncode feature for gview 2019-12-26 11:03:59 +08:00
80c6ceaf26 fix issue 437 2019-12-25 21:22:06 +08:00
a10f428715 add Iterator* functions for garray; add ReplaceDir*/ReplaceFile* functions for gfile; remove gfile.Replace/ReplaceFunc functions 2019-12-25 20:56:39 +08:00
597f7468e9 fix issue in prefix feature for method operations of gdb 2019-12-23 23:14:54 +08:00
5db8851213 comment update for gtype 2019-12-20 23:23:50 +08:00
1d53d760d8 README/DONATOR update; improve ghttp 2019-12-19 15:38:34 +08:00
922e720d63 improve gdb/ghttp/gins; fix issue in gstr 2019-12-19 15:14:05 +08:00
50018773b7 add iterate example for glist; improve variable name for ghttp.Server 2019-12-18 19:45:46 +08:00
df99036d41 add iterate example for glist; improve variable name for ghttp.Server 2019-12-18 19:44:40 +08:00
ae0fa888f0 add iterate example for glist; improve variable name for ghttp.Server 2019-12-18 19:40:07 +08:00
18892fb66d add iterate example for glist; improve variable name for ghttp.Server 2019-12-18 19:37:07 +08:00
5f2be10563 improve gdb/gtime 2019-12-17 21:06:34 +08:00
a5a88222a6 gofmt 2019-12-16 22:51:17 +08:00
4facdd5c9e gofmt 2019-12-16 21:22:42 +08:00
76bc9bd385 improve gdb.Model 2019-12-16 21:00:16 +08:00
364452f3bb improve gdb.Model 2019-12-16 20:50:27 +08:00
4996755f11 improve gcmd.Scan* 2019-12-14 22:48:53 +08:00
e33230a88f add package gbuild 2019-12-14 17:01:27 +08:00
951ce46932 fix data race issue in unit testing cases for gtcp 2019-12-13 18:50:54 +08:00
795c7395e6 fix data race issue in unit testing cases for gtcp 2019-12-13 17:40:29 +08:00
27cf47bcd3 improve table prefix and quote feature for gdb 2019-12-13 15:25:49 +08:00
58a25c6f61 fix data race issue in unit testing of gtcp 2019-12-13 14:26:07 +08:00
2d754f80b1 fix data race issue in unit testing of gtcp 2019-12-13 13:43:28 +08:00
f4e8fbe767 fix issue in unit testing codes for gtcp 2019-12-13 08:57:39 +08:00
458318d374 improve prefix and word quote feature for gdb; merge develop 2019-12-12 23:54:07 +08:00
e3f54e1353 improve tag and field retrieving feature for internal/structs; comment update for gdb 2019-12-12 23:38:46 +08:00
4374996073 add some Must* functions for gparser/gjson/gmd5/gsha1/gbase64 2019-12-12 11:40:23 +08:00
87295ef1fe improve process communication feature for gproc; add more slice converting functions for gconv 2019-12-11 21:22:41 +08:00
81d4082b6a fix issue in Retry.Interval type changed for gtcp 2019-12-11 14:54:38 +08:00
d7e19bc3f3 improve package feature for gtcp 2019-12-11 14:50:25 +08:00
34ef0ea792 add prefix feature for gdb 2019-12-10 21:14:15 +08:00
2804834540 rename GetRouterMap to GetRouterArray for ghttp.Server 2019-12-10 12:28:55 +08:00
add7dd5a45 merge develop 2019-12-09 23:22:49 +08:00
e40894ca45 add IsServiceHandler for ghttp.RouterItem 2019-12-09 23:19:39 +08:00
28825f5395 add gdebug.BuildInfo function; improving gproc 2019-12-09 21:53:44 +08:00
6ca5141020 some improving 2019-12-08 22:55:32 +08:00
fe4f8e1810 version updates 2019-12-05 19:46:50 +08:00
671157cb70 release updates 2019-12-05 12:34:33 +08:00
f775479c3f fix issue in ghttp.Request.GetRequest* 2019-12-05 10:44:31 +08:00
64bb72842e comment update for unit testing case of gdb 2019-12-04 22:38:58 +08:00
e1d4ba9d23 add GetError function for ghttp.Request 2019-12-04 19:50:49 +08:00
a1edd83add README/DONATOR update 2019-12-04 18:48:13 +08:00
f7d6883405 fix issue in gredis for int set/get 2019-12-04 18:43:16 +08:00
8448a70646 change minimum go version from 1.10. to 1.11; travis ci updates 2019-12-04 17:50:03 +08:00
4018bfa899 travis updates 2019-12-04 17:36:31 +08:00
3cc9ce74e1 add IsEmpty function for gdb.Record/Result 2019-12-04 17:01:30 +08:00
eac60d845f go.mod updates 2019-12-04 16:27:19 +08:00
835c045c92 fix unit testing case for gdb 2019-12-04 16:21:35 +08:00
be15f85eae remove sql.ErrNoRows error for select functions for gdb; improve configuration feature for gdb/glog/gview 2019-12-04 16:04:52 +08:00
3e27ea0259 change duration parameter type from interface{} to time.Duration for gcache/gfcache 2019-12-04 14:42:09 +08:00
6abe660287 export router map api for ghttp.Server; comment update for ghttp.Server 2019-12-04 13:55:08 +08:00
a06ca31530 improve middleware feature for ghttp.Server 2019-12-04 10:03:03 +08:00
890865251b improve routerMap handling for ghttp.Request 2019-12-03 17:16:52 +08:00
6af90cafee rename ghttp.Domain.AddBindMiddleware to BindMiddlewareDefault for ghttp 2019-12-02 23:05:05 +08:00
2e2363bb41 change routergroup parameter name 'g' to 'group' for unit testing cases of ghttp 2019-12-02 23:00:48 +08:00
108ced2b0b improve route priority handling for ghttp.Server 2019-12-02 21:26:12 +08:00
fcba650348 add more unit testing case for gview 2019-12-02 20:27:21 +08:00
1b8a082942 change view configuration name from 'view' to 'viewer' in gins 2019-12-02 20:08:45 +08:00
40570cdb03 change logger configuration name from 'logging' to 'logger' in gins 2019-12-02 19:55:45 +08:00
10451864e6 improve parameter handling for ghttp.Requset 2019-12-01 21:41:29 +08:00
55e2646367 comment update for ghttp.Server 2019-12-01 21:05:46 +08:00
c88839edb1 comment update for ghttp.ServerConfig 2019-12-01 14:24:56 +08:00
2a2cfc289c improve ghttp.Client 2019-12-01 14:07:36 +08:00
8bbeb186c2 add Exit feature for ghttp.Response 2019-11-30 20:41:53 +08:00
be4bf39719 comment update for container 2019-11-30 18:33:51 +08:00
459c69839a comment update for container 2019-11-30 18:28:11 +08:00
a5407e57d9 comment update for ghttp.Client 2019-11-30 10:24:19 +08:00
5c749e7762 improve parameters handling for ghttp.Request 2019-11-30 09:42:07 +08:00
b3fafc64f8 improve parameter handling for ghttp.Request 2019-11-29 22:02:19 +08:00
c7b0763ab0 comment and unit testing case update for gdb 2019-11-28 23:51:05 +08:00
0cfdf60de5 change model default unsafe for gdb 2019-11-28 23:23:11 +08:00
096bff791d change model default safe for gdb 2019-11-28 23:21:27 +08:00
0cce858641 improve configuration feature for ghttp.Server/gview/glog 2019-11-28 23:19:37 +08:00
bb45d8d578 improve template cache feature for gview 2019-11-28 14:29:58 +08:00
7e43aa6b9d improve parameter parsing for ghtto.Request; add configuration feature for gview 2019-11-28 11:18:09 +08:00
4ee7c82bf1 fix issue in empty slice converting panic for gconv.Struct 2019-11-28 08:46:38 +08:00
85caa40a3d fix issue in empty slice converting panic for gconv.Struct 2019-11-27 23:38:33 +08:00
f4654bf446 fix comment issue in example codes for gmap 2019-11-27 23:19:07 +08:00
94ed0bf9c9 fix issue in ghttp.Request.GetView 2019-11-26 15:12:58 +08:00
22e3705d3e improve ghttp.GracefulServer; add more unit test case for ghttp.Server.Middleware 2019-11-26 14:56:05 +08:00
9b1cc6e9c7 add special handle for configuration of mssql for gdb 2019-11-22 19:45:42 +08:00
9429c8ff83 improve gd.Model.Clone 2019-11-21 22:21:57 +08:00
056c6d4688 remove Array type case from internal/empty.IsNil checks 2019-11-21 21:57:50 +08:00
382356bc8d improve gerror for stack information; fix issue in gconv.String for nil *time.Time type 2019-11-21 21:49:00 +08:00
1deb3510f0 improve gerror, ghttp for error stack logging; improve custom view feature for ghttp.Request 2019-11-20 18:45:09 +08:00
dd7ae1b07a unit test case updates for gdb 2019-11-20 13:36:31 +08:00
04a8755162 travis updates 2019-11-20 12:34:03 +08:00
682f99a763 travis updates 2019-11-20 12:29:34 +08:00
61282d6dab travis updates 2019-11-20 12:27:23 +08:00
ad540f7c25 update travis for adding mysql password; add custom view feature for ghttp.Response 2019-11-20 12:09:26 +08:00
a4f191c1c6 fix issue in gdb.Model for repeated condition statements; remove concurrent safety feature of gview; add default template file feature for gview 2019-11-19 21:50:17 +08:00
43531c2680 improve glog for debug configuration; add GetInt*/GetUint* functions for ghttp.Request 2019-11-19 17:26:06 +08:00
635f5d36fd improve log feature of ghttp.Server; remove trace for Notice/Warning functions for glog 2019-11-15 22:50:31 +08:00
1becc4932c add more functions for gtcp; remove default domain set for cookie feature of ghttp.Server 2019-11-14 15:41:28 +08:00
e36dd06f22 Merge pull request #342 from myvfpx/master 2019-11-08 23:45:48 +08:00
8f2c62d444 improve logging feature for ghttp.Server 2019-11-08 19:52:49 +08:00
21efde1a38 fix issue in session feature of ghttp.Server 2019-11-08 09:06:01 +08:00
d8b6466ed0 fix issue in ghttp.Server 2019-11-07 21:02:24 +08:00
d7b0228e9e add build-in function 'replace' for gview 2019-11-07 20:56:17 +08:00
9da1277b47 improve session of file storage for ghttp.Server 2019-11-07 20:42:13 +08:00
a3fd0c9a4a improve session of file storage for ghttp.Server 2019-11-07 20:36:33 +08:00
ad7375b44b improve configuration feature for ghttp.Server 2019-11-07 16:40:34 +08:00
05120b585d improve configuration feature for glog/ghttp.Server 2019-11-07 11:32:25 +08:00
9e32d74c8c improve ConfigFromMap function for ghttp.Server 2019-11-06 20:23:41 +08:00
0e62510c6f improve configuration feature, add instance feature for package glog; add package guuid for UUID feature 2019-11-06 20:22:20 +08:00
c492de4fa8 improve multipart form parsing for ghttp.Server 2019-11-06 15:37:29 +08:00
6308380541 update example for uploading files feature for ghttp.Server 2019-11-06 10:39:59 +08:00
2609db1aec improve file uploading feature for ghttp.Server 2019-11-05 19:47:35 +08:00
6c54e73dbd add example for memory storage og gsession 2019-11-05 17:33:06 +08:00
21abe62633 improve gfsnotify; add cache for tempalte file content 2019-11-04 22:42:49 +08:00
e30b2b0732 improve gsession/gmap/gtree 2019-11-04 21:26:16 +08:00
dcb74ee9df comment update 2019-11-01 20:36:09 +08:00
82bf21e831 improve gfsnotify 2019-11-01 15:31:26 +08:00
66355354fc improve gfsnotify/gview and container 2019-10-31 23:37:33 +08:00
4204125dce improve gipv4.IsIntranet 2019-10-31 15:13:34 +08:00
e6aa9d3a46 add EncodeFile/EncodeFileToString functions for gbase64 2019-10-31 14:42:01 +08:00
9416cd1274 add CopyMap function for gutil; improve ghttp.Request 2019-10-30 23:26:57 +08:00
8b5ab846b2 improve unit test case for gmutex 2019-10-30 23:01:24 +08:00
a15b93be90 comment update for package gtcp/gipv4/gipv6 2019-10-30 19:55:50 +08:00
38ee5f7d53 improve performance of gdebug 2019-10-30 15:12:19 +08:00
6f9bbbf416 add debug info for ghttp.Server 2019-10-29 20:15:13 +08:00
143bc3d8e3 travis updates 2019-10-29 20:02:28 +08:00
ea75b1a936 travis updates 2019-10-29 20:00:46 +08:00
0dde8c735e add debug info for ghttp.Server 2019-10-29 19:59:24 +08:00
1ab7f00b91 add FieldsEx function for gdb.Model 2019-10-29 19:45:21 +08:00
3ef42bfbf0 improve internal/intlog 2019-10-29 17:15:02 +08:00
05fec23457 improve internal/cmdenv 2019-10-29 17:13:29 +08:00
7225e49aa0 add package intlog for GF internal logging usage; improve redis storage feature for gsession 2019-10-29 16:45:42 +08:00
14e9deb254 add more unit test cases for gsession 2019-10-29 10:01:05 +08:00
f9569b387f add ConnectTimeout configuration for gredis 2019-10-29 09:49:29 +08:00
a0722ed51f add redis session support for gsession 2019-10-28 20:48:52 +08:00
e9ace9b17a update comment for grpool/glog 2019-10-28 17:16:50 +08:00
4791d10761 fix issue in hijack error for websocket of ghttp.Server 2019-10-28 17:01:08 +08:00
c686b1c080 improve datetime coverting for gdb 2019-10-28 16:42:30 +08:00
056d6ebbd9 improve interface design for gsession.Storage 2019-10-28 16:07:01 +08:00
baa2cb68de donator updates 2019-10-26 11:38:18 +08:00
e4909b318b Merge branch 'develop' of https://github.com/gogf/gf into develop 2019-10-26 11:03:17 +08:00
f1b7cb37c6 add configuration feature for glog 2019-10-26 10:58:07 +08:00
734728fa9c improve time handling for gdb 2019-10-25 19:54:02 +08:00
b373ace065 update comment for gqueue.Len 2019-10-25 17:32:03 +08:00
bc7b5c8626 fix issue in status checks for static file serving 2019-10-25 17:04:17 +08:00
f2b45622d6 add debug for domain group testing 2019-10-25 16:57:54 +08:00
77cb219057 enable route map printing for domain group testing 2019-10-25 16:44:54 +08:00
cf34d7bd56 fix issue in gconv.Interfaces; improve storage interface for gsession 2019-10-25 13:49:03 +08:00
5adc9be0d9 gofmt 2019-10-25 10:43:59 +08:00
58b2efc900 version update 2019-10-24 21:05:23 +08:00
28326606f5 fix issue in resource file handler for ghttp.Server 2019-10-24 20:22:37 +08:00
91c98bbb60 fix issue in group router feature for domain 2019-10-24 19:44:30 +08:00
63cd1128a7 Merge pull request #346 from danvinhe/feature-optimize_grand.Str 2019-10-23 22:51:58 +08:00
c0236d7dfa improve gstr.SplitAndTrim 2019-10-22 13:57:21 +08:00
d4051df5b6 improve gdb/gstr/gconv/garray 2019-10-21 19:13:25 +08:00
88045417ff fix issue in field type check for gdb 2019-10-17 20:57:49 +08:00
500efb5601 fix issue in template for ghttp.Server 2019-10-17 20:31:03 +08:00
97fe8235da fix issue in session expiring for file storage of gsession; add Pop/Pops functions for gset/gmap 2019-10-16 23:33:06 +08:00
e1164e935b improve configuration for gdb; add more unit test case for ghttp.Server 2019-10-15 21:20:38 +08:00
b26330aee1 rename cacheTime to cacheExpire and change its type from int to time.Duration for gdb.Model; fix issue in string support of function Data for gdb 2019-10-15 17:44:47 +08:00
2b083709b5 add gmap.ListMap/TreeMap support for gdb.Where 2019-10-14 23:27:48 +08:00
0ac45dc379 rename file name from link_map to list_map for package gmap 2019-10-14 22:43:31 +08:00
650916c22a version updates 2019-10-14 13:46:45 +08:00
2804183325 fix issue in content-type response for ghttp.Server 2019-10-14 13:46:16 +08:00
2dc2610621 improve gdb; README update 2019-10-13 23:05:48 +08:00
1736e71e6b add debug for unit test case of 2019-10-13 22:40:23 +08:00
69ee5375b9 improve Join/String functions for garray/gset/gmap; add AddIfNotExistFunc/AddIfNotExistFuncLock functions for gset 2019-10-13 22:31:28 +08:00
3ac0a66887 improve unit test cases for gspath 2019-10-13 21:42:04 +08:00
20e873a1fc version updates 2019-10-13 00:40:06 +08:00
142484d89c add support for like statement in map key for Where function, improve error format for gdb 2019-10-13 00:37:25 +08:00
76a9f4ca14 fix security issue in static file feature for ghttp.Server 2019-10-12 23:56:03 +08:00
c4e5679d5c fix issue in missing passing MaxIdle/MaxActive configuration to underlying redis pool for gredis; add extra output for unit test cases of ghttp.Server 2019-10-11 23:33:21 +08:00
b08d7c3c38 change Join function feature for garray 2019-10-11 23:17:29 +08:00
5092d8e6c5 improve status handling and add error logger for ghttp.Server; fix issue in defer error warpping for some packages 2019-10-11 22:54:25 +08:00
74d625ff97 add Get*Int32/Get*Int64/Get*Uint32/Get*Uint64 functions for ghttp.Request 2019-10-10 10:40:38 +08:00
f1119e28e8 add Get*Int32/Get*Int64/Get*Uint32/Get*Uint64 functions for ghttp.Request 2019-10-10 10:33:14 +08:00
3082c7f761 fix issue in StrLimit for gstr 2019-10-10 00:04:38 +08:00
5f36614dd7 remove UseNumber for json decoding in package gjson 2019-10-09 20:33:26 +08:00
1dcc7a4887 improve http status handling for middleware of ghttp.Server 2019-10-09 15:26:50 +08:00
41e9d35487 improve middleware feature for ghttp.Server; fix issue memory usage in big file downloading 2019-10-09 00:33:58 +08:00
977c8b7ee3 version updates 2019-10-01 17:54:29 +08:00
939e6244ee comment update for gtcp/gudp 2019-10-01 17:53:49 +08:00
e764b2393d change params order of Insert* functions for glist; improve gstr.IsNumber 2019-10-01 16:35:44 +08:00
6384e75ed9 improva container for json marshal/unmarshal interface 2019-10-01 16:03:18 +08:00
195cae6577 add new functions and mark deprecated for some functions for gdb 2019-10-01 11:29:02 +08:00
c8cf46a5a7 add Create function for gvar; add Uints/SliceUint function for gconv 2019-10-01 10:42:34 +08:00
eba97277b2 add more unit test cases for ghttp 2019-10-01 09:33:26 +08:00
4e19fbc5fb add separate put/delete functions for ghttp.Request 2019-10-01 09:06:35 +08:00
494b5bbae2 fix issue in unit test case for gvar 2019-09-30 17:30:24 +08:00
987ce709e5 add UnmarshalJSON for gtime; add ineterface MapStrAny support for gjson.New 2019-09-30 17:23:23 +08:00
35ad4d869f fix issue in cycle import for gtime 2019-09-30 15:51:15 +08:00
39d654e3f2 update comment for gtime 2019-09-30 15:26:32 +08:00
7fe9c641f4 add UnmarshalJSON func tion for gset 2019-09-30 14:37:05 +08:00
ee1414c010 add UnmarshalJSON func tion for gmap/gvar 2019-09-30 14:23:15 +08:00
8eb1b685a5 improve UnmarshalJSON function for garray 2019-09-29 22:16:36 +08:00
46768d6f91 add UnmarshalJSON function and corresponding unit test cases for package grray 2019-09-29 20:47:59 +08:00
bb6fed3dc2 add UnmarshalJSON function and corresponding unit test cases for package gtype 2019-09-29 20:12:59 +08:00
47e74d27bf add MarshalJSON function to implement the interface MarshalJSON for json.Marshal for gtype 2019-09-29 15:59:09 +08:00
b830f9b96d improve ghttp.Server.Request for parameter retrieving; add Option feature for gdb; update example for hook feature of ghttp.Server 2019-09-29 14:27:09 +08:00
c85162a8a0 improving gdb.Model/gmap 2019-09-26 20:01:48 +08:00
ef4e128af7 fix issue in cors 2019-09-26 15:54:13 +08:00
cce8ac5118 The 'letters' already contain numbers, so just grab characters randomly from this. 2019-09-26 11:00:59 +08:00
cb7c3a9fa4 fix issue in index folder feature for ghttp.Server 2019-09-25 10:56:44 +08:00
b0f859cc91 improve example codes 2019-09-24 23:41:18 +08:00
6d4da529ee add websocket unit test case for ghttp 2019-09-24 21:08:28 +08:00
6c7e536eeb fix issue in gbase64/ghttp 2019-09-24 20:39:00 +08:00
36c2648be8 improve ghttp.Response; move gflock to new repo 2019-09-24 20:19:18 +08:00
419b58452f 修改身份证尾数验证规则,新增银行卡号验证规则 2019-09-24 10:38:20 +08:00
b1835ea4e8 添加身份证号尾数验证规则,添加银行卡号验证规则 2019-09-24 10:21:37 +08:00
a876b6133d fix issue in unit test case og grand 2019-09-23 23:24:36 +08:00
03ff358da8 update ci/readme/donator 2019-09-23 23:08:58 +08:00
037f74c549 Create FUNDING.yml 2019-09-23 22:32:31 +08:00
a8caf4ad21 RELEASE updates 2019-09-23 22:00:04 +08:00
51d9fe5253 add AllowDomain option for ghttp.CORS; add IsSubDomain function for gstr; improve grand.Intn 2019-09-23 19:25:03 +08:00
3218c89f17 improve gfile/gstr/ghttp 2019-09-23 16:21:19 +08:00
02e467fb57 rename MapStruct* functions to MapToMap* for gconv and according packags 2019-09-19 23:23:41 +08:00
ec994f3080 add more examples of middleware feature for ghttp.Server; release updates 2019-09-19 21:17:54 +08:00
1181ab499c improve error handling in hook feature for ghttp.Server 2019-09-19 20:25:01 +08:00
5424935fd9 rename AddMiddleware to BindMiddleWareDefault for ghttp.Server; add more unit test cases fpr gstr 2019-09-19 20:19:07 +08:00
b9fbfb91bd improve middleware feature of ghttp.Server; add MapStrAny function for gmap/gtree 2019-09-19 19:44:46 +08:00
62f66b4fec remove unnecessary stack trace of gf for stack printing 2019-09-19 13:13:39 +08:00
eef9da9a41 improve parameters parsing for ghttp.Server 2019-09-19 09:09:12 +08:00
7d32be3b6c improve perameter parsing for ghttp.Server 2019-09-18 23:20:45 +08:00
c2ad9f5fb9 fix issue in gyaml for invalid decoding result of type map[interface{}]interface{} 2019-09-17 20:53:20 +08:00
4847fecdaa Merge branch 'master' of https://github.com/gogf/gf 2019-09-17 19:48:19 +08:00
f75383e0c5 fix issue in quote word for gdb 2019-09-17 19:45:51 +08:00
f683dccb6f Merge pull request #335 from LetMyPplGo/master
added tests for gsmtp
2019-09-17 10:44:15 +08:00
6fb106b618 added tests for gsmtp 2019-09-17 00:06:46 +03:00
97956ad903 version/release update 2019-09-16 23:07:57 +08:00
5d72a5b5ae improve gcmd 2019-09-16 20:57:43 +08:00
1d7ded562c add quote support for table named with '.'; improve case conversion for strings named with '.' for gstr 2019-09-16 17:15:39 +08:00
0d87b601cc fix issue in data filter for gdb.Model 2019-09-16 16:54:52 +08:00
33fbedffb8 gix issue in Config variable for ghttp.Response.View 2019-09-16 15:49:31 +08:00
2cfcbc82e1 RELEASE updates 2019-09-16 11:10:38 +08:00
e1721cb1b6 add package gmode for release mode management 2019-09-16 11:08:41 +08:00
1d264a6545 add package gmode for release mode management; add error returning for template rendoring for gmvc.View/ghttp.Response 2019-09-16 10:44:07 +08:00
565e48f6f1 add more example for package gres; RELEASE updates 2019-09-15 21:47:47 +08:00
2b20c77bc0 improve example for gi18n 2019-09-15 13:47:44 +08:00
1665d92136 improve session expire algorithm for gsession 2019-09-15 12:17:44 +08:00
f128cb9f61 improve session storage interface for gsession 2019-09-15 11:30:38 +08:00
6d55b30b39 add example for group router of ghttp.Server 2019-09-14 23:36:02 +08:00
953ea55899 improve status handling for response of ghttp.Server 2019-09-14 22:57:57 +08:00
966c93af00 improve middleware and error logging for ghttp.Server 2019-09-14 22:53:28 +08:00
41a0b52939 RELEASE updates 2019-09-14 00:43:06 +08:00
8281d9cdd1 improve gfile.MainPkgPath; update RELEASE.MD 2019-09-14 00:17:49 +08:00
b0ece3bd8f Merge branch 'master' of https://github.com/gogf/gf 2019-09-13 22:14:08 +08:00
19a856549a improve codes details 2019-09-13 22:08:18 +08:00
65bd31bb65 Merge pull request #316 from LetMyPplGo/master 2019-09-13 21:16:16 +08:00
a3830f0820 Merge pull request #326 from wenzi1/master 2019-09-13 21:15:22 +08:00
5f8656eb41 Merge pull request #332 from hailaz/master
improve dbBase.doBatchInsert()
2019-09-13 21:14:38 +08:00
141bee9c49 add ConfigByMap function for ghttp.Server; improve gsession for file storage 2019-09-13 20:49:16 +08:00
aa44c0fb11 improve session for ghttp.Server; improve i18n for gview 2019-09-12 00:00:59 +08:00
79e2d30849 improve gsession for file storing 2019-09-11 23:26:38 +08:00
e8a9c7ac72 update comments for package gaes/gdes; update function names for gdes 2019-09-11 23:22:15 +08:00
006054d13a fix issue in session for ghttp.Server 2019-09-11 22:57:29 +08:00
b39d653fe9 add package gsession; mv gkvdb to new repo 2019-09-11 21:19:45 +08:00
d9e7d4249f improve dbBase.doBatchInsert() 2019-09-11 16:48:00 +08:00
34ad4ae166 Merge pull request #7 from gogf/master
sync master
2019-09-11 16:40:27 +08:00
69684f5023 improve gredis instance initialization for gins 2019-09-10 20:38:23 +08:00
2ed1854f0c improve gres with file separator replaced to / 2019-09-10 14:21:11 +08:00
09da0f7388 improving gview with ghttp for controller 2019-09-09 23:02:40 +08:00
7f943c6b5f improving gview with i18n 2019-09-09 22:56:54 +08:00
ed3fc529ed Failed to return when Gini file grammar error
Failed to return when Gini file grammar error
2019-09-08 23:25:45 +08:00
2eb0511ef5 Failed to return when Gini file grammar error
Failed to return when Gini file grammar error
2019-09-08 23:24:00 +08:00
8bc1f457c7 Merge pull request #1 from gogf/master
update
2019-09-08 22:58:40 +08:00
77a727e1d7 improve i18n with gview 2019-09-08 21:12:11 +08:00
16cc3c0fca fix issue in gredis unit test cases 2019-09-06 18:08:58 +08:00
96106ace92 remove deprecated functions and fix corresponding unit test cases 2019-09-06 17:59:55 +08:00
13e528abb6 remove deprecated functions and fix corresponding unit test cases 2019-09-06 16:59:38 +08:00
0d5dfe59b9 remove deprecated functions 2019-09-06 16:44:40 +08:00
8fd88307f7 add errors printing when i18n files loading failed for gi18n 2019-09-06 15:43:57 +08:00
57244a9553 added the example for gsmtp 2019-09-06 01:18:41 +03:00
fb8aac38dd server address verification
simple Email address check for from & to
default port=25 for server address
2019-09-06 00:53:23 +03:00
8f953dabe5 fix issue in ghttp.Session.GetMap* 2019-09-05 23:48:54 +08:00
d63c2882fd update unit test case for gfile.IsEmpty 2019-09-05 20:18:49 +08:00
952eb7df15 add Scan/Scanf functions for gcmd; improve gfile.IsEmpty 2019-09-05 20:00:01 +08:00
dfc76ddb76 add IsEmpty function for gfile 2019-09-05 19:22:11 +08:00
b0cddc29e4 add more functions for gcmd 2019-09-05 15:16:25 +08:00
dfc61cb273 rename StrArray to StrArray for garray 2019-09-05 14:26:08 +08:00
05922e4f21 add more common types for package g 2019-09-05 14:25:20 +08:00
6cf4bf81e5 improve gcmd with arguments parser 2019-09-05 11:38:36 +08:00
ad43989944 improve procedure of ghttp.Server 2019-09-04 20:22:31 +08:00
31e7037e3e add example for session handling of ghttp 2019-09-04 20:12:29 +08:00
425d45e502 improve error text for session saving error 2019-09-04 20:04:04 +08:00
9ddb148fcb fix issue in memory usage of gkvdb in unit test cases of ghttp 2019-09-04 19:44:13 +08:00
e4d34abd7e fix unit test cases for ghttp/gres 2019-09-04 19:23:19 +08:00
16103c43eb fix unit test cases for ghttp/gres 2019-09-04 19:10:15 +08:00
7fad4b686c improve gcompress/gres for packing files 2019-09-03 23:18:54 +08:00
cd00ac446b improve CORS feature for ghttp.Server 2019-09-03 17:18:16 +08:00
e2906fba0b improve type conversion for gdb 2019-09-03 00:06:24 +08:00
acd5e72f6c improve gdb for configiration 2019-09-02 20:35:29 +08:00
8f1fd259d4 Merge branch 'master' of https://github.com/gogf/gf 2019-09-02 19:06:53 +08:00
d9041da426 Merge branch 'develop' 2019-09-02 19:06:01 +08:00
269ddb04af fix issue in gfile.Replace* 2019-09-02 19:05:32 +08:00
b1c2b9f4e0 improve gconv.Bool for NO/YES; improve gdb for model generation 2019-09-02 15:48:25 +08:00
7e9fe8ea98 improve resource feature in ghttp.Server 2019-09-01 22:22:08 +08:00
af81bf2bde Merge branch 'develop' 2019-09-01 22:14:45 +08:00
55addaa8ea improve gres and add more unit test cases for gres 2019-09-01 22:14:31 +08:00
6ccc4d119f improve export data as hex for gres 2019-09-01 21:34:15 +08:00
c05a91cdc9 README update 2019-09-01 00:31:15 +08:00
077d8b9f48 Merge branch 'develop' 2019-09-01 00:30:19 +08:00
15a6680833 add package gi18n 2019-09-01 00:30:01 +08:00
6c61704e60 adding package gi18n 2019-08-31 18:04:12 +08:00
cfa0b99cd8 README update 2019-08-30 22:19:50 +08:00
c0bb8bef06 README update 2019-08-30 22:15:54 +08:00
86f9d5c39d README update 2019-08-30 22:15:13 +08:00
33f2ae5fc4 fix spell issue of const names for gproc 2019-08-30 21:07:46 +08:00
ea1277d76c add case functions for gstr and according unit test cases 2019-08-30 20:51:23 +08:00
ee89a06b3e improve model feature 2019-08-30 20:29:12 +08:00
a31108e753 fix issue in gring/ghttp 2019-08-26 23:51:01 +08:00
2bf9bc98a7 improve gkvdb, container 2019-08-26 23:35:44 +08:00
d67975249c fix issue in unit test case for gkvdb 2019-08-26 22:54:59 +08:00
d3a2bef9ba improve debug sql with arguments auto bound 2019-08-26 20:57:37 +08:00
b7f67e3162 add StackWithFilter function for glog, and improve gdb/ghttp 2019-08-26 20:09:24 +08:00
1a20edc0b0 improving gdb and glog 2019-08-26 19:39:04 +08:00
f80ba1473e fix issue in stack skip feature for glog; fix issue in slice parameter for gdb 2019-08-24 23:08:17 +08:00
89a8203949 comment update for gpage 2019-08-22 23:30:28 +08:00
fd6321e71b update donator; update unit test case for gdb; fix issue in bool convertion for []byte for gconv 2019-08-22 23:24:45 +08:00
7dffd9d1ff add package gkvdb; add kvdb storage feature for ghttp.Server 2019-08-22 21:04:30 +08:00
51a156420d improve gres for empty path passed 2019-08-19 22:54:37 +08:00
c92323c681 gofmt 2019-08-19 22:42:31 +08:00
10e03eef3b add resource feature for gcfg 2019-08-19 21:02:44 +08:00
e151055521 improve resource feature for ghttp/gview 2019-08-19 20:17:13 +08:00
1f8408b622 improve gdb 2019-08-19 19:21:27 +08:00
98ddadb131 Merge branch 'master' of https://github.com/gogf/gf into develop 2019-08-19 19:09:48 +08:00
a5ac12545a Merge pull request #286 from wenzi1/master 2019-08-19 19:07:46 +08:00
e58384d815 update example for gres 2019-08-16 00:37:12 +08:00
ab381dacfe add resource feature support for gview 2019-08-16 00:29:14 +08:00
9162fde14a improve resource feature for ghttp.Server 2019-08-15 19:27:32 +08:00
6cf1714a07 improve resource feature for ghttp.Server 2019-08-15 19:20:39 +08:00
c402e17605 修改mssql中的datetime类型的处理 2019-08-14 22:44:57 +08:00
25746e9844 adding gres 2019-08-14 22:18:31 +08:00
a8a8dbeab8 adding gres 2019-08-14 22:16:33 +08:00
6113df2b3e adding gres 2019-08-14 22:03:52 +08:00
8f7363df41 删除mssql中的convertValue方法。
修改测试案例中的datetime类型的字段在查到数据后做转换
2019-08-14 19:16:45 +08:00
dafc79bf80 adding gres 2019-08-14 00:13:42 +08:00
9ae537cafc adding gres 2019-08-13 21:06:11 +08:00
162df6b250 fix issue in number overflow from int64 to int for ghttp.Session/ghttp.Cookie/gcache 2019-08-13 20:15:09 +08:00
12f28dfc95 improving gtree/gres 2019-08-13 13:45:01 +08:00
5d7d8abbde add oracle/mssql/postgres unit test cases 2019-08-12 17:12:16 +08:00
b960faec45 to support automated testing of postgres 2019-08-12 16:57:08 +08:00
9a057b757d add package gini 2019-08-12 16:53:07 +08:00
296c4b750b add oracle/mssql/postgres unit test cases 2019-08-12 16:50:57 +08:00
7ecc47e127 adding gres package for resource feature 2019-08-10 23:36:38 +08:00
d03180ff4d Merge pull request #284 from pibigstar/master
feat(travis): exit ci when test failed
2019-08-10 21:17:16 +08:00
c1c52b072e feat(travis): exit ci when test failed 2019-08-10 19:55:01 +08:00
72be3803ec update unit test cases for ghttp 2019-08-10 18:07:24 +08:00
5cb4a8557d fix issue for unit test case of gutil 2019-08-10 17:59:34 +08:00
7787135549 improve status checks if there're middlewares registed for ghttp.Server 2019-08-10 17:46:11 +08:00
56368500a3 add header support for session feature of ghttp.Server 2019-08-10 16:39:46 +08:00
846c6a579e improve ghttp.RouterGroup 2019-08-10 14:10:47 +08:00
573179060e improve gjson 2019-08-09 20:33:21 +08:00
fda345577a add package gdebug; improve gconv/gfile/gset 2019-08-09 20:05:36 +08:00
8387710473 fix issue in gset.Pop; improve internal/debug 2019-08-09 09:51:56 +08:00
3af3fd1428 fix issue in gset.Pop; improve internal/debug 2019-08-09 09:51:52 +08:00
c7c6e2866e add Unsafe* functions for gconv 2019-08-09 09:14:48 +08:00
7172ae0232 fix issue in invalid error stacks for glog; improve internal/debug and gutil for stack printing 2019-08-08 22:58:49 +08:00
4eac97a7d8 add Master/Slave functions for gdb 2019-08-08 17:43:21 +08:00
352e4c088a improve gcfg: it returns all values if pattern is '.'; add more functions for gcfg 2019-08-07 16:58:01 +08:00
4d5814fc43 improve grand 2019-08-07 16:21:31 +08:00
6d13b91d37 improve grand 2019-08-07 16:20:19 +08:00
0376c99b5a update unit test cases for ghttp 2019-08-06 23:10:37 +08:00
77d9e472b7 add middleware feature for ghttp.Server; improve router group feature for ghttp.Server 2019-08-06 20:40:04 +08:00
2911ebb5d7 add middleware feature for ghttp.Server 2019-08-03 23:57:20 +08:00
f4d01f56c6 add middleware feature for ghttp.Server 2019-08-03 18:08:10 +08:00
878305fee3 add middleware feature for ghttp.Server 2019-08-03 17:14:54 +08:00
0460a53f53 add middleware feature for ghttp.Server 2019-08-03 15:54:12 +08:00
e622f6aff2 improve gconv to support struct field of interface{} conversion 2019-08-01 19:53:28 +08:00
9e96a30ea2 update unit test cases for garray/gparser 2019-08-01 17:31:48 +08:00
d188fbdf5a improve gyaml with gopkg.in/yaml.v3; update unit test cases for gfile/gyaml/gtime/garray 2019-08-01 17:12:58 +08:00
06c16bf560 remove thirdparty diectory, add go.mod for package dependences 2019-08-01 14:07:25 +08:00
29ea9e3237 travis updates 2019-08-01 11:42:51 +08:00
b01add2925 update project structure 2019-07-29 21:01:19 +08:00
a98ad9577b improve gjson/gparser/gcfg/gvar 2019-07-29 20:37:49 +08:00
ef8351151d merge master 2019-07-29 20:03:23 +08:00
f6bb3c848e Merge branch 'master' of https://github.com/gogf/gf 2019-07-29 19:52:24 +08:00
3fd4cbbbfd add MapStruct/MapStructDeep/MapStructs/MapStructsDeep functions for gconv 2019-07-29 19:52:05 +08:00
b102e0dbc5 add unit test cases for ghttp.RouterGroup 2019-07-28 17:58:43 +08:00
1c0e8f77c8 Merge branch 'develop' of https://github.com/gogf/gf into develop 2019-07-28 17:40:56 +08:00
bebcb70b14 merge master 2019-07-28 17:40:11 +08:00
165602ae0a improve default instance name handling 2019-07-28 17:37:13 +08:00
a36e00efeb improve ghttp for session storage with redis server 2019-07-28 13:10:34 +08:00
bd4d273e1c improve ghttp for session 2019-07-28 11:50:12 +08:00
216a928861 add IsEmpty for gvar; add CompareVersion for gstr 2019-07-27 15:36:52 +08:00
a157c3f940 add Map/Contains/Build functions for genv 2019-07-27 14:40:22 +08:00
5a23459b23 update unit test cases for gfile 2019-07-27 11:41:12 +08:00
538b282f43 improve internal/debug,glog,garray,gfile 2019-07-27 11:34:04 +08:00
86f51f1e4a improve gfile 2019-07-26 23:01:12 +08:00
622f76d5fb improve glog/gmd5/gcmd 2019-07-26 22:33:49 +08:00
65e06b12ae improve dir list for ghttp; add ISO8601/RFC822 functions for gtime 2019-07-25 23:25:30 +08:00
b714f7db69 add *Bytes functions for ghttp.Client; improve gcmd/gfile 2019-07-25 21:01:04 +08:00
1063922682 Merge branch 'master' of https://github.com/gogf/gf into develop 2019-07-24 22:49:48 +08:00
2c6168129a improve gfile/ghttp for file serving 2019-07-24 22:48:43 +08:00
45465c1bd1 version updates 2019-07-24 21:49:25 +08:00
8acecc88f9 improve internal/debug, gdb packages 2019-07-24 21:21:08 +08:00
575349929b improve gcompress 2019-07-24 15:58:56 +08:00
3913a89434 add Replace function for gfile 2019-07-24 15:29:10 +08:00
1bc8c9e3e2 add UnZipContent function for gcompress 2019-07-24 15:05:02 +08:00
b4a0cca9c4 add Name function for gfile; add ZipPath/UnZipFile functions for gcompress 2019-07-24 14:48:16 +08:00
78b13ef4e1 concurrent safety updates for unit test cases for internal/mutex,internal/rwmutex,grpool 2019-07-23 23:40:57 +08:00
a49df101cd change default value from unsafe to safe for garray/gmap/glist/gset/grong/gtree/gjson/gparser 2019-07-23 23:20:27 +08:00
7ff4a00063 Merge pull request #250 from hailaz/master 2019-07-23 21:51:17 +08:00
2636f8acf1 improve skip checks for internal/debug 2019-07-23 13:50:38 +08:00
9042a885fa version updates 2019-07-23 10:17:30 +08:00
ef837bd9c6 add quotes for tx for gdb 2019-07-22 23:51:47 +08:00
6a76725d64 add quotes for fields and table name for gdb 2019-07-22 23:48:39 +08:00
697dbdc604 add unit test case for types 2019-07-22 23:03:55 +08:00
86f98f3710 fix issue in gqueue in closing channel for limited queue 2019-07-22 21:57:17 +08:00
470c696976 Comment updates for gjson 2019-07-22 21:20:38 +08:00
e61bd174c8 fix issue in gcfg for config content loading 2019-07-22 21:03:54 +08:00
c71b9bc122 fix unit test cases 2019-07-22 15:31:35 +08:00
c5339cbbe7 fix unit test cases 2019-07-22 15:10:40 +08:00
29020b0ac0 improve gconv 2019-07-20 16:41:17 +08:00
0a0530af0a comment updates for gcache 2019-07-20 13:17:38 +08:00
a5783ab860 improve unit test case for gdb.Tx 2019-07-19 14:13:11 +08:00
ae2de91b4c improve gcmd 2019-07-19 14:10:02 +08:00
ceecbef586 fix issue in unit test cases for gdb.Tx; improve gcmd; add gfile.SelfName function 2019-07-19 13:32:44 +08:00
2fa558b25f improve gjson 2019-07-18 20:06:42 +08:00
f465b478d6 improve gstr/gjson/gconv 2019-07-18 18:59:49 +08:00
a4abac4916 improve unit test cases for gdb; add more functions for gjson; improve ghttp.Response.WriteStatus function 2019-07-17 23:24:27 +08:00
9f9cb097d9 修复gvalid.CheckStruct()的msgs覆盖tag的msg存在的bug。 2019-07-17 20:07:43 +08:00
5ab64e31fd improve benchmark test cases for gset/glist 2019-07-16 20:45:57 +08:00
ac6a8b9b74 improve benchmark test cases for gmap 2019-07-16 20:30:10 +08:00
f43d252d08 improve style for stack output for glog/gerror 2019-07-16 19:49:21 +08:00
185f9efb9c remove third/golang.org/x/text/encoding 2019-07-16 18:52:50 +08:00
47d423036f improve gjson 2019-07-16 17:27:21 +08:00
7fae21f255 improve gjson 2019-07-16 17:11:01 +08:00
3fce835da0 improve performance for gjson.Load* functions; add GetQueryVar/GetPostVar functions for ghttp.Request 2019-07-16 16:23:03 +08:00
0b62ccf941 improve gmutex 2019-07-16 10:25:10 +08:00
f7c5d7fc7f gvalid补充修代码注释,移除错误的代码修改。 2019-07-15 21:14:46 +08:00
e484685282 improve debug feature for gdb; add skip support for file line print for glog 2019-07-15 19:54:13 +08:00
9c857705ff Merge branch 'feature_1.8.0' 2019-07-15 17:41:27 +08:00
76f680de33 fix issue in debug for gdb 2019-07-15 17:40:21 +08:00
1181b6ae3a add MarshalJSON interface implements for garray/gmap/gtime/gvar/gtree 2019-07-13 17:48:16 +08:00
8a7f4ab156 RELEASE updates 2019-07-13 17:18:48 +08:00
99d43a7ddc comment updates for gmutex 2019-07-13 16:56:20 +08:00
bd97d7d94e improve gmutex 2019-07-13 16:41:23 +08:00
73235f1967 修复gvalid多条数据校验时,规则key没有对应校验数据导致校验异常的问题。 2019-07-13 15:20:41 +08:00
1ebc8092a6 Merge pull request #6 from gogf/master
sync master
2019-07-13 14:30:34 +08:00
edd93c39a3 improve gerror 2019-07-13 14:24:44 +08:00
88c43d1772 Merge pull request #5 from gogf/master
sync master
2019-07-13 12:35:33 +08:00
a0a8eb4700 TagMapField改回调用MapField 2019-07-13 11:47:20 +08:00
28e5c33e81 comment updates for gdb 2019-07-13 11:35:22 +08:00
f24847576d 先移除新增的两个gvalid的test文件。 2019-07-13 10:52:02 +08:00
dfaf27e9e5 先还原对gvalid.Check()的修改。 2019-07-13 10:50:01 +08:00
32d5b28423 先还原对gvalid.Check()的修改。 2019-07-13 10:48:46 +08:00
0b8ca3313e 矫正gvalid.CheckStruct()字段别名记录的注释。
优化gvalid.CheckStruct()中属性的tag解析循环。
2019-07-13 10:47:52 +08:00
e6bb5e82a3 version updates 2019-07-13 09:57:40 +08:00
a24b97b004 Merge branch 'feature_1.8.0' of https://github.com/gogf/gf 2019-07-13 09:57:10 +08:00
08eeff7f1c RELEASE updates 2019-07-13 09:55:10 +08:00
769f31e69a RELEASE updates 2019-07-13 09:53:53 +08:00
cdf92b64d6 Merge pull request #4 from gogf/master
sync master
2019-07-13 09:22:12 +08:00
6d1ca028e7 fix issue in unit test case for ghttp 2019-07-12 23:20:36 +08:00
a228356399 RELEASE updates 2019-07-12 22:57:40 +08:00
3521f1b641 add more unit test cases for gdb for slice parameter feature 2019-07-12 22:37:49 +08:00
1dedf3d83b RELEASE updates 2019-07-12 22:33:34 +08:00
da4c01c011 Merge branch 'master' of https://github.com/gogf/gf into feature_1.8.0 2019-07-12 22:02:16 +08:00
9cd445ad40 improve gvalid tag for gvalid package 2019-07-12 21:37:48 +08:00
ff4ef7e240 Merge pull request #247 from 2892931976/gf-chj 2019-07-12 21:02:19 +08:00
4de574ee86 auto create struct for ghttp.Request.GetToStruct 2019-07-12 20:56:45 +08:00
0481b4025b gvalid test 20190712 10:20 2019-07-12 10:23:28 +08:00
9495b858fd RELEASE updates 2019-07-11 21:28:06 +08:00
5576adbd0b update ghttp. 2019-07-11 19:47:15 +08:00
b8da86bce8 Merge pull request #243 from iReadX/dev 2019-07-11 19:45:49 +08:00
a926d3dadd merge master 2019-07-11 19:06:32 +08:00
a95624ab19 add big-endian support for gbinary; improve gdb for bit type support 2019-07-11 18:58:31 +08:00
cf745422f3 Fixed use cname in gvalid tag.
Added gvaild data type support for array, slice, map.
Added array, slice, map data test in gvaild unit test.
2019-07-11 15:41:10 +08:00
10e042454c fix issue in bit type conversion for mssql in gdb 2019-07-11 15:41:06 +08:00
yc
759be06ebc Function BuildParams add 'UnUrlEncode' param, default false. 2019-07-11 10:02:44 +08:00
aea37272ea merge master 2019-07-10 23:16:39 +08:00
2f17d37f7b add v tag for gvalid; add p tag for ghttp; add c tag for gconv 2019-07-10 23:04:04 +08:00
df8623c4e2 Merge pull request #3 from gogf/master
sync master
2019-07-10 10:30:21 +08:00
5c9766fb1b Merge pull request #235 from jroam/master 2019-07-09 21:04:37 +08:00
a3d2e03425 merge master 2019-07-09 15:49:09 +08:00
717dae8f5d improve unit test cases for gpool 2019-07-09 15:41:50 +08:00
373dbde42c version updates 2019-07-09 15:36:04 +08:00
125af33941 gvalid and gfcache test 20190709 15:06 2019-07-09 15:10:02 +08:00
b43e36a79d improve configuraion style for gdb 2019-07-09 15:08:26 +08:00
145fccdf6e improve configuraion style for gdb 2019-07-09 14:50:56 +08:00
f9c478f250 improve package feature for gtcp 2019-07-09 14:03:43 +08:00
5da822fdc4 add some garray unit tests 2019-07-09 13:41:38 +08:00
5abf1b5742 Merge branch 'feature_1.8.0' of https://github.com/gogf/gf into feature_1.8.0 2019-07-09 13:27:34 +08:00
9ac3841342 add time.Duration parameter support for gfcache 2019-07-09 13:19:28 +08:00
1f315c5b8d add time.Duration parameter support for gcache 2019-07-09 13:15:53 +08:00
b9440587d0 add Offset function for gdb.Model; improve schema changing feature for gdb 2019-07-09 12:50:38 +08:00
835a971f89 add slice parameter support for method operations for gdb 2019-07-09 12:04:24 +08:00
0bba2092af add one slice passing all parameters support for gdb.Model.Where 2019-07-09 11:34:45 +08:00
c3240218f8 merge master 2019-07-09 11:11:49 +08:00
9e392985b8 Merge branch 'feature_1.8.0' of https://github.com/gogf/gf into feature_1.8.0 2019-07-09 11:11:03 +08:00
a7d30dd1d5 improve gfile 2019-07-09 11:02:33 +08:00
fa96d881e1 Merge pull request #232 from skiy/feature-filecopy 2019-07-09 10:55:11 +08:00
9ca9d6c4bd add Cause function for gerror 2019-07-09 10:40:26 +08:00
7ad66db491 README updates 2019-07-09 10:27:47 +08:00
1dbda3872b README updates 2019-07-09 10:25:59 +08:00
3619a46f52 README updates 2019-07-09 10:23:25 +08:00
6a93d166c5 improve gjson/gparser/gvar/gcfg with adding more converting functions 2019-07-09 09:43:53 +08:00
c84e62febe add morte unit test cases for gdb.Model 2019-07-09 08:47:23 +08:00
8ff21d6936 adding support of slice parameters for gdb.Model.Where 2019-07-09 08:40:28 +08:00
3b0012ec30 fix issue in gbase64.Decode 2019-07-09 08:07:50 +08:00
62a3f1693d add some garray tests 2019-07-08 23:25:47 +08:00
ed6796dde0 Update garray_z_unit_string_test.go 2019-07-08 17:53:57 +08:00
46721d7552 update garray unit tests. 2019-07-08 17:34:32 +08:00
a9a5a78e02 Merge pull request #39 from gogf/master
日常更新
2019-07-08 16:04:20 +08:00
7c4431ceeb add copyfile & copydir test 2019-07-08 11:37:02 +08:00
8cfdc8f27f file and folder copy 2019-07-08 01:26:00 +08:00
691baf5c16 comment updates 2019-07-07 09:47:33 +08:00
8669057681 remove debug line 2019-07-06 21:44:31 +08:00
b439aedce5 RELEASE updates 2019-07-06 17:35:03 +08:00
2504e405a7 add sql.ErrNoRows feature for querying of gdb 2019-07-06 17:13:17 +08:00
6426409bf9 add debug configuration support for gdb 2019-07-06 16:51:50 +08:00
9cf4ea5c91 rename Priority to Weight for gdb 2019-07-06 16:14:45 +08:00
86343abcf8 merge master 2019-07-06 16:02:05 +08:00
d0fe2d2f75 fix issue in gdb.Model.Scan 2019-07-06 15:51:32 +08:00
49ef4fd266 add more example for gconv.Map 2019-07-06 15:02:02 +08:00
929a57ceb8 add Structs/StructsDeep function for gconv; add auto-creating struct/struct pointer for gconv.Struct function when parameter pointer is typeof **struct 2019-07-06 11:10:32 +08:00
c6f94ed95a Update garray_z_unit_string_test.go 2019-07-05 15:27:56 +08:00
949ac459fc Update garray_z_unit_string_test.go 2019-07-05 15:07:28 +08:00
32fc6868aa Merge pull request #2 from gogf/master
sync master
2019-07-05 08:58:19 +08:00
82394cd70e Update garray_z_unit_string_test.go 2019-07-04 22:49:50 +08:00
4670a5d2e2 TODO++; version updates 2019-07-04 19:22:11 +08:00
273d992493 fix issue in gfsnotify in recursive inotify watcher registering 2019-07-04 19:06:06 +08:00
1c71340719 gfcache test 20190704 15:00 2019-07-04 15:03:56 +08:00
ed61c2ee22 improve gconv.Map for priority tags 2019-07-04 14:27:43 +08:00
363dede57c gvalid test 20190704 11:16 2019-07-04 11:19:59 +08:00
b29c6add47 rename internal/structtag to internal/structs; add more feature for internal/structs; improve gvalid to support recursive validation for struct; improve gconv.Struct/Map functions 2019-07-04 11:11:41 +08:00
8d01e565c5 gfsnotify example updates 2019-07-03 22:27:50 +08:00
47e0fb95d5 add package internal/structtag; improve ghttp.Request.Get*ToStruct functions to support substruct with 'param' tag; improve gtest.compareMap; improve gconv.Map using internal/structtag 2019-07-03 22:09:35 +08:00
23d346b291 improve gdb.Model.Struct/Structs/Scan in error handling, it returns sql.ErrorNoRows if no records received after querying 2019-07-03 19:38:52 +08:00
105cdf6fe6 20190703 14:25 2019-07-03 14:28:20 +08:00
5135264d56 Merge branch 'develop' of https://github.com/gogf/gf into develop 2019-07-03 14:25:49 +08:00
c3ff1a3db3 merge master 2019-07-03 14:25:29 +08:00
d62c1dedf3 Merge pull request #1 from gogf/master
sync master
2019-07-03 11:03:54 +08:00
bd105a188f Merge pull request #38 from gogf/master
日常更新
2019-07-03 10:29:43 +08:00
09affd3981 update tests 2019-07-03 10:20:40 +08:00
8e7e18e22d update test 2019-07-03 10:17:17 +08:00
e03fd80fd4 sync gf master 2019-07-03 10:02:17 +08:00
adc3201dcf Update garray_z_unit_string_test.go 2019-07-03 09:39:16 +08:00
3a681e5b1a Update garray_z_unit_string_test.go 2019-07-03 09:21:37 +08:00
c90ed0d424 comment updates for gfsnotify 2019-07-02 23:57:49 +08:00
418cbb420b TODO updates; version updates 2019-07-02 23:48:38 +08:00
c948f0c287 improve gdb.Update/Delete feature to support orderby/limit features 2019-07-02 23:14:40 +08:00
285b45d19d Update garray_z_unit_string_test.go 2019-07-02 22:37:06 +08:00
783f1c8457 Update garray_z_unit_string_test.go 2019-07-02 22:27:31 +08:00
daa7f12994 Update garray_z_unit_string_test.go 2019-07-02 22:22:51 +08:00
e63e989d41 fix issue of dead lock in gcache.doSetWithLockCheck 2019-07-02 19:22:06 +08:00
31921905a9 update unit test cases for gaes because of changes of gbase64 2019-07-02 17:40:16 +08:00
5572ab858e improve gbase64 2019-07-02 17:30:18 +08:00
961ca0879d improve gbase64 2019-07-02 16:56:10 +08:00
5d464494b6 Update garray_z_unit_string_test.go 2019-07-01 22:26:20 +08:00
4ca2513d00 Merge pull request #37 from gogf/master
日常更新
2019-07-01 20:49:44 +08:00
15d69ed950 sync gf master 2019-07-01 20:41:13 +08:00
39bd2616c4 add go.sum to gitignore 2019-06-30 22:22:24 +08:00
6302789c41 improve package gerror; add support for gerror formating output in glog 2019-06-30 22:21:08 +08:00
0ff31012c8 donator updates 2019-06-30 19:31:18 +08:00
5c7b25c960 add some tests 2019-06-30 13:03:22 +08:00
10102f2db9 improving gerror 2019-06-30 12:54:06 +08:00
6f5b5e4dc2 Update garray_z_unit_int_test.go 2019-06-30 12:52:30 +08:00
007c8a7b64 Merge branch '完善garray测试' 2019-06-30 12:44:57 +08:00
009ce9063e improve gerror/glog 2019-06-29 23:35:32 +08:00
58a405bfa8 add package gerror; improve internal/debug,glog package 2019-06-29 18:17:33 +08:00
42214f17fc Update garray_z_unit_int_test.go 2019-06-29 18:16:40 +08:00
b5f117e932 Merge branch '完善garray测试' of https://github.com/jroam/gf into 完善garray测试 2019-06-29 17:58:24 +08:00
b0f158047c Update garray_z_unit_int_test.go 2019-06-29 17:48:44 +08:00
d5f7ca634d add package internal/debug; add gutil.Stack/PrintStack; rename Backtrace to Stack for glog 2019-06-29 10:45:50 +08:00
aa6110c619 Merge branch 'master' of https://github.com/gogf/gf 2019-06-27 14:33:57 +08:00
a9660fe9fa add valid tag for gvalid 2019-06-27 14:33:39 +08:00
0801245871 sync gf master 2019-06-27 10:35:56 +08:00
278fd3515f edit garray of tests 2019-06-27 10:21:49 +08:00
56588f3f7f add some garray unit tests 2019-06-26 23:29:47 +08:00
a5d01cb547 sync gf master 2019-06-26 23:08:36 +08:00
fabf5d1ad5 Update gmd5.go 2019-06-26 22:57:03 +08:00
ebae3a4929 Update gudp_conn.go 2019-06-26 22:55:19 +08:00
8e6640ed79 Merge pull request #199 from pibigstar/master 2019-06-26 22:50:43 +08:00
e4c42bde89 edit some imports 2019-06-26 22:42:05 +08:00
f7515edde9 Merge pull request #36 from gogf/master
improve ghttp.Client
2019-06-26 22:02:43 +08:00
2b0da75412 improve ghttp.Client 2019-06-26 13:55:23 +08:00
04c422c3af Merge branch 'master' into 完善garray测试 2019-06-26 10:00:40 +08:00
339ca74ff4 Merge branch 'master' of https://github.com/gogf/gf into gogf-master 2019-06-26 09:59:00 +08:00
741a13379a edit some garray inut tests 2019-06-26 09:53:41 +08:00
da907f35bd improve group router for ghttp 2019-06-25 23:26:47 +08:00
133531b6a0 README updates 2019-06-25 23:17:14 +08:00
5fa0f8dd7e up 2019-06-25 23:06:12 +08:00
7247413a48 Merge branch 'master' of https://github.com/gogf/gf 2019-06-25 23:03:39 +08:00
591158adc5 improve router registry for ghttp 2019-06-25 23:03:29 +08:00
5d83383105 Merge pull request #212 from hailaz/master 2019-06-25 23:02:06 +08:00
5ad809f49e vet the go format 2019-06-25 19:26:02 +08:00
56a62bb4c2 gofmt 2019-06-25 19:01:27 +08:00
afb4a233be Merge pull request #215 from 2892931976/gf-chj 2019-06-25 19:00:02 +08:00
c0aebe023c remove example codes for gcanner 2019-06-25 18:40:55 +08:00
055c6a668e add some garray tests 2019-06-25 18:17:10 +08:00
735c5fc7ed add some garray tests 2019-06-25 16:32:12 +08:00
c066fff971 仓库位置更改 2019-06-25 16:03:14 +08:00
89373ebcd6 增加代码风格检查 2019-06-25 16:03:14 +08:00
51cf232691 gutil test 20190615 15:47 2019-06-25 15:50:06 +08:00
3bfff2347f Merge branch 'master' into 完善garray测试 2019-06-25 09:34:17 +08:00
7d83604540 Merge branch 'pr/34' 2019-06-25 09:26:30 +08:00
f25571a0a9 Improve gmlock, gmutex, grpool, gmutex unit testing sleep time. 2019-06-24 19:34:53 +08:00
05c7ba5f29 improve ghttp.CORSDefault 2019-06-24 19:05:07 +08:00
dcf7772589 Improve gmlock, gmutex unit testing sleep time. 2019-06-24 18:04:35 +08:00
3806f9db07 Improve gflock unit testing. 2019-06-24 17:33:56 +08:00
0f14002b05 Improve gflock unit testing. 2019-06-24 17:17:24 +08:00
1bf53d8b89 Improve gflock unit testing. 2019-06-24 17:15:46 +08:00
8eb10a58ad Improve gflock. 2019-06-24 17:15:30 +08:00
9985378062 rename gmutex unit test file. 2019-06-24 15:04:33 +08:00
38ad5d457b Improve grpool unit testing. 2019-06-24 15:01:12 +08:00
ebed433dde Merge pull request #209 from guoyahao/master 2019-06-24 13:41:18 +08:00
2b02f7e210 Improve gmutex unit testing. 2019-06-24 12:50:00 +08:00
1434800982 Improve gmlock unit testing. 2019-06-24 09:27:31 +08:00
327e33b827 gutil test 20190623 20:41 2019-06-23 20:44:03 +08:00
d2a053c1d7 no message 2019-06-23 17:53:10 +08:00
abe14e049a gutil test 20190623 16:42 2019-06-23 16:45:30 +08:00
4b9db0c794 fix issue for gmd5/gcrc32 2019-06-22 23:06:44 +08:00
b118cd8f27 README updates 2019-06-22 22:06:39 +08:00
83669964f5 README updates 2019-06-22 22:06:13 +08:00
9248fd6b28 add internal/errors 2019-06-22 22:05:39 +08:00
bb935967ac add MarshalJSON function for gjson/gparser to implements the interface MarshalJSON for json.Marshal 2019-06-22 17:02:36 +08:00
b7e0f1f983 improve grpool 2019-06-22 15:05:15 +08:00
6ee6c007c5 update gmutex and its benchmark test cases 2019-06-22 14:42:27 +08:00
9a507b54d7 add Remove/Clear functions for gmlock 2019-06-22 11:45:58 +08:00
c88f516759 remove mutex usage from gflock 2019-06-22 11:29:51 +08:00
912b743a1e improve Range/SubSlice functions for garray 2019-06-22 11:03:50 +08:00
d546424f18 improve gmutex 2019-06-21 22:37:07 +08:00
fe179fff42 gofmt 2019-06-21 22:23:07 +08:00
adf2ddb510 继续完善garray的测试 2019-06-21 17:46:42 +08:00
f30c9020fa Merge branch 'master' into 完善garray测试 2019-06-21 14:08:54 +08:00
1b3073f3f9 Merge pull request #33 from gogf/master
日常更新
2019-06-21 14:05:46 +08:00
615161ac9d 继续增加garray测试 2019-06-21 14:04:52 +08:00
02e06e7c6e improve unit test cases for gmlock.Mutex 2019-06-20 09:20:41 +08:00
d15268eb22 improve codes 2019-06-20 00:04:06 +08:00
e48415d932 README updates 2019-06-19 23:58:50 +08:00
e5fa341f39 improve codes 2019-06-19 23:56:14 +08:00
234d734981 Merge pull request #201 from hailaz/master 2019-06-19 23:32:22 +08:00
d771ed9209 improve codes 2019-06-19 23:28:37 +08:00
37d72cb8b3 完善garray单元测试 2019-06-19 18:19:31 +08:00
1154f9601b Improve gmlock unit testing. 2019-06-19 17:50:50 +08:00
322513f99b Merge pull request #9 from gogf/master
同步主库
2019-06-19 15:14:58 +08:00
6e7ac60d4d README updates 2019-06-19 15:06:15 +08:00
405840607f fix issue in gmlock.Mutex.TryRLock 2019-06-19 15:04:50 +08:00
8417e7ef65 Merge branch 'gogf-master' 2019-06-19 11:44:17 +08:00
ac2fe44d8e 同步主库 2019-06-19 11:43:59 +08:00
3030d7f032 同步主库 2019-06-19 11:11:00 +08:00
dcf7138694 README updates 2019-06-19 09:09:13 +08:00
97df154b78 gofmt 2019-06-19 09:06:52 +08:00
d74034e08e Update garray_z_unit_int_test.go 2019-06-18 23:20:46 +08:00
674590e247 improve ghttp.RouterGroup 2019-06-18 22:04:17 +08:00
d41cc7c3b6 Merge pull request #32 from gogf/master
日常更新
2019-06-18 21:45:01 +08:00
ab48800401 improve gaes 2019-06-18 20:58:47 +08:00
ea456c5faa DONATOR updates 2019-06-18 20:52:24 +08:00
83d1442781 change strings.ReplaceAll to strings.Replace to adapt go1.11 2019-06-18 19:44:28 +08:00
5888b0e06a fix issue in gmlock 2019-06-18 19:19:43 +08:00
3120d0bd7a Merge pull request #6 from gogf/master
同步主库
2019-06-18 17:58:47 +08:00
a7dcc2c9c6 improve gmlock 2019-06-18 17:39:28 +08:00
17898cc747 improve gmlock 2019-06-18 17:31:48 +08:00
7bebf062be Improve gmlock unit testing. 2019-06-18 11:46:43 +08:00
048c3d5025 Merge pull request #195 from zseeker/master
gaes encryption and decryption add CFB mode
2019-06-18 11:44:54 +08:00
0adcdc6b4a Merge pull request #192 from jroam/master 2019-06-18 11:42:44 +08:00
19d7ad734b Update gqueue_unit_test.go 2019-06-18 11:20:10 +08:00
6c657dff37 Merge pull request #5 from gogf/master
同步主库
2019-06-18 09:12:16 +08:00
78ccbeac3b add Cas function for gtype; improve gmlock 2019-06-18 08:37:21 +08:00
2a0eae8975 gaes encryption and decryption add CFB mode 2019-06-18 04:07:35 +08:00
28d25e7812 Update gqueue_unit_test.go 2019-06-17 23:16:22 +08:00
fe795d49f3 fix gfile test of a bug
fix  gfile test of bug
2019-06-17 22:46:36 +08:00
9fad898ee3 Update gqueue_unit_test.go 2019-06-17 22:03:41 +08:00
9a42142ce7 Merge branch 'master' of https://github.com/gogf/gf into gogf-master2 2019-06-17 21:51:38 +08:00
9db8ed2dfc README updates 2019-06-17 20:34:45 +08:00
619a539f2e update unit test cases for gfpool 2019-06-17 20:21:41 +08:00
ae8eb4a1f1 Merge branch 'master' of https://github.com/gogf/gf into develop 2019-06-17 20:20:25 +08:00
9a469e64da Merge pull request #187 from goflyfox/master 2019-06-17 20:19:58 +08:00
f7d1613d62 improve gqueue 2019-06-17 19:54:00 +08:00
80655bce50 add gfpool test:delete error 2019-06-17 18:39:27 +08:00
b3b0ba775c update gfpool test:error 2019-06-17 18:09:56 +08:00
4713739d1a update gfpool test:delete err 2019-06-17 17:52:10 +08:00
53b5de330e Update gqueue_unit_test.go 2019-06-17 11:40:40 +08:00
fd4843c3a1 Update gqueue_unit_test.go 2019-06-17 11:31:03 +08:00
97d2b9e1f9 Update gqueue_unit_test.go 2019-06-17 11:04:56 +08:00
5896dadaad Merge pull request #4 from gogf/master
同步主库
2019-06-17 09:20:58 +08:00
0ab60cb770 Update gqueue_unit_test.go 2019-06-16 23:26:49 +08:00
5b71e92776 Update gqueue_unit_test.go 2019-06-16 23:24:03 +08:00
211678c7d3 Merge branch 'master' into 测试gqueue 2019-06-16 23:16:18 +08:00
d25793ed03 Merge pull request #30 from gogf/master
fix issue in gqueue.Close
2019-06-16 23:14:02 +08:00
98cae011a5 fix issue in gqueue.Close 2019-06-16 23:10:50 +08:00
59ae6f9c10 Merge pull request #29 from gogf/master
日常更新
2019-06-16 23:06:59 +08:00
474d1669d9 fix issue in gqueue.Close 2019-06-16 23:00:47 +08:00
563a1408ea fix issue in gqueue.Close 2019-06-16 23:00:00 +08:00
168c08a6f6 Create gqueue_unit_test.go 2019-06-16 22:55:07 +08:00
82783072ef Merge pull request #28 from gogf/master
fix issue in gqueue.Close
2019-06-16 22:22:12 +08:00
11972ef96c fix issue in gqueue.Close 2019-06-16 22:19:59 +08:00
468ba21283 Merge pull request #27 from gogf/master
日常更新
2019-06-16 22:06:39 +08:00
78b0cae892 先取消本地测试 2019-06-16 22:05:15 +08:00
866482a8e8 fix issue in gqueue.Close 2019-06-16 21:52:41 +08:00
c342310389 add example for garray/gchan/glist 2019-06-16 20:38:05 +08:00
0eb028f0b5 README updates 2019-06-16 20:25:08 +08:00
4ffe4f2262 add returned error for ghttp.ClientResponse.Close 2019-06-16 18:54:48 +08:00
677549ec15 add some gqueue tests 2019-06-16 16:41:12 +08:00
68d8e25bc4 update gfpool test2 2019-06-16 00:07:06 +08:00
4f007fdd44 update gfpool test 2019-06-16 00:04:46 +08:00
54392941f3 add gfpool normal test 2019-06-15 23:45:58 +08:00
ebdad47f2d Merge pull request #181 from goflyfox/master 2019-06-15 23:00:47 +08:00
cb4e36f591 update rwmutex test2 2019-06-15 22:19:37 +08:00
cd30efaaa1 update gcmd test 2019-06-15 22:11:08 +08:00
7c234e0437 golint for gvar 2019-06-15 22:06:47 +08:00
d973c5d5c7 improve communication feature for gproc 2019-06-15 21:41:20 +08:00
a7f15a4e00 change gqueue unit tests 2019-06-15 21:40:36 +08:00
6b5484bf55 Merge branch 'master' into develop 2019-06-15 20:42:48 +08:00
ab38b709b2 add gqueue tests 2019-06-15 18:44:22 +08:00
4118038198 Merge branch 'master' into 测试gqueue 2019-06-15 18:36:54 +08:00
142154c0df add gqueue unit tests 2019-06-15 18:35:36 +08:00
07ae90d64d Merge pull request #26 from gogf/master
日常更新
2019-06-15 18:34:50 +08:00
8a69fd09fc Merge pull request #185 from hailaz/master 2019-06-15 18:34:34 +08:00
5c592afebe Improve gtree unit testing. 2019-06-15 17:51:48 +08:00
8402a2b710 Merge pull request #3 from gogf/master
同步主库
2019-06-15 16:57:46 +08:00
e695983d4d improving gproc 2019-06-15 16:07:36 +08:00
a5ab2ba332 gutil test 2019 06 15 14:20 2019-06-15 14:23:28 +08:00
c6e5a52104 add test file 2019-06-14 23:47:00 +08:00
3e2d5e0bdb update mutex test2 2019-06-14 10:28:24 +08:00
1f19ed71aa update mutex test 2019-06-14 10:20:15 +08:00
5baa82da8f add gcmd test 2019-06-14 00:35:18 +08:00
48f610a216 add mutex and rwmutex test 2019-06-14 00:03:13 +08:00
e4e58791a6 add empty test 2019-06-13 23:50:12 +08:00
2834 changed files with 133654 additions and 605193 deletions

View File

@ -0,0 +1,46 @@
package main
import (
"fmt"
"github.com/gogf/gf/container/garray"
)
func main() {
// Create a int array, which is concurrent-unsafe in default.
a := garray.NewIntArray()
// Appending items.
for i := 0; i < 10; i++ {
a.Append(i)
}
// Get the length of the array.
fmt.Println(a.Len())
// Get the slice of the array.
fmt.Println(a.Slice())
// Get the item of specified index.
fmt.Println(a.Get(6))
// Insert after/before specified index.
a.InsertAfter(9, 11)
a.InsertBefore(10, 10)
fmt.Println(a.Slice())
a.Set(0, 100)
fmt.Println(a.Slice())
// Searching the item and returning the index.
fmt.Println(a.Search(5))
// Remove item of specified index.
a.Remove(0)
fmt.Println(a.Slice())
// Clearing the array.
fmt.Println(a.Slice())
a.Clear()
fmt.Println(a.Slice())
}

View File

@ -0,0 +1,22 @@
package main
import (
"encoding/json"
"fmt"
"github.com/gogf/gf/container/garray"
)
func main() {
type Student struct {
Id int
Name string
Scores *garray.IntArray
}
s := Student{
Id: 1,
Name: "john",
Scores: garray.NewIntArrayFrom([]int{100, 99, 98}),
}
b, _ := json.Marshal(s)
fmt.Println(string(b))
}

View File

@ -0,0 +1,19 @@
package main
import (
"encoding/json"
"fmt"
"github.com/gogf/gf/container/garray"
)
func main() {
b := []byte(`{"Id":1,"Name":"john","Scores":[100,99,98]}`)
type Student struct {
Id int
Name string
Scores *garray.IntArray
}
s := Student{}
json.Unmarshal(b, &s)
fmt.Println(s)
}

View File

@ -0,0 +1,40 @@
package main
import (
"fmt"
"github.com/gogf/gf/container/garray"
)
func main() {
// 自定义排序数组,降序排序(SortedIntArray管理的数据是升序)
a := garray.NewSortedArray(func(v1, v2 interface{}) int {
if v1.(int) < v2.(int) {
return 1
}
if v1.(int) > v2.(int) {
return -1
}
return 0
})
// 添加数据
a.Add(2)
a.Add(3)
a.Add(1)
fmt.Println(a.Slice())
// 添加重复数据
a.Add(3)
fmt.Println(a.Slice())
// 检索数据,返回最后对比的索引位置,检索结果
// 检索结果0: 匹配; <0:参数小于对比值; >0:参数大于对比值
fmt.Println(a.Search(1))
// 设置不可重复
a.SetUnique(true)
fmt.Println(a.Slice())
a.Add(1)
fmt.Println(a.Slice())
}

View File

@ -0,0 +1,23 @@
package main
import (
"fmt"
"github.com/gogf/gf/container/garray"
)
func main() {
array := garray.NewSortedStrArray()
array.Add("9")
array.Add("8")
array.Add("7")
array.Add("6")
array.Add("5")
array.Add("4")
array.Add("3")
array.Add("2")
array.Add("1")
fmt.Println(array.Slice())
// output:
// [1 2 3 4 5 6 7 8 9]
}

View File

@ -0,0 +1,22 @@
package main
import (
"fmt"
"github.com/gogf/gf/container/glist"
)
func main() {
l := glist.New()
// Push
l.PushBack(1)
l.PushBack(2)
e := l.PushFront(0)
// Insert
l.InsertBefore(e, -1)
l.InsertAfter(e, "a")
fmt.Println(l)
// Pop
fmt.Println(l.PopFront())
fmt.Println(l.PopBack())
fmt.Println(l)
}

View File

@ -0,0 +1,23 @@
package main
import (
"encoding/json"
"fmt"
"github.com/gogf/gf/container/glist"
"github.com/gogf/gf/frame/g"
)
func main() {
type Student struct {
Id int
Name string
Scores *glist.List
}
s := Student{
Id: 1,
Name: "john",
Scores: glist.NewFrom(g.Slice{100, 99, 98}),
}
b, _ := json.Marshal(s)
fmt.Println(string(b))
}

View File

@ -0,0 +1,19 @@
package main
import (
"encoding/json"
"fmt"
"github.com/gogf/gf/container/glist"
)
func main() {
b := []byte(`{"Id":1,"Name":"john","Scores":[100,99,98]}`)
type Student struct {
Id int
Name string
Scores *glist.List
}
s := Student{}
json.Unmarshal(b, &s)
fmt.Println(s)
}

View File

@ -0,0 +1,74 @@
package main
import (
"fmt"
"github.com/gogf/gf/container/gmap"
)
func main() {
// 创建一个默认的gmap对象
// 默认情况下该gmap对象不支持并发安全特性
// 初始化时可以给定true参数开启并发安全特性用以并发安全场景。
m := gmap.New()
// 设置键值对
for i := 0; i < 10; i++ {
m.Set(i, i)
}
// 查询大小
fmt.Println(m.Size())
// 批量设置键值对(不同的数据类型对象参数不同)
m.Sets(map[interface{}]interface{}{
10: 10,
11: 11,
})
fmt.Println(m.Size())
// 查询是否存在
fmt.Println(m.Contains(1))
// 查询键值
fmt.Println(m.Get(1))
// 删除数据项
m.Remove(9)
fmt.Println(m.Size())
// 批量删除
m.Removes([]interface{}{10, 11})
fmt.Println(m.Size())
// 当前键名列表(随机排序)
fmt.Println(m.Keys())
// 当前键值列表(随机排序)
fmt.Println(m.Values())
// 查询键名,当键值不存在时,写入给定的默认值
fmt.Println(m.GetOrSet(100, 100))
// 删除键值对,并返回对应的键值
fmt.Println(m.Remove(100))
// 遍历map
m.Iterator(func(k interface{}, v interface{}) bool {
fmt.Printf("%v:%v ", k, v)
return true
})
// 自定义写锁操作
m.LockFunc(func(m map[interface{}]interface{}) {
m[99] = 99
})
// 自定义读锁操作
m.RLockFunc(func(m map[interface{}]interface{}) {
fmt.Println(m[99])
})
// 清空map
m.Clear()
// 判断map是否为空
fmt.Println(m.IsEmpty())
}

View File

@ -0,0 +1,19 @@
package main
import (
"encoding/json"
"fmt"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/container/gmap"
)
func main() {
m := gmap.New()
m.Sets(g.MapAnyAny{
"name": "john",
"score": 100,
})
b, _ := json.Marshal(m)
fmt.Println(string(b))
}

View File

@ -0,0 +1,14 @@
package main
import (
"encoding/json"
"fmt"
"github.com/gogf/gf/container/gmap"
)
func main() {
m := gmap.Map{}
s := []byte(`{"name":"john","score":100}`)
json.Unmarshal(s, &m)
fmt.Println(m.Map())
}

View File

@ -0,0 +1,26 @@
package main
import (
"github.com/gogf/gf/container/gmap"
"github.com/gogf/gf/frame/g"
)
func main() {
m1 := gmap.New(true)
m1.Set("1", "1")
m2 := m1.Map()
m2["2"] = "2"
g.Dump(m1.Clone())
g.Dump(m2)
//output:
//{
// "1": "1"
//}
//
//{
// "1": "1",
// "2": "2"
//}
}

View File

@ -0,0 +1,31 @@
package main
import (
"fmt"
"github.com/gogf/gf/container/gmap"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/util/gutil"
)
func main() {
array := g.Slice{2, 3, 1, 5, 4, 6, 8, 7, 9}
hashMap := gmap.New()
linkMap := gmap.NewListMap()
treeMap := gmap.NewTreeMap(gutil.ComparatorInt)
for _, v := range array {
hashMap.Set(v, v)
}
for _, v := range array {
linkMap.Set(v, v)
}
for _, v := range array {
treeMap.Set(v, v)
}
fmt.Println("HashMap Keys:", hashMap.Keys())
fmt.Println("HashMap Values:", hashMap.Values())
fmt.Println("LinkMap Keys:", linkMap.Keys())
fmt.Println("LinkMap Values:", linkMap.Values())
fmt.Println("TreeMap Keys:", treeMap.Keys())
fmt.Println("TreeMap Values:", treeMap.Values())
}

View File

@ -2,8 +2,9 @@ package main
import (
"fmt"
"github.com/gogf/gf/g/container/gmap"
"github.com/gogf/gf/g/util/gutil"
"github.com/gogf/gf/container/gmap"
"github.com/gogf/gf/util/gutil"
)
func main() {

View File

@ -0,0 +1,26 @@
package main
import (
"fmt"
"time"
"github.com/gogf/gf/container/gpool"
)
func main() {
// 创建一个对象池过期时间为1000毫秒
p := gpool.New(1000*time.Millisecond, nil)
// 从池中取一个对象返回nil及错误信息
fmt.Println(p.Get())
// 丢一个对象到池中
p.Put(1)
// 重新从池中取一个对象返回1
fmt.Println(p.Get())
// 等待1秒后重试发现对象已过期返回nil及错误信息
time.Sleep(time.Second)
fmt.Println(p.Get())
}

View File

@ -2,15 +2,16 @@ package main
import (
"fmt"
"github.com/gogf/gf/g/container/gpool"
"github.com/gogf/gf/g/net/gtcp"
"github.com/gogf/gf/g/os/glog"
"time"
"github.com/gogf/gf/container/gpool"
"github.com/gogf/gf/net/gtcp"
"github.com/gogf/gf/os/glog"
)
func main() {
// 创建对象复用池对象过期时间为3000毫秒并给定创建及销毁方法
p := gpool.New(3000, func() (interface{}, error) {
p := gpool.New(3000*time.Millisecond, func() (interface{}, error) {
return gtcp.NewConn("www.baidu.com:80")
}, func(i interface{}) {
glog.Println("expired")

View File

@ -0,0 +1,34 @@
package main
import (
"fmt"
"time"
"github.com/gogf/gf/container/gqueue"
"github.com/gogf/gf/os/gtime"
"github.com/gogf/gf/os/gtimer"
)
func main() {
q := gqueue.New()
// 数据生产者每隔1秒往队列写数据
gtimer.SetInterval(time.Second, func() {
v := gtime.Now().String()
q.Push(v)
fmt.Println("Push:", v)
})
// 3秒后关闭队列
gtimer.SetTimeout(3*time.Second, func() {
q.Close()
})
// 消费者,不停读取队列数据并输出到终端
for {
if v := q.Pop(); v != nil {
fmt.Println(" Pop:", v)
} else {
break
}
}
}

View File

@ -2,9 +2,10 @@ package main
import (
"fmt"
"github.com/gogf/gf/g/container/gqueue"
"github.com/gogf/gf/g/os/gtimer"
"time"
"github.com/gogf/gf/container/gqueue"
"github.com/gogf/gf/os/gtimer"
)
func main() {

View File

@ -2,10 +2,11 @@ package main
import (
"fmt"
"github.com/gogf/gf/g/container/gqueue"
"github.com/gogf/gf/g/os/gtime"
"github.com/gogf/gf/g/os/gtimer"
"time"
"github.com/gogf/gf/container/gqueue"
"github.com/gogf/gf/os/gtime"
"github.com/gogf/gf/os/gtimer"
)
func main() {

View File

@ -0,0 +1,28 @@
package main
import (
"fmt"
"github.com/gogf/gf/container/gring"
)
func main() {
r1 := gring.New(10)
for i := 0; i < 5; i++ {
r1.Set(i).Next()
}
fmt.Println("Len:", r1.Len())
fmt.Println("Cap:", r1.Cap())
fmt.Println(r1.SlicePrev())
fmt.Println(r1.SliceNext())
r2 := gring.New(10)
for i := 0; i < 10; i++ {
r2.Set(i).Next()
}
fmt.Println("Len:", r2.Len())
fmt.Println("Cap:", r2.Cap())
fmt.Println(r2.SlicePrev())
fmt.Println(r2.SliceNext())
}

View File

@ -2,7 +2,8 @@ package main
import (
"fmt"
"github.com/gogf/gf/g/container/gring"
"github.com/gogf/gf/container/gring"
)
type Player struct {

View File

@ -2,7 +2,8 @@ package main
import (
"fmt"
"github.com/gogf/gf/g/container/gset"
"github.com/gogf/gf/container/gset"
)
func main() {

View File

@ -2,8 +2,9 @@ package main
import (
"fmt"
"github.com/gogf/gf/g"
"github.com/gogf/gf/g/container/gset"
"github.com/gogf/gf/container/gset"
"github.com/gogf/gf/frame/g"
)
func main() {

View File

@ -0,0 +1,22 @@
package main
import (
"encoding/json"
"fmt"
"github.com/gogf/gf/container/gset"
)
func main() {
type Student struct {
Id int
Name string
Scores *gset.IntSet
}
s := Student{
Id: 1,
Name: "john",
Scores: gset.NewIntSetFrom([]int{100, 99, 98}),
}
b, _ := json.Marshal(s)
fmt.Println(string(b))
}

View File

@ -0,0 +1,19 @@
package main
import (
"encoding/json"
"fmt"
"github.com/gogf/gf/container/gset"
)
func main() {
b := []byte(`{"Id":1,"Name":"john","Scores":[100,99,98]}`)
type Student struct {
Id int
Name string
Scores *gset.IntSet
}
s := Student{}
json.Unmarshal(b, &s)
fmt.Println(s)
}

View File

@ -0,0 +1,29 @@
package main
import (
"fmt"
"github.com/gogf/gf/container/gtree"
"github.com/gogf/gf/util/gutil"
)
func main() {
tree := gtree.NewAVLTree(gutil.ComparatorInt)
for i := 0; i < 10; i++ {
tree.Set(i, i*10)
}
// 打印树形
tree.Print()
// 前序遍历
fmt.Println("ASC:")
tree.IteratorAsc(func(key, value interface{}) bool {
fmt.Println(key, value)
return true
})
// 后续遍历
fmt.Println("DESC:")
tree.IteratorDesc(func(key, value interface{}) bool {
fmt.Println(key, value)
return true
})
}

View File

@ -0,0 +1,22 @@
package main
import (
"fmt"
"github.com/gogf/gf/container/gtree"
)
func main() {
tree := gtree.NewBTree(10, func(v1, v2 interface{}) int {
return v1.(int) - v2.(int)
})
for i := 0; i < 20; i++ {
tree.Set(i, i*10)
}
fmt.Println(tree.String())
tree.IteratorDesc(func(key, value interface{}) bool {
fmt.Println(key, value)
return true
})
}

View File

@ -2,8 +2,9 @@ package main
import (
"fmt"
"github.com/gogf/gf/g/container/gtree"
"github.com/gogf/gf/g/util/gutil"
"github.com/gogf/gf/container/gtree"
"github.com/gogf/gf/util/gutil"
)
func main() {

View File

@ -0,0 +1,17 @@
package main
import (
"github.com/gogf/gf/container/gtree"
)
func main() {
tree := gtree.NewRedBlackTree(func(v1, v2 interface{}) int {
return v1.(int) - v2.(int)
})
for i := 0; i < 10; i++ {
tree.Set(i, i)
}
tree.Print()
tree.Flip()
tree.Print()
}

View File

@ -2,7 +2,8 @@ package main
import (
"fmt"
"github.com/gogf/gf/g/container/gtype"
"github.com/gogf/gf/container/gtype"
)
func main() {

View File

@ -0,0 +1,22 @@
package main
import (
"encoding/json"
"fmt"
"github.com/gogf/gf/container/gtype"
)
func main() {
type Student struct {
Id *gtype.Int
Name *gtype.String
Scores *gtype.Interface
}
s := Student{
Id: gtype.NewInt(1),
Name: gtype.NewString("john"),
Scores: gtype.NewInterface([]int{100, 99, 98}),
}
b, _ := json.Marshal(s)
fmt.Println(string(b))
}

View File

@ -0,0 +1,19 @@
package main
import (
"encoding/json"
"fmt"
"github.com/gogf/gf/container/gtype"
)
func main() {
b := []byte(`{"Id":1,"Name":"john","Scores":[100,99,98]}`)
type Student struct {
Id *gtype.Int
Name *gtype.String
Scores *gtype.Interface
}
s := Student{}
json.Unmarshal(b, &s)
fmt.Println(s)
}

View File

@ -0,0 +1,22 @@
package main
import (
"encoding/json"
"fmt"
"github.com/gogf/gf/frame/g"
)
func main() {
type Student struct {
Id *g.Var
Name *g.Var
Scores *g.Var
}
s := Student{
Id: g.NewVar(1),
Name: g.NewVar("john"),
Scores: g.NewVar([]int{100, 99, 98}),
}
b, _ := json.Marshal(s)
fmt.Println(string(b))
}

View File

@ -0,0 +1,19 @@
package main
import (
"encoding/json"
"fmt"
"github.com/gogf/gf/frame/g"
)
func main() {
b := []byte(`{"Id":1,"Name":"john","Scores":[100,99,98]}`)
type Student struct {
Id *g.Var
Name *g.Var
Scores *g.Var
}
s := Student{}
json.Unmarshal(b, &s)
fmt.Println(s)
}

View File

@ -0,0 +1,33 @@
package main
import (
"fmt"
"github.com/gogf/gf/frame/g"
)
func main() {
var v g.Var
v.Set("123")
fmt.Println(v.Val())
// 基本类型转换
fmt.Println(v.Int())
fmt.Println(v.Uint())
fmt.Println(v.Float64())
// slice转换
fmt.Println(v.Ints())
fmt.Println(v.Floats())
fmt.Println(v.Strings())
// struct转换
type Score struct {
Value int
}
s := new(Score)
v.Struct(s)
fmt.Println(s)
}

View File

@ -0,0 +1,76 @@
// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/gogf/gf.
package driver
import (
"database/sql"
"github.com/gogf/gf/database/gdb"
"github.com/gogf/gf/os/gtime"
)
// MyDriver is a custom database driver, which is used for testing only.
// For simplifying the unit testing case purpose, MyDriver struct inherits the mysql driver
// gdb.DriverMysql and overwrites its functions DoQuery and DoExec.
// So if there's any sql execution, it goes through MyDriver.DoQuery/MyDriver.DoExec firstly
// and then gdb.DriverMysql.DoQuery/gdb.DriverMysql.DoExec.
// You can call it sql "HOOK" or "HiJack" as your will.
type MyDriver struct {
*gdb.DriverMysql
}
var (
// customDriverName is my driver name, which is used for registering.
customDriverName = "MyDriver"
)
func init() {
// It here registers my custom driver in package initialization function "init".
// You can later use this type in the database configuration.
if err := gdb.Register(customDriverName, &MyDriver{}); err != nil {
panic(err)
}
}
// New creates and returns a database object for mysql.
// It implements the interface of gdb.Driver for extra database driver installation.
func (d *MyDriver) New(core *gdb.Core, node *gdb.ConfigNode) (gdb.DB, error) {
return &MyDriver{
&gdb.DriverMysql{
Core: core,
},
}, nil
}
// DoQuery commits the sql string and its arguments to underlying driver
// through given link object and returns the execution result.
func (d *MyDriver) DoQuery(link gdb.Link, sql string, args ...interface{}) (rows *sql.Rows, err error) {
tsMilli := gtime.TimestampMilli()
rows, err = d.DriverMysql.DoQuery(link, sql, args...)
link.Exec(
"INSERT INTO `monitor`(`sql`,`cost`,`time`,`error`) VALUES(?,?,?,?)",
gdb.FormatSqlWithArgs(sql, args),
gtime.TimestampMilli()-tsMilli,
gtime.Now(),
err,
)
return
}
// DoExec commits the query string and its arguments to underlying driver
// through given link object and returns the execution result.
func (d *MyDriver) DoExec(link gdb.Link, sql string, args ...interface{}) (result sql.Result, err error) {
tsMilli := gtime.TimestampMilli()
result, err = d.DriverMysql.DoExec(link, sql, args...)
link.Exec(
"INSERT INTO `monitor`(`sql`,`cost`,`time`,`error`) VALUES(?,?,?,?)",
gdb.FormatSqlWithArgs(sql, args),
gtime.TimestampMilli()-tsMilli,
gtime.Now(),
err,
)
return
}

View File

@ -0,0 +1 @@
package main

View File

@ -0,0 +1,3 @@
[database]
linkinfo = "mssql:user id=test;password=test1;server=122.152.202.91;port=1433;database=test;encrypt=disable"

View File

@ -0,0 +1,23 @@
package main
import (
"fmt"
"github.com/gogf/gf/os/gtime"
_ "github.com/denisenkom/go-mssqldb"
"github.com/gogf/gf/frame/g"
)
func main() {
type Table2 struct {
Id string `orm:"id;pr" json:"id"` //ID
Createtime gtime.Time `orm:"createtime" json:"createtime"` //创建时间
Updatetime gtime.Time `orm:"updatetime" json:"updatetime"` //更新时间
}
var table2 Table2
err := g.DB().Table("table2").Where("id=?", 1).Struct(&table2)
if err != nil {
panic(err)
}
fmt.Println(table2.Createtime)
}

View File

@ -3,9 +3,10 @@ package main
import (
"fmt"
"time"
//_ "github.com/denisenkom/go-mssqldb"
"github.com/gogf/gf/g"
"github.com/gogf/gf/g/database/gdb"
"github.com/gogf/gf/database/gdb"
"github.com/gogf/gf/frame/g"
)
// 本文件用于gf框架的mssql数据库操作示例不作为单元测试使用
@ -26,7 +27,7 @@ func init() {
})
db, _ = gdb.New()
//gins.Config().SetPath("/home/john/Workspace/Go/GOPATH/src/github.com/gogf/gf/geg/frame")
//gins.Config().SetPath("/home/john/Workspace/Go/GOPATH/src/github.com/gogf/gf/.example/frame")
//db = g.Database()
//gdb.SetConfig(gdb.ConfigNode {
@ -49,7 +50,7 @@ func init() {
// Name : "test",
// Type : "mysql",
// Role : "master",
// Priority : 100,
// Weight : 100,
// },
// gdb.ConfigNode {
// Host : "127.0.0.2",
@ -59,7 +60,7 @@ func init() {
// Name : "test",
// Type : "mysql",
// Role : "master",
// Priority : 100,
// Weight : 100,
// },
// gdb.ConfigNode {
// Host : "127.0.0.3",
@ -69,7 +70,7 @@ func init() {
// Name : "test",
// Type : "mysql",
// Role : "master",
// Priority : 100,
// Weight : 100,
// },
// gdb.ConfigNode {
// Host : "127.0.0.4",
@ -79,7 +80,7 @@ func init() {
// Name : "test",
// Type : "mysql",
// Role : "master",
// Priority : 100,
// Weight : 100,
// },
// },
//})
@ -511,17 +512,6 @@ func mapToStruct() {
}
}
// getQueriedSqls
func getQueriedSqls() {
for k, v := range db.GetQueriedSqls() {
fmt.Println(k, ":")
fmt.Println("Sql :", v.Sql)
fmt.Println("Args :", v.Args)
fmt.Println("Error:", v.Error)
fmt.Println("Func :", v.Func)
}
}
func main() {
db.PingMaster()

View File

@ -0,0 +1,26 @@
# MySQL.
[database]
[database.logger]
Level = "all"
Stdout = true
CtxKeys = ["Trace-Id"]
[database.default]
link = "mysql:root:12345678@tcp(127.0.0.1:3306)/test"
debug = true
# Redis.
[redis]
default = "127.0.0.1:6379,0"
cache = "127.0.0.1:6379,1"
#[database]
# [[database.default]]
# type = "mysql"
# link = "root:12345678@tcp(127.0.0.1:3306)/test?parseTime=true&loc=Local"
#

View File

@ -0,0 +1,37 @@
package main
import (
"github.com/gogf/gf/database/gdb"
"sync"
"time"
)
var db gdb.DB
func init() {
gdb.AddDefaultConfigNode(gdb.ConfigNode{
Host: "127.0.0.1",
Port: "3306",
User: "root",
Pass: "12345678",
Name: "test",
Type: "mysql",
Role: "master",
Charset: "utf8",
MaxOpenConnCount: 100,
})
db, _ = gdb.New()
}
func main() {
wg := sync.WaitGroup{}
for i := 0; i < 100000; i++ {
wg.Add(1)
go func() {
defer wg.Done()
time.Sleep(10 * time.Second)
db.Table("user").Where("id=1").All()
}()
}
wg.Wait()
}

View File

@ -0,0 +1,4 @@
# MySQL数据库配置
[database]
link = "mysql:root:8692651@tcp(192.168.1.11:3306)/test"

View File

@ -0,0 +1,7 @@
# MySQL数据库配置
[database]
[database.default]
link = "mysql:root:8692651@tcp(192.168.1.11:3306)/test"
[database.user]
link = "mysql:root:8692651@tcp(192.168.1.11:3306)/test"

View File

@ -0,0 +1,28 @@
package main
import (
"fmt"
"github.com/gogf/gf/frame/g"
)
func main() {
db := g.DB()
// 开启调试模式以便于记录所有执行的SQL
db.SetDebug(true)
r, e := db.GetAll("SELECT * from `user` where id in(?)", g.Slice{})
if e != nil {
fmt.Println(e)
}
if r != nil {
fmt.Println(r)
}
return
//r, e := db.Table("user").Where("id in(?)", g.Slice{}).All()
//if e != nil {
// fmt.Println(e)
//}
//if r != nil {
// fmt.Println(r.List())
//}
}

View File

@ -0,0 +1,23 @@
package main
import (
"github.com/gogf/gf/frame/g"
)
func main() {
db := g.DB()
db.Table("user").Where("nickname like ? and passport like ?", g.Slice{"T3", "t3"}).OrderBy("id asc").All()
conditions := g.Map{
"nickname like ?": "%T%",
"id between ? and ?": g.Slice{1, 3},
"id >= ?": 1,
"create_time > ?": 0,
"id in(?)": g.Slice{1, 2, 3},
}
db.Table("user").Where(conditions).OrderBy("id asc").All()
var params []interface{}
db.Table("user").Where("1=1", params).OrderBy("id asc").All()
}

View File

@ -0,0 +1,24 @@
package main
import (
"fmt"
"github.com/gogf/gf/frame/g"
)
func main() {
db := g.DB()
db.SetDebug(true)
list := make(g.List, 0)
for i := 0; i < 100; i++ {
list = append(list, g.Map{
"name": fmt.Sprintf(`name_%d`, i),
})
}
r, e := db.Table("user").Data(list).Batch(2).Insert()
if e != nil {
panic(e)
}
if r != nil {
fmt.Println(r.LastInsertId())
}
}

View File

@ -2,9 +2,10 @@ package main
import (
"fmt"
"github.com/gogf/gf/g"
"github.com/gogf/gf/g/crypto/gaes"
"github.com/gogf/gf/g/database/gdb"
"github.com/gogf/gf/crypto/gaes"
"github.com/gogf/gf/database/gdb"
"github.com/gogf/gf/frame/g"
)
func main() {

View File

@ -0,0 +1,20 @@
package main
import (
"fmt"
"github.com/gogf/gf/frame/g"
)
func main() {
db := g.DB()
db.SetDebug(true)
r, e := db.Table("test").All()
if e != nil {
panic(e)
}
if r != nil {
fmt.Println(r.ToList())
}
}

View File

@ -0,0 +1,40 @@
package main
import (
"github.com/gogf/gf/database/gdb"
"github.com/gogf/gf/util/gutil"
"time"
)
func main() {
gdb.AddDefaultConfigNode(gdb.ConfigNode{
Host: "127.0.0.1",
Port: "3306",
User: "root",
Pass: "12345678",
Name: "test",
Type: "mysql",
Role: "master",
Charset: "utf8",
})
db, err := gdb.New()
if err != nil {
panic(err)
}
//db.GetCache().SetAdapter(adapter.NewRedis(g.Redis()))
// 开启调试模式以便于记录所有执行的SQL
db.SetDebug(true)
// 执行2次查询并将查询结果缓存3秒并可执行缓存名称(可选)
for i := 0; i < 3; i++ {
r, _ := db.Table("user").Cache(3000*time.Second).Where("id=?", 1).One()
gutil.Dump(r.Map())
}
// 执行更新操作,并清理指定名称的查询缓存
//db.Table("user").Cache(-1, "vip-user").Data(gdb.Map{"name": "smith"}).Where("id=?", 1).Update()
// 再次执行查询,启用查询缓存特性
//r, _ := db.Table("user").Cache(300000*time.Second, "vip-user").Where("id=?", 1).One()
//gutil.Dump(r.Map())
}

View File

@ -0,0 +1,24 @@
package main
import (
"github.com/gogf/gf/frame/g"
)
func main() {
// error!
r, err := g.DB().Table("user").Where(g.Map{
"or": g.Map{
"nickname": "jim",
"create_time > ": "2019-10-01",
},
"and": g.Map{
"nickname": "tom",
"create_time > ": "2019-10-01",
},
}).All()
if err != nil {
panic(err)
}
g.Dump(r)
}

View File

@ -0,0 +1,16 @@
package main
import (
"fmt"
"github.com/gogf/gf/frame/g"
)
func main() {
if r, err := g.DB().Table("user").Where("uid=?", 1).One(); err == nil {
fmt.Println(r["uid"].Int())
fmt.Println(r["name"].String())
} else {
fmt.Println(err)
}
}

View File

@ -0,0 +1,17 @@
package main
import (
"fmt"
"github.com/gogf/gf/frame/g"
)
func main() {
g.Config().SetFileName("config2.toml")
if r, err := g.DB().Table("user").Where("uid=?", 1).One(); err == nil {
fmt.Println(r["uid"].Int())
fmt.Println(r["name"].String())
} else {
fmt.Println(err)
}
}

View File

@ -0,0 +1,24 @@
package main
import (
"fmt"
"github.com/gogf/gf/frame/g"
)
func main() {
g.Config().SetFileName("config3.toml")
if r, err := g.DB().Table("user").Where("uid=?", 1).One(); err == nil {
fmt.Println(r["uid"].Int())
fmt.Println(r["name"].String())
} else {
fmt.Println(err)
}
if r, err := g.DB("user").Table("user").Where("uid=?", 1).One(); err == nil {
fmt.Println(r["uid"].Int())
fmt.Println(r["name"].String())
} else {
fmt.Println(err)
}
}

View File

@ -0,0 +1,14 @@
package main
import (
"context"
"github.com/gogf/gf/frame/g"
)
func main() {
ctx := context.WithValue(context.Background(), "Trace-Id", "123456789")
_, err := g.DB().Ctx(ctx).Query("SELECT 1")
if err != nil {
panic(err)
}
}

View File

@ -0,0 +1,14 @@
package main
import (
"context"
"github.com/gogf/gf/frame/g"
)
func main() {
ctx := context.WithValue(context.Background(), "Trace-Id", "123456789")
_, err := g.DB().Model("user").Ctx(ctx).All()
if err != nil {
panic(err)
}
}

View File

@ -2,8 +2,9 @@ package main
import (
"fmt"
"github.com/gogf/gf/g"
"github.com/gogf/gf/g/os/gtime"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/os/gtime"
)
func main() {

View File

@ -0,0 +1,37 @@
package main
import (
"github.com/gogf/gf/database/gdb"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/os/glog"
)
func main() {
gdb.AddDefaultConfigNode(gdb.ConfigNode{
Host: "127.0.0.1",
Port: "3306",
User: "root",
Pass: "12345678",
Name: "test",
Type: "mysql",
Role: "master",
Charset: "utf8",
})
db, err := gdb.New()
if err != nil {
panic(err)
}
//db.SetDebug(false)
glog.SetPath("/tmp")
// 执行3条SQL查询
for i := 1; i <= 3; i++ {
db.Table("user").Where("uid=?", i).One()
}
// 构造一条错误查询
db.Table("user").Where("no_such_field=?", "just_test").One()
db.Table("user").Data(g.Map{"name": "smith"}).Where("uid=?", 1).Save()
}

View File

@ -0,0 +1,18 @@
package main
import (
"github.com/gogf/gf/frame/g"
)
func main() {
db := g.DB()
// 执行3条SQL查询
for i := 1; i <= 3; i++ {
db.Table("user").Where("id=?", i).One()
}
// 构造一条错误查询
db.Table("user").Where("no_such_field=?", "just_test").One()
db.Table("user").Data(g.Map{"name": "smith"}).Where("uid=?", 1).Save()
}

View File

@ -0,0 +1,30 @@
package main
import (
"fmt"
"github.com/gogf/gf/database/gdb"
"github.com/gogf/gf/frame/g"
)
func main() {
//db := g.DB()
gdb.AddDefaultConfigNode(gdb.ConfigNode{
LinkInfo: "root:12345678@tcp(127.0.0.1:3306)/test?parseTime=true&loc=Local",
Type: "mysql",
Charset: "utf8",
})
db, _ := gdb.New()
db.SetDebug(true)
r, e := db.Table("user").Data(g.Map{
"create_at": "now()",
}).Unscoped().Insert()
if e != nil {
panic(e)
}
if r != nil {
fmt.Println(r.LastInsertId())
}
}

View File

@ -0,0 +1,50 @@
package main
import (
"fmt"
"github.com/gogf/gf/frame/g"
)
var (
tableName = "orders"
dao = g.DB().Table(tableName).Safe()
)
type OrderServiceEntity struct {
GoodsPrice float64 `json:"goods_price" gvalid:"required"`
PayTo int8 `json:"payTo" gvalid:"required"`
PayStatus int8 `json:"payStatus" `
CreateTime string `json:"createTime" `
AppId string `json:"appId" gvalid:"required"`
PayUser string `json:"pay_user" gvalid:"required"`
QrUrl string `json:"qr_url" `
}
type Create struct {
Id int64 `json:"id" gconv:"id"`
GoodsPrice float64 `json:"goodsPrice" gconv:"goods_price"`
PayTo int8 `json:"payTo" gconv:"pay_to"`
PayStatus int8 `json:"payStatus" gconv:"pay_status"`
CreateTime string `json:"createTime" gconv:"create_time"`
UserId int `json:"user_id" `
PayUser string `json:"pay_user" `
QrUrl string `json:"qr_url" `
}
func main() {
g.DB().SetDebug(true)
userInfo := Create{
Id: 3,
}
orderService := OrderServiceEntity{
GoodsPrice: 0.1,
PayTo: 1,
}
size, err := dao.Where("user_id", userInfo.Id).
And("goods_price", float64(100.10)).
And("pay_status", 0).
And("pay_to", orderService.PayTo).Count()
fmt.Println(err)
fmt.Println(size)
}

View File

@ -2,9 +2,10 @@ package main
import (
"fmt"
"github.com/gogf/gf/g"
"github.com/gogf/gf/g/database/gdb"
"github.com/gogf/gf/g/encoding/gparser"
"github.com/gogf/gf/database/gdb"
"github.com/gogf/gf/encoding/gparser"
"github.com/gogf/gf/frame/g"
)
func main() {

View File

@ -0,0 +1,22 @@
package main
import (
"time"
"github.com/gogf/gf/frame/g"
)
func main() {
db := g.DB()
// 开启调试模式以便于记录所有执行的SQL
db.SetDebug(true)
for {
for i := 0; i < 10; i++ {
go db.Table("user").All()
}
time.Sleep(time.Millisecond * 100)
}
}

View File

@ -0,0 +1,18 @@
package main
import (
"fmt"
"github.com/gogf/gf/frame/g"
"time"
)
func main() {
db := g.DB()
db.SetDebug(true)
for {
r, err := db.Table("user").All()
fmt.Println(err)
fmt.Println(r)
time.Sleep(time.Second * 10)
}
}

View File

@ -0,0 +1,23 @@
package main
import (
"fmt"
"github.com/gogf/gf/frame/g"
)
func main() {
db := g.DB()
// 开启调试模式以便于记录所有执行的SQL
db.SetDebug(true)
type User struct {
Uid int
Name string
}
user := (*User)(nil)
fmt.Println(user)
err := db.Table("test").Where("id=1").Struct(&user)
fmt.Println(err)
fmt.Println(user)
}

View File

@ -0,0 +1,18 @@
package main
import (
"github.com/gogf/gf/frame/g"
)
func main() {
db := g.DB()
db.SetDebug(true)
tables, err := db.Tables()
if err != nil {
panic(err)
}
if tables != nil {
g.Dump(tables)
}
}

View File

@ -0,0 +1,25 @@
package main
import (
"github.com/gogf/gf/frame/g"
)
func main() {
db := g.DB()
db.SetDebug(true)
tables, e := db.Tables()
if e != nil {
panic(e)
}
if tables != nil {
g.Dump(tables)
for _, table := range tables {
fields, err := db.TableFields(table)
if err != nil {
panic(err)
}
g.Dump(fields)
}
}
}

View File

@ -0,0 +1,34 @@
package main
import (
"database/sql"
"github.com/gogf/gf/os/gfile"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/frame/g"
)
func main() {
db := g.DB()
table := "medicine_clinics_upload_yinchuan"
list, err := db.Table(table).All()
if err != nil && err != sql.ErrNoRows {
panic(err)
}
content := ""
for _, item := range list {
if j, err := gjson.DecodeToJson(item["upload_data"].String()); err != nil {
panic(err)
} else {
s, _ := j.ToJsonIndentString()
content += item["id"].String() + "\t" + item["medicine_clinic_id"].String() + "\t"
content += s
content += "\n\n"
//if _, err := db.Table(table).Data("data_decode", s).Where("id", item["id"].Int()).Update(); err != nil {
// panic(err)
//}
}
}
gfile.PutContents("/Users/john/Temp/medicine_clinics_upload_yinchuan.txt", content)
}

View File

@ -2,7 +2,8 @@ package main
import (
"fmt"
"github.com/gogf/gf/g"
"github.com/gogf/gf/frame/g"
)
func main() {

View File

@ -0,0 +1,15 @@
package main
import (
"fmt"
"github.com/gogf/gf/frame/g"
)
func main() {
one, err := g.DB().Table("carlist c").
LeftJoin("cardetail d", "c.postid=d.carid").
Where("c.postid", "142039140032006").
Fields("c.*,d.*").One()
fmt.Println(err)
g.Dump(one)
}

View File

@ -0,0 +1,34 @@
package main
import (
"github.com/gogf/gf/frame/g"
"time"
)
func test1() {
db := g.DB()
db.SetDebug(true)
time.Sleep(1 * time.Minute)
r, e := db.Table("test").Where("id", 10000).Count()
if e != nil {
panic(e)
}
g.Dump(r)
}
func test2() {
db := g.DB()
db.SetDebug(true)
dao := db.Table("test").Safe()
time.Sleep(1 * time.Minute)
r, e := dao.Where("id", 10000).Count()
if e != nil {
panic(e)
}
g.Dump(r)
}
func main() {
test1()
test2()
}

View File

@ -0,0 +1,565 @@
package main
import (
"fmt"
"time"
//_ "github.com/mattn/go-oci8"
"github.com/gogf/gf/database/gdb"
"github.com/gogf/gf/frame/g"
)
// 本文件用于gf框架的mysql数据库操作示例不作为单元测试使用
var db gdb.DB
// 初始化配置及创建数据库
func init() {
gdb.AddDefaultConfigNode(gdb.ConfigNode{
Host: "192.168.146.0",
Port: "1521",
User: "test",
Pass: "test",
Name: "orcl",
Type: "oracle",
Role: "master",
})
db, _ = gdb.New()
//gins.Config().SetPath("/home/john/Workspace/Go/GOPATH/src/github.com/gogf/gf/.example/frame")
//db = g.Database()
//gdb.SetConfig(gdb.ConfigNode {
// Host : "127.0.0.1",
// Port : 3306,
// User : "root",
// Pass : "123456",
// Name : "test",
// Type : "mysql",
//})
//db, _ = gdb.Instance()
//gdb.SetConfig(gdb.Config {
// "default" : gdb.ConfigGroup {
// gdb.ConfigNode {
// Host : "127.0.0.1",
// Port : "3306",
// User : "root",
// Pass : "123456",
// Name : "test",
// Type : "mysql",
// Role : "master",
// Weight : 100,
// },
// gdb.ConfigNode {
// Host : "127.0.0.2",
// Port : "3306",
// User : "root",
// Pass : "123456",
// Name : "test",
// Type : "mysql",
// Role : "master",
// Weight : 100,
// },
// gdb.ConfigNode {
// Host : "127.0.0.3",
// Port : "3306",
// User : "root",
// Pass : "123456",
// Name : "test",
// Type : "mysql",
// Role : "master",
// Weight : 100,
// },
// gdb.ConfigNode {
// Host : "127.0.0.4",
// Port : "3306",
// User : "root",
// Pass : "123456",
// Name : "test",
// Type : "mysql",
// Role : "master",
// Weight : 100,
// },
// },
//})
//db, _ = gdb.Instance()
}
// 创建测试数据库
func create() error {
fmt.Println("drop table aa_user:")
_, err := db.Exec("drop table aa_user")
if err != nil {
fmt.Println("drop table aa_user error.", err)
}
s := `
CREATE TABLE aa_user (
id number(10) not null,
name VARCHAR2(45),
age number(8),
addr varchar2(60),
amt number(12,2),
PRIMARY KEY (id)
)
`
fmt.Println("create table aa_user:")
_, err = db.Exec(s)
if err != nil {
fmt.Println("create table error.", err)
return err
}
_, err = db.Exec("drop sequence id_seq")
if err != nil {
fmt.Println("drop sequence id_seq", err)
}
/*fmt.Println("create sequence id_seq")
_, err = db.Exec("create sequence id_seq increment by 1 start with 1 maxvalue 9999999999 cycle cache 10")
if err != nil {
fmt.Println("create sequence id_seq error.", err)
return err
}
s = `
CREATE TRIGGER id_trigger before insert on aa_user for each row
begin
select id_seq.nextval into :new.id from dual;
end;
`
_, err = db.Exec(s)
if err != nil {
fmt.Println("create trigger error.", err)
return err
}*/
_, err = db.Exec("drop table user_detail")
if err != nil {
fmt.Println("drop table user_detail", err)
}
s = `
CREATE TABLE user_detail (
id number(10) not null,
site VARCHAR2(255),
PRIMARY KEY (id)
)
`
fmt.Println("create table user_detail:")
_, err = db.Exec(s)
if err != nil {
fmt.Println("create table user_detail error.", err)
return err
}
fmt.Println("create table success.")
return nil
}
// 数据写入
func insert(id int) {
fmt.Println("insert:")
r, err := db.Insert("aa_user", gdb.Map{
"id": id,
"name": "john",
"age": id,
})
fmt.Println(r.LastInsertId())
fmt.Println(r.RowsAffected())
if err == nil {
r, err = db.Insert("user_detail", gdb.Map{
"id": id,
"site": "http://johng.cn",
})
if err == nil {
fmt.Printf("id: %d\n", id)
} else {
fmt.Println(err)
}
} else {
fmt.Println(err)
}
fmt.Println()
}
// 基本sql查询
func query() {
fmt.Println("query:")
list, err := db.GetAll("select * from aa_user")
if err == nil {
fmt.Println(list)
} else {
fmt.Println(err)
}
list, err = db.Table("aa_user").OrderBy("id").Limit(0, 2).Select()
if err == nil {
fmt.Println(list)
} else {
fmt.Println(err)
}
fmt.Println()
}
// replace into
func replace() {
fmt.Println("replace:")
r, err := db.Save("aa_user", gdb.Map{
"id": 1,
"name": "john",
})
if err == nil {
fmt.Println(r.LastInsertId())
fmt.Println(r.RowsAffected())
} else {
fmt.Println(err)
}
fmt.Println()
}
// 数据保存
func save() {
fmt.Println("save:")
r, err := db.Save("aa_user", gdb.Map{
"id": 1,
"name": "john",
})
if err == nil {
fmt.Println(r.LastInsertId())
fmt.Println(r.RowsAffected())
} else {
fmt.Println(err)
}
fmt.Println()
}
// 批量写入
func batchInsert() {
fmt.Println("batchInsert:")
_, err := db.BatchInsert("aa_user", gdb.List{
{"id": 11, "name": "batchInsert_john_1", "age": 11, "amt": 11.11},
{"id": 12, "name": "batchInsert_john_2", "age": 12, "amt": 12.12},
{"id": 13, "name": "batchInsert_john_3", "age": 13, "amt": 13.13},
{"id": 14, "name": "batchInsert_john_4", "age": 14, "amt": 14.14},
}, 10)
if err != nil {
fmt.Println(err)
}
fmt.Println()
}
// 数据更新
func update1() {
fmt.Println("update1:")
r, err := db.Update("aa_user", gdb.Map{"name": "john1", "age": 1}, "id=?", 1)
if err == nil {
fmt.Println(r.LastInsertId())
fmt.Println(r.RowsAffected())
} else {
fmt.Println(err)
}
fmt.Println()
}
// 数据更新
func update2() {
fmt.Println("update2:")
r, err := db.Update("aa_user", gdb.Map{"name": "john6", "age": 6}, "id=?", 2)
if err == nil {
fmt.Println(r.LastInsertId())
fmt.Println(r.RowsAffected())
} else {
fmt.Println(err)
}
fmt.Println()
}
// 数据更新
func update3() {
fmt.Println("update3:")
r, err := db.Update("aa_user", "name=?", "id=?", "john2", 3)
if err == nil {
fmt.Println(r.LastInsertId())
fmt.Println(r.RowsAffected())
} else {
fmt.Println(err)
}
fmt.Println()
}
// 链式查询操作1
func linkopSelect1() {
fmt.Println("linkopSelect1:")
r, err := db.Table("aa_user u").LeftJoin("user_detail ud", "u.id=ud.id").Fields("u.*, ud.site").Where("u.id > ?", 1).Limit(0, 2).Select()
if err == nil {
fmt.Println(r)
} else {
fmt.Println(err)
}
fmt.Println()
}
// 链式查询操作2
func linkopSelect2() {
fmt.Println("linkopSelect2:")
r, err := db.Table("aa_user u").LeftJoin("user_detail ud", "u.id=ud.id").Fields("u.*,ud.site").Where("u.id=?", 1).One()
if err == nil {
fmt.Println(r)
} else {
fmt.Println(err)
}
fmt.Println()
}
// 链式查询操作3
func linkopSelect3() {
fmt.Println("linkopSelect3:")
r, err := db.Table("aa_user u").LeftJoin("user_detail ud", "u.id=ud.id").Fields("ud.site").Where("u.id=?", 1).Value()
if err == nil {
fmt.Println(r.String())
} else {
fmt.Println(err)
}
fmt.Println()
}
// 链式查询数量1
func linkopCount1() {
fmt.Println("linkopCount1:")
r, err := db.Table("aa_user u").LeftJoin("user_detail ud", "u.id=ud.id").Where("name like ?", "john").Count()
if err == nil {
fmt.Println(r)
} else {
fmt.Println(err)
}
fmt.Println()
}
// 错误操作
func linkopUpdate1() {
fmt.Println("linkopUpdate1:")
r, err := db.Table("henghe_setting").Update()
if err == nil {
fmt.Println(r.RowsAffected())
} else {
fmt.Println("error", err)
}
fmt.Println()
}
// 通过Map指针方式传参方式
func linkopUpdate2() {
fmt.Println("linkopUpdate2:")
r, err := db.Table("aa_user").Data(gdb.Map{"name": "john2"}).Where("name=?", "john").Update()
if err == nil {
fmt.Println(r.RowsAffected())
} else {
fmt.Println(err)
}
fmt.Println()
}
// 通过字符串方式传参
func linkopUpdate3() {
fmt.Println("linkopUpdate3:")
r, err := db.Table("aa_user").Data("name='john3'").Where("name=?", "john2").Update()
if err == nil {
fmt.Println(r.RowsAffected())
} else {
fmt.Println(err)
}
fmt.Println()
}
// Where条件使用Map
func linkopUpdate4() {
fmt.Println("linkopUpdate4:")
r, err := db.Table("aa_user").Data(gdb.Map{"name": "john11111"}).Where(g.Map{"id": 1}).Update()
if err == nil {
fmt.Println(r.RowsAffected())
} else {
fmt.Println(err)
}
fmt.Println()
}
// 链式批量写入
func linkopBatchInsert1() {
fmt.Println("linkopBatchInsert1:")
r, err := db.Table("aa_user").Filter().Data(gdb.List{
{"id": 21, "name": "linkopBatchInsert1_john_1", "amt": 21.21, "tt": "haha"},
{"id": 22, "name": "linkopBatchInsert1_john_2", "amt": 22.22, "cc": "hahacc"},
{"id": 23, "name": "linkopBatchInsert1_john_3", "amt": 23.23, "bb": "hahabb"},
{"id": 24, "name": "linkopBatchInsert1_john_4", "amt": 24.24, "aa": "hahaaa"},
}).Insert()
if err == nil {
fmt.Println(r.RowsAffected())
} else {
fmt.Println(err)
}
fmt.Println()
}
// 链式批量写入,指定每批次写入的条数
func linkopBatchInsert2() {
fmt.Println("linkopBatchInsert2:")
r, err := db.Table("aa_user").Data(gdb.List{
{"id": 25, "name": "linkopBatchInsert2john_1"},
{"id": 26, "name": "linkopBatchInsert2john_2"},
{"id": 27, "name": "linkopBatchInsert2john_3"},
{"id": 28, "name": "linkopBatchInsert2john_4"},
}).Batch(2).Insert()
if err == nil {
fmt.Println(r.RowsAffected())
} else {
fmt.Println(err)
}
fmt.Println()
}
// 链式批量保存
func linkopBatchSave() {
fmt.Println("linkopBatchSave:")
r, err := db.Table("aa_user").Data(gdb.List{
{"id": 1, "name": "john_1"},
{"id": 2, "name": "john_2"},
{"id": 3, "name": "john_3"},
{"id": 4, "name": "john_4"},
}).Save()
if err == nil {
fmt.Println(r.RowsAffected())
} else {
fmt.Println(err)
}
fmt.Println()
}
// 事务操作示例1
func transaction1() {
fmt.Println("transaction1:")
if tx, err := db.Begin(); err == nil {
r, err := tx.Insert("aa_user", gdb.Map{
"id": 30,
"name": "transaction1",
})
tx.Rollback()
fmt.Println(r, err)
}
fmt.Println()
}
// 事务操作示例2
func transaction2() {
fmt.Println("transaction2:")
if tx, err := db.Begin(); err == nil {
r, err := tx.Table("user_detail").Data(gdb.Map{"id": 5, "site": "www.baidu.com哈哈哈*?~!@#$%^&*()"}).Insert()
tx.Commit()
fmt.Println(r, err)
}
fmt.Println()
}
// 主从io复用测试在mysql中使用 show full processlist 查看链接信息
func keepPing() {
fmt.Println("keepPing:")
for i := 0; i < 30; i++ {
fmt.Println("ping...", i)
err := db.PingMaster()
if err != nil {
fmt.Println(err)
return
}
err = db.PingSlave()
if err != nil {
fmt.Println(err)
return
}
time.Sleep(1 * time.Second)
}
}
// like语句查询
func likeQuery() {
fmt.Println("likeQuery:")
if r, err := db.Table("aa_user").Where("name like ?", "%john%").Select(); err == nil {
fmt.Println(r)
} else {
fmt.Println(err)
}
}
// mapToStruct
func mapToStruct() {
type User struct {
Id int
Name string
Age int
Addr string
}
fmt.Println("mapToStruct:")
if r, err := db.Table("aa_user").Where("id=?", 1).One(); err == nil {
u := User{}
if err := r.ToStruct(&u); err == nil {
fmt.Println(r)
fmt.Println(u)
} else {
fmt.Println(err)
}
} else {
fmt.Println(err)
}
}
func main() {
db.PingMaster()
db.SetDebug(true)
/*err := create()
if err != nil {
return
}*/
//test1
/*for i := 1; i < 5; i++ {
insert(i)
}
query()
*/
//batchInsert()
//query()
//replace()
//save()
//update1()
//update2()
//update3()
/*linkopSelect1()
linkopSelect2()
linkopSelect3()
linkopCount1()
*/
/*linkopUpdate1()
linkopUpdate2()
linkopUpdate3()
linkopUpdate4()
*/
linkopBatchInsert1()
query()
//linkopBatchInsert2()
//transaction1()
//transaction2()
//
//keepPing()
//likeQuery()
//mapToStruct()
//getQueriedSqls()
}

View File

@ -0,0 +1,47 @@
package main
import (
"fmt"
"github.com/gogf/gf/database/gdb"
"github.com/gogf/gf/frame/g"
_ "github.com/mattn/go-sqlite3"
)
func main() {
gdb.SetConfig(gdb.Config{
"default": gdb.ConfigGroup{
gdb.ConfigNode{
Name: "/tmp/my.db",
Type: "sqlite",
},
},
})
db := g.DB()
if db == nil {
panic("db create failed")
}
// 创建表
sql := `CREATE TABLE user (
uid INT PRIMARY KEY NOT NULL,
name VARCHAR(30) NOT NULL
);`
if _, err := db.Exec(sql); err != nil {
fmt.Println(err)
}
// 写入数据
result, err := db.Table("user").Data(g.Map{"uid": 1, "name": "john"}).Save()
if err == nil {
fmt.Println(result.RowsAffected())
} else {
fmt.Println(err)
}
// 删除表
sql = `DROP TABLE user;`
if _, err := db.Exec(sql); err != nil {
fmt.Println(err)
}
}

View File

@ -0,0 +1,20 @@
package main
import (
"fmt"
"github.com/gogf/gf/database/gredis"
"github.com/gogf/gf/util/gconv"
)
// 使用原生gredis.New操作redis但是注意需要自己调用Close方法关闭redis链接池
func main() {
redis := gredis.New(gredis.Config{
Host: "127.0.0.1",
Port: 6379,
})
defer redis.Close()
redis.Do("SET", "k", "v")
v, _ := redis.Do("GET", "k")
fmt.Println(gconv.String(v))
}

View File

@ -2,8 +2,9 @@ package main
import (
"fmt"
"github.com/gogf/gf/g"
"github.com/gogf/gf/g/util/gconv"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/util/gconv"
)
// 使用框架封装的g.Redis()方法获得redis操作对象单例不需要开发者显示调用Close方法

View File

@ -0,0 +1,16 @@
package main
import (
"fmt"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/util/gconv"
)
func main() {
conn := g.Redis().Conn()
defer conn.Close()
conn.Do("SET", "k", "v")
v, _ := conn.Do("GET", "k")
fmt.Println(gconv.String(v))
}

View File

@ -2,7 +2,8 @@ package main
import (
"fmt"
"github.com/gogf/gf/g"
"github.com/gogf/gf/frame/g"
)
func main() {

View File

@ -2,8 +2,9 @@ package main
import (
"fmt"
"github.com/gogf/gf/g"
"github.com/gogf/gf/g/util/gconv"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/util/gconv"
)
func main() {

View File

@ -2,7 +2,8 @@ package main
import (
"fmt"
"github.com/gogf/gf/g"
"github.com/gogf/gf/frame/g"
)
func main() {

View File

@ -2,8 +2,9 @@ package main
import (
"fmt"
"github.com/gogf/gf/g"
"github.com/gogf/gf/g/util/gconv"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/util/gconv"
)
func main() {

View File

@ -2,7 +2,8 @@ package main
import (
"fmt"
"github.com/gogf/gf/g"
"github.com/gogf/gf/frame/g"
)
func main() {

View File

@ -0,0 +1,12 @@
package main
import (
"fmt"
"github.com/gogf/gf/debug/gdebug"
)
func main() {
gdebug.PrintStack()
fmt.Println(gdebug.CallerPackage())
fmt.Println(gdebug.CallerFunction())
}

View File

@ -0,0 +1,10 @@
package main
import (
"fmt"
"github.com/gogf/gf/debug/gdebug"
)
func main() {
fmt.Println(gdebug.BuildInfo())
}

View File

@ -0,0 +1,16 @@
package gbase64
import (
"fmt"
"github.com/gogf/gf/encoding/gbase64"
)
func main() {
s := "john"
b := gbase64.Encode(s)
c, e := gbase64.Decode(b)
fmt.Println(b)
fmt.Println(c)
fmt.Println(e)
}

View File

@ -2,32 +2,26 @@ package main
import (
"fmt"
"github.com/gogf/gf/g/encoding/gbinary"
"github.com/gogf/gf/g/os/glog"
"github.com/gogf/gf/encoding/gbinary"
"github.com/gogf/gf/os/glog"
)
func main() {
// 使用gbinary.Encoded对基本数据类型进行二进制打包
if buffer, err := gbinary.Encode(18, 300, 1.01); err != nil {
glog.Error(err)
} else {
fmt.Println(buffer)
}
fmt.Println(gbinary.Encode(18, 300, 1.01))
// 使用gbinary.Decode对整形二进制解包注意第二个及其后参数为字长确定的整形变量的指针地址字长确定的类型
// 例如int8/16/32/64、uint8/16/32/64、float32/64
// 这里的1.01默认为float64类型(64位系统下)
if buffer, err := gbinary.Encode(18, 300, 1.01); err != nil {
buffer := gbinary.Encode(18, 300, 1.01)
var i1 int8
var i2 int16
var f3 float64
if err := gbinary.Decode(buffer, &i1, &i2, &f3); err != nil {
glog.Error(err)
} else {
var i1 int8
var i2 int16
var f3 float64
if err := gbinary.Decode(buffer, &i1, &i2, &f3); err != nil {
glog.Error(err)
} else {
fmt.Println(i1, i2, f3)
}
fmt.Println(i1, i2, f3)
}
// 编码/解析 int自动识别变量长度

View File

@ -2,7 +2,8 @@ package main
import (
"fmt"
"github.com/gogf/gf/g/encoding/gbinary"
"github.com/gogf/gf/encoding/gbinary"
)
func main() {

View File

@ -2,7 +2,8 @@ package main
import (
"fmt"
"github.com/gogf/gf/g/encoding/gbinary"
"github.com/gogf/gf/encoding/gbinary"
)
func main() {

View File

@ -0,0 +1,20 @@
package main
import (
"fmt"
"github.com/gogf/gf/frame/g"
)
func main() {
fmt.Println(g.Config().Get("redis"))
type RedisConfig struct {
Disk string
Cache string
}
redisCfg := new(RedisConfig)
fmt.Println(g.Config().GetStruct("redis", redisCfg))
fmt.Println(redisCfg)
}

View File

@ -0,0 +1,20 @@
package main
import (
"fmt"
"github.com/gogf/gf/encoding/gcharset"
)
func main() {
src := "~{;(<dR;:x>F#,6@WCN^O`GW!#"
srcCharset := "GB2312"
dstCharset := "UTF-8"
str, err := gcharset.Convert(dstCharset, srcCharset, src)
if err != nil {
panic(err)
}
fmt.Println(str)
// output:
// 花间一壶酒,独酌无相亲。
}

View File

@ -0,0 +1,15 @@
package main
import (
"fmt"
"github.com/gogf/gf/encoding/gcompress"
)
func main() {
err := gcompress.UnZipFile(
`D:\Workspace\Go\GOPATH\src\github.com\gogf\gf\geg\encoding\gcompress\data.zip`,
`D:\Workspace\Go\GOPATH\src\github.com\gogf\gf\geg`,
)
fmt.Println(err)
}

View File

@ -0,0 +1,16 @@
package main
import (
"fmt"
"github.com/gogf/gf/encoding/gcompress"
"github.com/gogf/gf/os/gfile"
)
func main() {
err := gcompress.UnZipContent(
gfile.GetBytes(`D:\Workspace\Go\GOPATH\src\github.com\gogf\gf\geg\encoding\gcompress\data.zip`),
`D:\Workspace\Go\GOPATH\src\github.com\gogf\gf\geg`,
)
fmt.Println(err)
}

View File

@ -0,0 +1,68 @@
package main
import (
"archive/zip"
"fmt"
"github.com/gogf/gf/encoding/gcompress"
"io"
"os"
"path/filepath"
"strings"
)
// srcFile could be a single file or a directory
func Zip(srcFile string, destZip string) error {
zipfile, err := os.Create(destZip)
if err != nil {
return err
}
defer zipfile.Close()
archive := zip.NewWriter(zipfile)
defer archive.Close()
filepath.Walk(srcFile, func(path string, info os.FileInfo, err error) error {
if err != nil {
return err
}
header, err := zip.FileInfoHeader(info)
if err != nil {
return err
}
header.Name = strings.TrimPrefix(path, filepath.Dir(srcFile)+"/")
// header.Name = path
if info.IsDir() {
header.Name += "/"
} else {
header.Method = zip.Deflate
}
writer, err := archive.CreateHeader(header)
if err != nil {
return err
}
if !info.IsDir() {
file, err := os.Open(path)
if err != nil {
return err
}
defer file.Close()
_, err = io.Copy(writer, file)
}
return err
})
return err
}
func main() {
src := `/Users/john/Workspace/Go/GOPATH/src/github.com/gogf/gf/test`
dst := `/Users/john/Workspace/Go/GOPATH/src/github.com/gogf/gf/test.zip`
//src := `/Users/john/Workspace/Go/GOPATH/src/github.com/gogf/gf/README.MD`
//dst := `/Users/john/Workspace/Go/GOPATH/src/github.com/gogf/gf/README.MD.zip`
fmt.Println(gcompress.ZipPath(src, dst))
//fmt.Println(Zip(src, dst))
}

View File

@ -0,0 +1,20 @@
package main
import (
"fmt"
"strconv"
"github.com/gogf/gf/encoding/ghash"
)
func main() {
m := make(map[uint64]bool)
for i := 0; i < 100000000; i++ {
hash := ghash.BKDRHash64([]byte("key_" + strconv.Itoa(i)))
if _, ok := m[hash]; ok {
fmt.Printf("duplicated hash %d\n", hash)
} else {
m[hash] = true
}
}
}

View File

@ -0,0 +1,16 @@
package main
import (
"fmt"
"github.com/gogf/gf/encoding/gini"
)
func main() {
s := `
a = b
`
m, err := gini.Decode([]byte(s))
fmt.Println(err)
fmt.Println(m)
}

View File

@ -0,0 +1,155 @@
package main
import (
"fmt"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/os/glog"
"github.com/gogf/gf/os/gtime"
)
func getByPattern() {
data :=
`{
"users" : {
"count" : 100,
"list" : [
{"name" : "小明", "score" : 60},
{"name" : "John", "score" : 99.5}
]
}
}`
j, err := gjson.DecodeToJson([]byte(data))
if err != nil {
glog.Error(err)
} else {
fmt.Println("John Score:", j.GetFloat32("users.list.1.score"))
}
}
// 当键名存在"."号时,检索优先级:键名->层级,因此不会引起歧义
func testMultiDots() {
data :=
`{
"users" : {
"count" : 100
},
"users.count" : 101
}`
j, err := gjson.DecodeToJson([]byte(data))
if err != nil {
glog.Error(err)
} else {
fmt.Println("Users Count:", j.GetInt("users.count"))
}
}
// 设置数据
func testSet() {
data :=
`{
"users" : {
"count" : 100
}
}`
j, err := gjson.DecodeToJson([]byte(data))
if err != nil {
glog.Error(err)
} else {
j.Set("users.count", 1)
j.Set("users.list", []string{"John", "小明"})
c, _ := j.ToJson()
fmt.Println(string(c))
}
}
// 将Json数据转换为其他数据格式
func testConvert() {
data :=
`{
"users" : {
"count" : 100,
"list" : ["John", "小明"]
}
}`
j, err := gjson.DecodeToJson([]byte(data))
if err != nil {
glog.Error(err)
} else {
c, _ := j.ToJson()
fmt.Println("JSON:")
fmt.Println(string(c))
fmt.Println("======================")
fmt.Println("XML:")
c, _ = j.ToXmlIndent()
fmt.Println(string(c))
fmt.Println("======================")
fmt.Println("YAML:")
c, _ = j.ToYaml()
fmt.Println(string(c))
fmt.Println("======================")
fmt.Println("TOML:")
c, _ = j.ToToml()
fmt.Println(string(c))
}
}
func testSplitChar() {
var v interface{}
j := gjson.New(nil)
t1 := gtime.TimestampNano()
j.Set("a.b.c.d.e.f.g.h.i.j.k", 1)
t2 := gtime.TimestampNano()
fmt.Println(t2 - t1)
t5 := gtime.TimestampNano()
v = j.Get("a.b.c.d.e.f.g.h.i.j.k")
t6 := gtime.TimestampNano()
fmt.Println(v)
fmt.Println(t6 - t5)
j.SetSplitChar('#')
t7 := gtime.TimestampNano()
v = j.Get("a#b#c#d#e#f#g#h#i#j#k")
t8 := gtime.TimestampNano()
fmt.Println(v)
fmt.Println(t8 - t7)
}
func testViolenceCheck() {
j := gjson.New(nil)
t1 := gtime.TimestampNano()
j.Set("a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a", 1)
t2 := gtime.TimestampNano()
fmt.Println(t2 - t1)
t3 := gtime.TimestampNano()
j.Set("a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a", 1)
t4 := gtime.TimestampNano()
fmt.Println(t4 - t3)
t5 := gtime.TimestampNano()
j.Get("a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a")
t6 := gtime.TimestampNano()
fmt.Println(t6 - t5)
j.SetViolenceCheck(false)
t7 := gtime.TimestampNano()
j.Set("a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a", 1)
t8 := gtime.TimestampNano()
fmt.Println(t8 - t7)
t9 := gtime.TimestampNano()
j.Get("a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a")
t10 := gtime.TimestampNano()
fmt.Println(t10 - t9)
}
func main() {
testViolenceCheck()
}

View File

@ -0,0 +1,156 @@
package main
import (
"encoding/json"
"fmt"
"github.com/gogf/gf/encoding/gjson"
)
type XinYanModel struct {
Success bool `json:"success"`
Data Data `json:"data"`
ErrorCode interface{} `json:"errorCode"`
ErrorMsg interface{} `json:"errorMsg"`
}
type ApplyReportDetail struct {
ApplyScore string `json:"apply_score"`
ApplyCredibility string `json:"apply_credibility"`
QueryOrgCount string `json:"apply_query_org_count"`
QueryFinanceCount string `json:"apply_query_finance_count"`
QueryCashCount string `json:"apply_query_cash_count"`
QuerySumCount string `json:"apply_query_sum_count"`
LatestQueryTime string `json:"apply_latest_query_time"`
LatestOneMonth string `json:"apply_latest_one_month"`
LatestThreeMonth string `json:"apply_latest_three_month"`
LatestSixMonth string `json:"apply_latest_six_month"`
}
type BehaviorReportDetail struct {
LoansScore string `json:"behavior_report_detailloans_score"`
LoansCredibility string `json:"behavior_report_detailloans_credibility"`
LoansCount string `json:"behavior_report_detailloans_count"`
LoansSettleCount string `json:"behavior_report_detailloans_settle_count"`
LoansOverdueCount string `json:"behavior_report_detailloans_overdue_count"`
LoansOrgCount string `json:"behavior_report_detailloans_org_count"`
ConsfinOrgCount string `json:"behavior_report_detailconsfin_org_count"`
LoansCashCount string `json:"behavior_report_detailloans_cash_count"`
LatestOneMonth string `json:"behavior_report_detaillatest_one_month"`
LatestThreeMonth string `json:"behavior_report_detaillatest_three_month"`
LatestSixMonth string `json:"behavior_report_detaillatest_six_month"`
HistorySucFee string `json:"behavior_report_detailhistory_suc_fee"`
HistoryFailFee string `json:"behavior_report_detailhistory_fail_fee"`
LatestOneMonthSuc string `json:"behavior_report_detaillatest_one_month_suc"`
LatestOneMonthFail string `json:"behavior_report_detaillatest_one_month_fail"`
LoansLongTime string `json:"behavior_report_detailloans_long_time"`
LoansLatestTime string `json:"behavior_report_detailloans_latest_time"`
}
type CurrentReportDetail struct {
LoansCreditLimit string `json:"current_report_detailloans_credit_limit"`
LoansCredibility string `json:"current_report_detailloans_credibility"`
LoansOrgCount string `json:"current_report_detailloans_org_count"`
LoansProductCount string `json:"current_report_detailloans_product_count"`
LoansMaxLimit string `json:"current_report_detailloans_max_limit"`
LoansAvgLimit string `json:"current_report_detailloans_avg_limit"`
ConsfinCreditLimit string `json:"current_report_detailconsfin_credit_limit"`
ConsfinCredibility string `json:"current_report_detailconsfin_credibility"`
ConsfinOrgCount string `json:"current_report_detailconsfin_org_count"`
ConsfinProductCount string `json:"current_report_detailconsfin_product_count"`
ConsfinMaxLimit string `json:"current_report_detailconsfin_max_limit"`
ConsfinAvgLimit string `json:"current_report_detailconsfin_avg_limit"`
}
type ResultDetail struct {
ApplyReportDetail ApplyReportDetail `json:"apply_report_detail"`
BehaviorReportDetail BehaviorReportDetail `json:"behavior_report_detail"`
CurrentReportDetail CurrentReportDetail `json:"current_report_detail"`
}
type Data struct {
Code string `json:"code"`
Desc string `json:"desc1"`
TransID string `json:"trans_id"`
TradeNo string `json:"trade_no"`
Fee string `json:"fee"`
IDNo string `json:"id_no"`
IDName string `json:"id_name"`
Versions string `json:"versions"`
ResultDetail ResultDetail `json:"result_detail"`
}
var data = `{
"success": true,
"data": {
"code": "0",
"desc": "查询成功",
"trans_id": "14910304379231213",
"trade_no": "201704011507240100057329",
"fee": "Y",
"id_no": "0783231bcc39f4957e99907e02ae401c",
"id_name": "dd67a5943781369ddd7c594e231e9e70 ",
"versions": "1.0.0",
"result_detail":{
"apply_report_detail": {
"apply_score": "189",
"apply_credibility": "84",
"query_org_count": "7",
"query_finance_count": "2",
"query_cash_count": "2",
"query_sum_count": "13",
"latest_query_time": "2017-09-03",
"latest_one_month": "1",
"latest_three_month": "5",
"latest_six_month": "12"
},
"behavior_report_detail": {
"loans_score": "199",
"loans_credibility": "90",
"loans_count": "300",
"loans_settle_count": "280",
"loans_overdue_count": "20",
"loans_org_count": "5",
"consfin_org_count": "3",
"loans_cash_count": "2",
"latest_one_month": "3",
"latest_three_month": "20",
"latest_six_month": "23",
"history_suc_fee": "30",
"history_fail_fee": "25",
"latest_one_month_suc": "5",
"latest_one_month_fail": "20",
"loans_long_time": "130",
"loans_latest_time": "2017-09-16"
},
"current_report_detail": {
"loans_credit_limit": "1400",
"loans_credibility": "80",
"loans_org_count": "7",
"loans_product_count": "8",
"loans_max_limit": "2000",
"loans_avg_limit": "1000",
"consfin_credit_limit": "1500",
"consfin_credibility": "90",
"consfin_org_count": "8",
"consfin_product_count": "5",
"consfin_max_limit": "5000",
"consfin_avg_limit": "3000"
}
}
},
"errorCode": null,
"errorMsg": null
}`
func main() {
struct1 := new(XinYanModel)
err := json.Unmarshal([]byte(data), struct1)
fmt.Println(err)
fmt.Println(struct1)
fmt.Println()
struct2 := new(XinYanModel)
j, err := gjson.DecodeToJson(data)
fmt.Println(err)
fmt.Println(j.Get("data.desc"))
err = j.ToStruct(struct2)
fmt.Println(err)
fmt.Println(struct2)
}

View File

@ -0,0 +1,69 @@
package main
import (
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/os/glog"
)
type GameUser struct {
Uid int `json:"uid"`
Account string `json:"account"`
Tel string `json:"tel"`
Role string `json:"role"`
Vip int `json:"vip"`
GameLevel int `json:"gamelevel"`
Diamond int `json:"diamond"`
Coin int `json:"coin"`
Value int `json:"value"`
Area string `json:"area"`
ServerName string `json:"servername"`
Time int `json:"time"`
ClientInfo *ClientInfo `json:"client_info"`
}
type ClientInfo struct {
ClientGuid string `json:"client_guid"`
ClientType int `json:"client_type"`
ClientSDKVersion string `json:"client_sdk_version"`
ClientVersion string `json:"client_version"`
PackageId string `json:"packageid"`
PhoneType string `json:"phone_type"`
DevicesId string `json:"devices_id"`
ClientMac string `json:"client_mac"`
}
func main() {
s := `{
"uid":9527,
"account":"zhangsan",
"tel":"15248787",
"role":"test",
"vip":7,
"gamelevel":59,
"diamond ":59,
"coin ":59,
"value ":99,
"area":"s",
"servername":"灵动",
"time":15454878787,
"client_info": {
"client_guid": "aaaa",
"client_type": 1,
"client_sdk_version": "1.0.1",
"client_version": "1.0.1",
"packageid":"",
"phone_type": "vivi",
"devices_id":"",
"client_mac":""
}
}`
gameUser := &GameUser{}
err := gjson.DecodeTo(s, gameUser)
if err != nil {
glog.Error(err)
}
g.Dump(gameUser)
}

View File

@ -0,0 +1,19 @@
package main
import (
"fmt"
"github.com/gogf/gf/encoding/gjson"
)
func main() {
s := `
{"apiVersion":"v1","kind":"Service","metadata":{"labels":{"name":"http-daemon"},"name":"http-daemon","namespace":"default"},"spec":{"ports":[{"name":"http-daemon","port":8080,"protocol":"TCP","targetPort":9212}],"selector":{"app":"http-daemon","version":"v0930-082326"}}}
`
js, err := gjson.DecodeToJson(s)
if err != nil {
panic(err)
}
//g.Dump(js.ToMap())
y, _ := js.ToYamlString()
fmt.Println(y)
}

Some files were not shown because too many files have changed in this diff Show More