Compare commits

...

1044 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
916 changed files with 64782 additions and 32057 deletions

View File

@ -9,7 +9,7 @@ import (
func main() {
// 创建一个对象池过期时间为1000毫秒
p := gpool.New(1000, nil)
p := gpool.New(1000*time.Millisecond, nil)
// 从池中取一个对象返回nil及错误信息
fmt.Println(p.Get())

View File

@ -11,7 +11,7 @@ import (
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,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

@ -1,8 +1,3 @@
[database]
type = "mssql"
host = "127.0.0.1"
port = "1451"
user = "sa"
pass = "eno@123"
name = "frpc"
linkinfo = "mssql:user id=test;password=test1;server=122.152.202.91;port=1433;database=test;encrypt=disable"

View File

@ -2,13 +2,22 @@ package main
import (
"fmt"
"github.com/gogf/gf/os/gtime"
_ "github.com/denisenkom/go-mssqldb"
"github.com/gogf/gf/frame/g"
)
func main() {
r, err := g.DB().GetAll(`SELECT TOP 10 * FROM KF_PatInfo_Emergency`)
fmt.Println(err)
g.Dump(r.ToList())
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

@ -512,16 +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)
}
}
func main() {
db.PingMaster()

View File

@ -1,8 +1,18 @@
# MySQL数据库配置
# MySQL.
[database]
# debug = true
link = "mysql:root:12345678@tcp(127.0.0.1:3306)/test?parseTime=true&loc=Local"
[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]]

View File

@ -2,7 +2,6 @@ package main
import (
"fmt"
"github.com/gogf/gf/frame/g"
)
@ -11,11 +10,19 @@ func main() {
// 开启调试模式以便于记录所有执行的SQL
db.SetDebug(true)
r, e := db.Table("test").OrderBy("id asc").All()
r, e := db.GetAll("SELECT * from `user` where id in(?)", g.Slice{})
if e != nil {
panic(e)
fmt.Println(e)
}
if r != nil {
fmt.Println(r.ToList())
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,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

@ -3,6 +3,7 @@ package main
import (
"github.com/gogf/gf/database/gdb"
"github.com/gogf/gf/util/gutil"
"time"
)
func main() {
@ -10,7 +11,7 @@ func main() {
Host: "127.0.0.1",
Port: "3306",
User: "root",
Pass: "123456",
Pass: "12345678",
Name: "test",
Type: "mysql",
Role: "master",
@ -20,19 +21,20 @@ func main() {
if err != nil {
panic(err)
}
//db.GetCache().SetAdapter(adapter.NewRedis(g.Redis()))
// 开启调试模式以便于记录所有执行的SQL
db.SetDebug(true)
// 执行2次查询并将查询结果缓存3秒并可执行缓存名称(可选)
for i := 0; i < 2; i++ {
r, _ := db.Table("user").Cache(3, "vip-user").Where("uid=?", 1).One()
gutil.Dump(r.ToMap())
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("uid=?", 1).Update()
//db.Table("user").Cache(-1, "vip-user").Data(gdb.Map{"name": "smith"}).Where("id=?", 1).Update()
// 再次执行查询,启用查询缓存特性
r, _ := db.Table("user").Cache(3, "vip-user").Where("uid=?", 1).One()
gutil.Dump(r.ToMap())
//r, _ := db.Table("user").Cache(300000*time.Second, "vip-user").Where("id=?", 1).One()
//gutil.Dump(r.Map())
}

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

@ -3,7 +3,7 @@ package main
import (
"fmt"
"github.com/gogf/gf/database/gdb"
"time"
"github.com/gogf/gf/frame/g"
)
func main() {
@ -18,10 +18,9 @@ func main() {
db.SetDebug(true)
type User struct {
CreateTime time.Time `orm:"create_time"`
}
r, e := db.Table("user").Data(User{CreateTime: time.Now()}).Insert()
r, e := db.Table("user").Data(g.Map{
"create_at": "now()",
}).Unscoped().Insert()
if e != nil {
panic(e)
}

View File

@ -8,9 +8,6 @@ import (
func main() {
db := g.DB()
db.SetMaxIdleConnCount(10)
db.SetMaxOpenConnCount(10)
db.SetMaxConnLifetime(time.Minute)
// 开启调试模式以便于记录所有执行的SQL
db.SetDebug(true)
@ -19,7 +16,7 @@ func main() {
for i := 0; i < 10; i++ {
go db.Table("user").All()
}
time.Sleep(time.Second)
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

@ -1,24 +1,15 @@
package main
import (
"fmt"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/os/gtime"
)
func main() {
db := g.DB()
//db.SetDebug(true)
type User struct {
Id int
Name *gtime.Time
}
user := new(User)
e := db.Table("test").Where("id", 10000).Struct(user)
if e != nil {
panic(e)
}
g.Dump(user)
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

@ -513,16 +513,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)
}
}
func main() {
db.PingMaster()

View File

@ -1,16 +1,68 @@
package main
import (
"archive/zip"
"fmt"
"github.com/gogf/gf/encoding/gcompress"
"io"
"os"
"path/filepath"
"strings"
)
func main() {
err := gcompress.ZipPath(
`D:\Workspace\Go\GOPATH\src\github.com\gogf\gf\geg`,
`D:\Workspace\Go\GOPATH\src\github.com\gogf\gf\geg\encoding\gcompress\data.zip`,
"my-dir",
)
fmt.Println(err)
// 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

@ -100,53 +100,53 @@ func testConvert() {
func testSplitChar() {
var v interface{}
j := gjson.New(nil)
t1 := gtime.Nanosecond()
t1 := gtime.TimestampNano()
j.Set("a.b.c.d.e.f.g.h.i.j.k", 1)
t2 := gtime.Nanosecond()
t2 := gtime.TimestampNano()
fmt.Println(t2 - t1)
t5 := gtime.Nanosecond()
t5 := gtime.TimestampNano()
v = j.Get("a.b.c.d.e.f.g.h.i.j.k")
t6 := gtime.Nanosecond()
t6 := gtime.TimestampNano()
fmt.Println(v)
fmt.Println(t6 - t5)
j.SetSplitChar('#')
t7 := gtime.Nanosecond()
t7 := gtime.TimestampNano()
v = j.Get("a#b#c#d#e#f#g#h#i#j#k")
t8 := gtime.Nanosecond()
t8 := gtime.TimestampNano()
fmt.Println(v)
fmt.Println(t8 - t7)
}
func testViolenceCheck() {
j := gjson.New(nil)
t1 := gtime.Nanosecond()
t1 := gtime.TimestampNano()
j.Set("a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a", 1)
t2 := gtime.Nanosecond()
t2 := gtime.TimestampNano()
fmt.Println(t2 - t1)
t3 := gtime.Nanosecond()
t3 := gtime.TimestampNano()
j.Set("a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a", 1)
t4 := gtime.Nanosecond()
t4 := gtime.TimestampNano()
fmt.Println(t4 - t3)
t5 := gtime.Nanosecond()
t5 := gtime.TimestampNano()
j.Get("a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a")
t6 := gtime.Nanosecond()
t6 := gtime.TimestampNano()
fmt.Println(t6 - t5)
j.SetViolenceCheck(false)
t7 := gtime.Nanosecond()
t7 := gtime.TimestampNano()
j.Set("a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a", 1)
t8 := gtime.Nanosecond()
t8 := gtime.TimestampNano()
fmt.Println(t8 - t7)
t9 := gtime.Nanosecond()
t9 := gtime.TimestampNano()
j.Get("a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a")
t10 := gtime.Nanosecond()
t10 := gtime.TimestampNano()
fmt.Println(t10 - t9)
}

View File

@ -2,25 +2,14 @@ package main
import (
"fmt"
"github.com/gogf/gf/i18n/gi18n"
"github.com/gogf/gf/frame/g"
)
func main() {
t := gi18n.New()
t.SetPath("/Users/john/Workspace/Go/GOPATH/src/github.com/gogf/gf/.example/i18n/gi18n/i18n")
t.SetLanguage("en")
fmt.Println(t.Translate(`hello`))
fmt.Println(t.Translate(`{#hello}{#world}!`))
t.SetLanguage("ja")
fmt.Println(t.Translate(`hello`))
fmt.Println(t.Translate(`{#hello}{#world}!`))
t.SetLanguage("ru")
fmt.Println(t.Translate(`hello`))
fmt.Println(t.Translate(`{#hello}{#world}!`))
fmt.Println(t.Translate(`hello`, "zh-CN"))
fmt.Println(t.Translate(`{#hello}{#world}!`, "zh-CN"))
var (
orderId = 865271654
orderAmount = 99.8
)
fmt.Println(g.I18n().Tfl(`en`, `{#OrderPaid}`, orderId, orderAmount))
fmt.Println(g.I18n().Tfl(`zh-CN`, `{#OrderPaid}`, orderId, orderAmount))
}

View File

@ -1,3 +1 @@
hello = "Hello"
world = "World"
OrderPaid = "You have successfully complete order #%d payment, paid amount: ¥%0.2f."

View File

@ -1,2 +1 @@
hello = "你好"
world = "世界"
OrderPaid = "您已成功完成订单号 #%d 支付,支付金额¥%.2f。"

View File

@ -3,34 +3,16 @@ package main
import (
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/net/ghttp"
"github.com/gogf/gf/os/gfile"
"io"
)
// Upload uploads files to /tmp .
func Upload(r *ghttp.Request) {
saveDir := "/tmp/"
for _, item := range r.GetMultipartFiles("upload-file") {
file, err := item.Open()
if err != nil {
r.Response.Write(err)
return
}
defer file.Close()
f, err := gfile.Create(saveDir + gfile.Basename(item.Filename))
if err != nil {
r.Response.Write(err)
return
}
defer f.Close()
if _, err := io.Copy(f, file); err != nil {
r.Response.Write(err)
return
}
saveDirPath := "/tmp/"
files := r.GetUploadFiles("upload-file")
if _, err := files.Save(saveDirPath); err != nil {
r.Response.WriteExit(err)
}
r.Response.Write("upload successfully")
r.Response.WriteExit("upload successfully")
}
// UploadShow shows uploading simgle file page.
@ -71,7 +53,7 @@ func UploadShowBatch(r *ghttp.Request) {
func main() {
s := g.Server()
s.Group("/upload", func(group *ghttp.RouterGroup) {
group.ALL("/", Upload)
group.POST("/", Upload)
group.ALL("/show", UploadShow)
group.ALL("/batch", UploadShowBatch)
})

View File

@ -2,12 +2,34 @@ package main
import (
"fmt"
"github.com/gogf/gf/frame/g"
"path/filepath"
"github.com/gogf/gf/net/ghttp"
"github.com/gogf/gf/os/glog"
)
func SendXmlFile(gameId int, areaName string, filePath string) error {
path := filepath.FromSlash(filePath)
fmt.Println(path)
data := g.Map{
"gameName": gameId,
"area": areaName,
"file": "@file:" + path,
"contentType": "json",
}
if r, err := ghttp.Post("http://127.0.0.1:8199/upload", data); err != nil {
panic(err)
} else {
defer r.Close()
fmt.Println("ok")
}
return nil
}
func main() {
SendXmlFile(1, "xxx", "/Users/john/Workspace/Go/GOPATH/src/github.com/gogf/gf/.example/net/ghttp/server/session.go")
return
path := "/home/john/Workspace/Go/github.com/gogf/gf/version.go"
r, e := ghttp.Post("http://127.0.0.1:8199/upload", "upload-file=@file:"+path)
if e != nil {

View File

@ -3,34 +3,16 @@ package main
import (
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/net/ghttp"
"github.com/gogf/gf/os/gfile"
"io"
)
// Upload uploads files to /tmp .
func Upload(r *ghttp.Request) {
saveDir := "/tmp/"
for _, item := range r.GetMultipartFiles("upload-file") {
file, err := item.Open()
if err != nil {
r.Response.Write(err)
return
}
defer file.Close()
f, err := gfile.Create(saveDir + gfile.Basename(item.Filename))
if err != nil {
r.Response.Write(err)
return
}
defer f.Close()
if _, err := io.Copy(f, file); err != nil {
r.Response.Write(err)
return
}
saveDirPath := "/tmp/"
files := r.GetUploadFiles("file")
if _, err := files.Save(saveDirPath); err != nil {
r.Response.WriteExit(err)
}
r.Response.Write("upload successfully")
r.Response.WriteExit("upload successfully")
}
// UploadShow shows uploading simgle file page.
@ -71,7 +53,7 @@ func UploadShowBatch(r *ghttp.Request) {
func main() {
s := g.Server()
s.Group("/upload", func(group *ghttp.RouterGroup) {
group.ALL("/", Upload)
group.POST("/", Upload)
group.ALL("/show", UploadShow)
group.ALL("/batch", UploadShowBatch)
})

View File

@ -0,0 +1,22 @@
package main
import (
"fmt"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/net/ghttp"
"io/ioutil"
)
func main() {
s := g.Server()
s.SetIndexFolder(true)
s.BindHandler("/", func(r *ghttp.Request) {
body1 := r.GetBody()
body2, _ := ioutil.ReadAll(r.Body)
fmt.Println(body1)
fmt.Println(body2)
r.Response.Write("hello world")
})
s.SetPort(8999)
s.Run()
}

View File

@ -3,6 +3,7 @@ package main
import (
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/net/ghttp"
"github.com/gogf/gf/os/glog"
)
func MiddlewareCORS(r *ghttp.Request) {
@ -11,6 +12,7 @@ func MiddlewareCORS(r *ghttp.Request) {
}
func Order(r *ghttp.Request) {
glog.Println("order")
r.Response.Write("GET")
}
@ -18,7 +20,7 @@ func main() {
s := g.Server()
s.Group("/api.v1", func(group *ghttp.RouterGroup) {
group.Middleware(MiddlewareCORS)
g.GET("/order", Order)
group.GET("/order", Order)
})
s.SetPort(8199)
s.Run()

View File

@ -20,7 +20,7 @@ func main() {
s := g.Server()
s.Group("/api.v1", func(group *ghttp.RouterGroup) {
group.Middleware(MiddlewareCORS)
g.GET("/order", Order)
group.GET("/order", Order)
})
s.SetPort(8199)
s.Run()

View File

@ -26,7 +26,7 @@ func main() {
s := g.Server()
s.Group("/api.v1", func(group *ghttp.RouterGroup) {
group.Middleware(MiddlewareCORS)
g.GET("/order", Order)
group.GET("/order", Order)
})
s.SetPort(8199)
s.Run()

View File

@ -15,10 +15,10 @@ func main() {
r.Response.Writeln("end")
})
s.BindHookHandlerByMap(p, map[string]ghttp.HandlerFunc{
ghttp.HOOK_BEFORE_SERVE: func(r *ghttp.Request) {
ghttp.HookBeforeServe: func(r *ghttp.Request) {
glog.To(r.Response.Writer).Println("BeforeServe")
},
ghttp.HOOK_AFTER_SERVE: func(r *ghttp.Request) {
ghttp.HookAfterServe: func(r *ghttp.Request) {
glog.To(r.Response.Writer).Println("AfterServe")
},
})

View File

@ -3,15 +3,12 @@ package main
import (
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/net/ghttp"
"github.com/gogf/gf/os/glog"
)
func main() {
s := g.Server()
s.SetIndexFolder(true)
s.BindHandler("/", func(r *ghttp.Request) {
glog.Println(r.Header)
r.Response.Write("hello world")
r.Response.Write("Hello World")
})
s.SetPort(8999)
s.Run()

View File

@ -12,7 +12,7 @@ func Order(r *ghttp.Request) {
func main() {
s := g.Server()
s.Group("/api.v1", func(group *ghttp.RouterGroup) {
group.Hook("/*any", ghttp.HOOK_BEFORE_SERVE, func(r *ghttp.Request) {
group.Hook("/*any", ghttp.HookBeforeServe, func(r *ghttp.Request) {
r.Response.CORSDefault()
})
g.GET("/order", Order)

View File

@ -11,10 +11,10 @@ func main() {
p := "/:name/info/{uid}"
s := g.Server()
s.BindHookHandlerByMap(p, map[string]ghttp.HandlerFunc{
ghttp.HOOK_BEFORE_SERVE: func(r *ghttp.Request) { glog.Println(ghttp.HOOK_BEFORE_SERVE) },
ghttp.HOOK_AFTER_SERVE: func(r *ghttp.Request) { glog.Println(ghttp.HOOK_AFTER_SERVE) },
ghttp.HOOK_BEFORE_OUTPUT: func(r *ghttp.Request) { glog.Println(ghttp.HOOK_BEFORE_OUTPUT) },
ghttp.HOOK_AFTER_OUTPUT: func(r *ghttp.Request) { glog.Println(ghttp.HOOK_AFTER_OUTPUT) },
ghttp.HookBeforeServe: func(r *ghttp.Request) { glog.Println(ghttp.HookBeforeServe) },
ghttp.HookAfterServe: func(r *ghttp.Request) { glog.Println(ghttp.HookAfterServe) },
ghttp.HookBeforeOutput: func(r *ghttp.Request) { glog.Println(ghttp.HookBeforeOutput) },
ghttp.HookAfterOutput: func(r *ghttp.Request) { glog.Println(ghttp.HookAfterOutput) },
})
s.BindHandler(p, func(r *ghttp.Request) {
r.Response.Write("用户:", r.Get("name"), ", uid:", r.Get("uid"))

View File

@ -11,7 +11,7 @@ func main() {
// 多事件回调示例事件1
pattern1 := "/:name/info"
s.BindHookHandlerByMap(pattern1, map[string]ghttp.HandlerFunc{
ghttp.HOOK_BEFORE_SERVE: func(r *ghttp.Request) {
ghttp.HookBeforeServe: func(r *ghttp.Request) {
r.SetParam("uid", 1000)
},
})
@ -22,7 +22,7 @@ func main() {
// 多事件回调示例事件2
pattern2 := "/{object}/list/{page}.java"
s.BindHookHandlerByMap(pattern2, map[string]ghttp.HandlerFunc{
ghttp.HOOK_BEFORE_OUTPUT: func(r *ghttp.Request) {
ghttp.HookBeforeOutput: func(r *ghttp.Request) {
r.Response.SetBuffer([]byte(
fmt.Sprintf("通过事件修改输出内容, object:%s, page:%s", r.Get("object"), r.GetRouterString("page"))),
)

View File

@ -7,10 +7,10 @@ import (
func main() {
s := g.Server()
s.BindHookHandler("/*any", ghttp.HOOK_BEFORE_SERVE, func(r *ghttp.Request) {
s.BindHookHandler("/*any", ghttp.HookBeforeServe, func(r *ghttp.Request) {
r.Response.Writeln("/*any")
})
s.BindHookHandler("/v1/*", ghttp.HOOK_BEFORE_SERVE, func(r *ghttp.Request) {
s.BindHookHandler("/v1/*", ghttp.HookBeforeServe, func(r *ghttp.Request) {
r.Response.Writeln("/v1/*")
r.ExitHook()
})

View File

@ -11,7 +11,7 @@ func main() {
r.Response.Writeln(r.Get("name"))
})
s.BindHookHandlerByMap("/", map[string]ghttp.HandlerFunc{
ghttp.HOOK_BEFORE_SERVE: func(r *ghttp.Request) {
ghttp.HookBeforeServe: func(r *ghttp.Request) {
r.SetParam("name", "john")
},
})

View File

@ -12,17 +12,17 @@ func main() {
})
s.BindHookHandlerByMap("/priority/:name", map[string]ghttp.HandlerFunc{
ghttp.HOOK_BEFORE_SERVE: func(r *ghttp.Request) {
ghttp.HookBeforeServe: func(r *ghttp.Request) {
r.Response.Writeln("/priority/:name")
},
})
s.BindHookHandlerByMap("/priority/*any", map[string]ghttp.HandlerFunc{
ghttp.HOOK_BEFORE_SERVE: func(r *ghttp.Request) {
ghttp.HookBeforeServe: func(r *ghttp.Request) {
r.Response.Writeln("/priority/*any")
},
})
s.BindHookHandlerByMap("/priority/show", map[string]ghttp.HandlerFunc{
ghttp.HOOK_BEFORE_SERVE: func(r *ghttp.Request) {
ghttp.HookBeforeServe: func(r *ghttp.Request) {
r.Response.Writeln("/priority/show")
},
})

View File

@ -19,7 +19,7 @@ func MiddlewareAuth(r *ghttp.Request) {
func main() {
s := g.Server()
s.Group("/admin", func(group *ghttp.RouterGroup) {
g.MiddlewarePattern("/*action", func(r *ghttp.Request) {
group.Middleware(func(r *ghttp.Request) {
if action := r.GetRouterString("action"); action != "" {
switch action {
case "login":

View File

@ -25,14 +25,12 @@ func MiddlewareCORS(r *ghttp.Request) {
func MiddlewareLog(r *ghttp.Request) {
r.Middleware.Next()
glog.Println(r.Response.Status, r.URL.Path)
g.Log().Println(r.Response.Status, r.URL.Path)
}
func main() {
s := g.Server()
s.Group("/", func(group *ghttp.RouterGroup) {
group.Middleware(MiddlewareLog)
})
s.Use(MiddlewareLog)
s.Group("/api.v2", func(group *ghttp.RouterGroup) {
group.Middleware(MiddlewareAuth, MiddlewareCORS)
group.ALL("/user/list", func(r *ghttp.Request) {

View File

@ -13,24 +13,24 @@ func main() {
r.Middleware.Next()
r.Response.Write("end")
})
g.Group("/order", func(group *ghttp.RouterGroup) {
g.GET("/list", func(r *ghttp.Request) {
group.Group("/order", func(group *ghttp.RouterGroup) {
group.GET("/list", func(r *ghttp.Request) {
r.Response.Write("list")
})
})
g.Group("/user", func(group *ghttp.RouterGroup) {
g.GET("/info", func(r *ghttp.Request) {
group.Group("/user", func(group *ghttp.RouterGroup) {
group.GET("/info", func(r *ghttp.Request) {
r.Response.Write("info")
})
g.POST("/edit", func(r *ghttp.Request) {
group.POST("/edit", func(r *ghttp.Request) {
r.Response.Write("edit")
})
})
g.Group("/hook", func(group *ghttp.RouterGroup) {
group.Hook("/*", ghttp.HOOK_BEFORE_SERVE, func(r *ghttp.Request) {
group.Group("/hook", func(group *ghttp.RouterGroup) {
group.Hook("/*", ghttp.HookBeforeServe, func(r *ghttp.Request) {
r.Response.Write("hook any")
})
group.Hook("/:name", ghttp.HOOK_BEFORE_SERVE, func(r *ghttp.Request) {
group.Hook("/:name", ghttp.HookBeforeServe, func(r *ghttp.Request) {
r.Response.Write("hook name")
})
})

View File

@ -5,21 +5,18 @@ import (
"github.com/gogf/gf/net/ghttp"
)
type User struct {
}
type User struct{}
func (c *User) Index(r *ghttp.Request) {
r.Response.Write("Index")
}
// 不符合规范,不会被注册
func (c *User) Test(r *ghttp.Request, value interface{}) {
func (c *User) Test(r *ghttp.Request) {
r.Response.Write("Test")
}
func main() {
s := g.Server()
s.BindObject("/user", new(User))
u := new(User)
s.Group("/", func(group *ghttp.RouterGroup) {
group.GET("/db-{table}/{id}", u, "Test")
})
s.SetPort(8199)
s.Run()
}

View File

@ -1,12 +1,13 @@
package main
import (
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/net/ghttp"
)
func main() {
s := ghttp.GetServer()
s.EnablePProf()
s := g.Server()
s.Domain("localhost").EnablePProf()
s.BindHandler("/", func(r *ghttp.Request) {
r.Response.Writeln("哈喽世界!")
})

View File

@ -6,12 +6,8 @@ import (
func main() {
s := g.Server()
s.SetConfigWithMap(g.Map{"Graceful": true})
s.EnableAdmin()
//s.BindHookHandler("/admin/*any", ghttp.HOOK_BEFORE_SERVE, func(r *ghttp.Request) {
// if !r.BasicAuth("admin", "123", "") {
// r.Exit()
// }
//})
s.SetPort(8199)
s.Run()
}

View File

@ -18,7 +18,7 @@ func main() {
s := g.Server()
s.SetIndexFolder(true)
s.SetServerRoot("root")
s.BindHookHandler("/*", ghttp.HOOK_BEFORE_SERVE, func(r *ghttp.Request) {
s.BindHookHandler("/*", ghttp.HookBeforeServe, func(r *ghttp.Request) {
fmt.Println(r.URL.Path, r.IsFileRequest())
})
s.BindHandler("/template", func(r *ghttp.Request) {

View File

@ -0,0 +1,20 @@
package main
import (
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/net/ghttp"
)
func main() {
s := g.Server()
s.Group("/", func(group *ghttp.RouterGroup) {
group.ALL("/test", func(r *ghttp.Request) {
r.Response.Writeln(1)
})
group.ALL("/test", func(r *ghttp.Request) {
r.Response.Writeln(2)
})
})
s.SetPort(8199)
s.Run()
}

View File

@ -27,7 +27,7 @@ func main() {
s := g.Server()
obj := new(Object)
s.Group("/api").Bind([]ghttp.GroupItem{
{"ALL", "*", HookHandler, ghttp.HOOK_BEFORE_SERVE},
{"ALL", "*", HookHandler, ghttp.HookBeforeServe},
{"ALL", "/handler", Handler},
{"ALL", "/obj", obj},
{"GET", "/obj/show", obj, "Show"},

View File

@ -54,10 +54,10 @@ func main() {
})
})
group.Group("/hook", func(group *ghttp.RouterGroup) {
group.Hook("/*", ghttp.HOOK_BEFORE_SERVE, func(r *ghttp.Request) {
group.Hook("/*", ghttp.HookBeforeServe, func(r *ghttp.Request) {
r.Response.Write("hook any")
})
group.Hook("/:name", ghttp.HOOK_BEFORE_SERVE, func(r *ghttp.Request) {
group.Hook("/:name", ghttp.HookBeforeServe, func(r *ghttp.Request) {
r.Response.Write("hook name")
})
})

View File

@ -9,7 +9,7 @@ import (
func main() {
s := g.Server()
s.BindHookHandler("/*any", ghttp.HOOK_BEFORE_SERVE, func(r *ghttp.Request) {
s.BindHookHandler("/*any", ghttp.HookBeforeServe, func(r *ghttp.Request) {
fmt.Println(r.Router)
fmt.Println(r.Get("customer_id"))
})

View File

@ -8,15 +8,16 @@ import (
func main() {
s := g.Server()
s.SetSessionCookieMaxAge(0)
s.Group("/", func(group *ghttp.RouterGroup) {
g.GET("/set", func(r *ghttp.Request) {
r.Session.Set("time", gtime.Second())
group.GET("/set", func(r *ghttp.Request) {
r.Session.Set("time", gtime.Timestamp())
r.Response.Write("ok")
})
g.GET("/get", func(r *ghttp.Request) {
group.GET("/get", func(r *ghttp.Request) {
r.Response.WriteJson(r.Session.Map())
})
g.GET("/clear", func(r *ghttp.Request) {
group.GET("/clear", func(r *ghttp.Request) {
r.Session.Clear()
})
})

View File

@ -0,0 +1,29 @@
package main
import (
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/net/ghttp"
"github.com/gogf/gf/os/gsession"
"github.com/gogf/gf/os/gtime"
"time"
)
func main() {
s := g.Server()
s.SetSessionMaxAge(2 * time.Minute)
s.SetSessionStorage(gsession.NewStorageRedis(g.Redis()))
s.Group("/", func(group *ghttp.RouterGroup) {
group.GET("/set", func(r *ghttp.Request) {
r.Session.Set("time", gtime.Timestamp())
r.Response.Write("ok")
})
group.GET("/get", func(r *ghttp.Request) {
r.Response.WriteJson(r.Session.Map())
})
group.GET("/clear", func(r *ghttp.Request) {
r.Session.Clear()
})
})
s.SetPort(8199)
s.Run()
}

View File

@ -0,0 +1,17 @@
package main
import (
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/net/ghttp"
)
func main() {
s := g.Server()
s.BindHandler("/", func(r *ghttp.Request) {
r.Response.WriteTplContent(`${.name}`, g.Map{
"name": "john",
})
})
s.SetPort(8199)
s.Run()
}

View File

@ -0,0 +1,2 @@
[viewer]
delimiters = ["${", "}"]

View File

@ -8,7 +8,6 @@ import (
func main() {
s := ghttp.GetServer()
s.BindHandler("/", func(r *ghttp.Request) {
r.Response.Write("Hello World")
r.Response.WriteTpl("index.tpl", g.Map{
"title": "Test",
"name": "John",

View File

@ -1,4 +1,4 @@
// Copyright 2017 gf Author(https://github.com/gogf/gf). All Rights Reserved.
// 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,

View File

@ -27,7 +27,7 @@ func main() {
},
MemUsed: 15560320,
MemTotal: 16333788,
Time: int(gtime.Second()),
Time: int(gtime.Timestamp()),
})
if err != nil {
panic(err)

View File

@ -1,29 +0,0 @@
package main
import (
"fmt"
"time"
"github.com/gogf/gf/os/gfcache"
"github.com/gogf/gf/os/gfile"
)
func main() {
s := 0
r := ""
path := gfile.TempDir() + gfile.Separator + "temp"
gfile.PutContents(path, "hello")
s = gfcache.GetSize()
r = gfcache.GetContents(path)
fmt.Println(s, r)
gfile.PutContentsAppend(path, " john")
// 等待1秒以便gfsnotify回调能处理完成
time.Sleep(time.Second)
s = gfcache.GetSize()
r = gfcache.GetContents(path)
fmt.Println(s, r)
}

View File

@ -11,7 +11,7 @@ import (
func main() {
for {
time.Sleep(time.Second)
if f, err := gfpool.Open("/home/john/temp/log.log", os.O_RDONLY, 0666, 60000000*1000); err == nil {
if f, err := gfpool.Open("/home/john/temp/log.log", os.O_RDONLY, 0666, time.Hour); err == nil {
fmt.Println(f.Name())
f.Close()
} else {

View File

@ -0,0 +1,14 @@
package main
import (
"context"
"github.com/gogf/gf/os/glog"
)
func main() {
glog.SetCtxKeys("Trace-Id", "Span-Id", "Test")
ctx := context.WithValue(context.Background(), "Trace-Id", "1234567890")
ctx = context.WithValue(ctx, "Span-Id", "abcdefg")
glog.Ctx(ctx).Print(1, 2, 3)
}

View File

@ -0,0 +1,11 @@
package main
import (
"github.com/gogf/gf/os/glog"
)
func main() {
l := glog.New()
l.SetLevelPrefix(glog.LEVEL_DEBU, "debug")
l.Debug("test")
}

View File

@ -13,7 +13,7 @@ func main() {
key := "key"
// 第一次锁带时间
gmlock.Lock(key, 1000)
gmlock.Lock(key)
glog.Println("lock1")
// 这个时候上一次的计时解锁已失效
gmlock.Unlock(key)

View File

@ -1,16 +0,0 @@
package main
import (
"github.com/gogf/gf/os/gres"
_ "github.com/gogf/gf/os/gres/testdata"
)
func main() {
gres.Dump()
//file := gres.Get("www")
//fmt.Println(file.Open())
//g.Dump(gres.ScanDir("/root/image", "*"))
//g.Dump(gres.Scan("/root/image/", "*", true))
//g.Dump(gres.Scan("/template", "*"))
//g.Dump(gres.Scan("/template/layout2", "*.html", true))
}

View File

@ -0,0 +1,20 @@
package main
import (
_ "github.com/gogf/gf/os/gres/testdata/example/boot"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/net/ghttp"
)
func main() {
s := g.Server()
s.Group("/", func(group *ghttp.RouterGroup) {
group.GET("/template", func(r *ghttp.Request) {
r.Response.WriteTplDefault(g.Map{
"name": "GoFrame",
})
})
})
s.Run()
}

View File

@ -9,7 +9,7 @@ import (
)
func main() {
start := gtime.Millisecond()
start := gtime.TimestampMilli()
wg := sync.WaitGroup{}
for i := 0; i < 100000; i++ {
wg.Add(1)
@ -19,5 +19,5 @@ func main() {
}()
}
wg.Wait()
fmt.Println("time spent:", gtime.Millisecond()-start)
fmt.Println("time spent:", gtime.TimestampMilli()-start)
}

View File

@ -10,7 +10,7 @@ import (
)
func main() {
start := gtime.Millisecond()
start := gtime.TimestampMilli()
wg := sync.WaitGroup{}
for i := 0; i < 100000; i++ {
wg.Add(1)
@ -21,5 +21,5 @@ func main() {
}
wg.Wait()
fmt.Println(grpool.Size())
fmt.Println("time spent:", gtime.Millisecond()-start)
fmt.Println("time spent:", gtime.TimestampMilli()-start)
}

View File

@ -9,8 +9,8 @@ import (
func main() {
fmt.Println("Date :", gtime.Date())
fmt.Println("Datetime :", gtime.Datetime())
fmt.Println("Second :", gtime.Second())
fmt.Println("Millisecond:", gtime.Millisecond())
fmt.Println("Microsecond:", gtime.Microsecond())
fmt.Println("Nanosecond :", gtime.Nanosecond())
fmt.Println("Second :", gtime.Timestamp())
fmt.Println("Millisecond:", gtime.TimestampMilli())
fmt.Println("Microsecond:", gtime.TimestampMicro())
fmt.Println("Nanosecond :", gtime.TimestampNano())
}

View File

@ -2,19 +2,18 @@ package main
import (
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/frame/gmvc"
"github.com/gogf/gf/net/ghttp"
)
type Controller struct {
gmvc.Controller
}
func (c *Controller) Test() {
c.View.Display("layout.html")
}
func main() {
s := g.Server()
s.BindControllerMethod("/", new(Controller), "Test")
s.BindHandler("/", func(r *ghttp.Request) {
r.Response.WriteTpl("layout.html", g.Map{
"header": "This is header",
"container": "This is container",
"footer": "This is footer",
})
})
s.SetPort(8199)
s.Run()
}

View File

@ -1,3 +1,3 @@
{{define "container"}}
<h1>CONTAINER</h1>
<h1>{{.container}}</h1>
{{end}}

View File

@ -1,3 +1,3 @@
{{define "footer"}}
<h1>FOOTER</h1>
<h1>{{.footer}}</h1>
{{end}}

View File

@ -1,3 +1,3 @@
{{define "header"}}
<h1>HEADER</h1>
<h1>{{.header}}</h1>
{{end}}

View File

@ -2,14 +2,14 @@
<html>
<head>
<title>GoFrame Layout</title>
{{template "header"}}
{{template "header" .}}
</head>
<body>
<div class="container">
{{template "container"}}
{{template "container" .}}
</div>
<div class="footer">
{{template "footer"}}
{{template "footer" .}}
</div>
</body>
</html>

View File

@ -9,11 +9,13 @@ func main() {
s := g.Server()
s.BindHandler("/main1", func(r *ghttp.Request) {
r.Response.WriteTpl("layout.html", g.Map{
"name": "smith",
"mainTpl": "main/main1.html",
})
})
s.BindHandler("/main2", func(r *ghttp.Request) {
r.Response.WriteTpl("layout.html", g.Map{
"name": "john",
"mainTpl": "main/main2.html",
})
})

View File

@ -1,8 +0,0 @@
[database]
debug = true
link = "mysql:root:12345678@tcp(127.0.0.1:3306)/test"
[redis]
default = "127.0.0.1:6379,0"
cache = "127.0.0.1:6379,1"

View File

@ -1,14 +0,0 @@
package main
import "fmt"
func main() {
type User struct {
Id int
}
u1 := &User{1}
u2 := *u1
u2.Id = 2
fmt.Println(u1)
fmt.Println(u2)
}

View File

@ -1,11 +0,0 @@
package main
import (
"fmt"
"github.com/gogf/gf/net/ghttp"
)
func main() {
r := ghttp.PostContent("http://127.0.0.1:8199/test", `<doc><id>1</id><name>john</name><password1>123Abc!@#</password1><password2>123Abc!@#</password2></doc>`)
fmt.Println(r)
}

View File

@ -4,13 +4,12 @@ import (
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/net/ghttp"
"github.com/gogf/gf/os/gview"
"github.com/gogf/gf/util/gpage"
)
func main() {
s := ghttp.GetServer()
s := g.Server()
s.BindHandler("/page/demo", func(r *ghttp.Request) {
page := gpage.New(100, 10, r.Get("page"), r.URL.String())
page := r.GetPage(100, 10)
buffer, _ := gview.ParseContent(`
<html>
<head>

View File

@ -4,14 +4,13 @@ import (
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/net/ghttp"
"github.com/gogf/gf/os/gview"
"github.com/gogf/gf/util/gpage"
)
func main() {
s := ghttp.GetServer()
s := g.Server()
s.BindHandler("/page/ajax", func(r *ghttp.Request) {
page := gpage.New(100, 10, r.Get("page"), r.URL.String(), r.Router)
page.EnableAjax("DoAjax")
page := r.GetPage(100, 10)
page.AjaxActionName = "DoAjax"
buffer, _ := gview.ParseContent(`
<html>
<head>
@ -29,11 +28,17 @@ func main() {
</script>
</head>
<body>
<div>{{.page}}</div>
<div>{{.page1}}</div>
<div>{{.page2}}</div>
<div>{{.page3}}</div>
<div>{{.page4}}</div>
</body>
</html>
`, g.Map{
"page": page.GetContent(1),
"page1": page.GetContent(1),
"page2": page.GetContent(2),
"page3": page.GetContent(3),
"page4": page.GetContent(4),
})
r.Response.Write(buffer)
})

View File

@ -8,7 +8,7 @@ import (
"github.com/gogf/gf/util/gpage"
)
// 分页标签使用li标签包裹
// wrapContent wraps each of the page tag with html li and ul.
func wrapContent(page *gpage.Page) string {
content := page.GetContent(4)
content = gstr.ReplaceByMap(content, map[string]string{
@ -21,9 +21,9 @@ func wrapContent(page *gpage.Page) string {
}
func main() {
s := ghttp.GetServer()
s := g.Server()
s.BindHandler("/page/custom1/*page", func(r *ghttp.Request) {
page := gpage.New(100, 10, r.Get("page"), r.URL.String(), r.Router)
page := r.GetPage(100, 10)
content := wrapContent(page)
buffer, _ := gview.ParseContent(`
<html>

View File

@ -7,7 +7,7 @@ import (
"github.com/gogf/gf/util/gpage"
)
// 自定义分页名称
// pageContent customizes the page tag name.
func pageContent(page *gpage.Page) string {
page.NextPageTag = "NextPage"
page.PrevPageTag = "PrevPage"
@ -15,16 +15,16 @@ func pageContent(page *gpage.Page) string {
page.LastPageTag = "LastPage"
pageStr := page.FirstPage()
pageStr += page.PrevPage()
pageStr += page.PageBar("current-page")
pageStr += page.PageBar()
pageStr += page.NextPage()
pageStr += page.LastPage()
return pageStr
}
func main() {
s := ghttp.GetServer()
s := g.Server()
s.BindHandler("/page/custom2/*page", func(r *ghttp.Request) {
page := gpage.New(100, 10, r.Get("page"), r.URL.String(), r.Router)
page := r.GetPage(100, 10)
buffer, _ := gview.ParseContent(`
<html>
<head>

View File

@ -4,13 +4,12 @@ import (
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/net/ghttp"
"github.com/gogf/gf/os/gview"
"github.com/gogf/gf/util/gpage"
)
func main() {
s := g.Server()
s.BindHandler("/page/static/*page", func(r *ghttp.Request) {
page := gpage.New(100, 10, r.Get("page"), r.URL.String(), r.Router)
page := r.GetPage(100, 10)
buffer, _ := gview.ParseContent(`
<html>
<head>

View File

@ -4,13 +4,12 @@ import (
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/net/ghttp"
"github.com/gogf/gf/os/gview"
"github.com/gogf/gf/util/gpage"
)
func main() {
s := g.Server()
s.BindHandler("/:obj/*action/{page}.html", func(r *ghttp.Request) {
page := gpage.New(100, 10, r.Get("page"), r.URL.String(), r.Router)
page := r.GetPage(100, 10)
buffer, _ := gview.ParseContent(`
<html>
<head>

View File

@ -4,14 +4,13 @@ import (
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/net/ghttp"
"github.com/gogf/gf/os/gview"
"github.com/gogf/gf/util/gpage"
)
func main() {
s := g.Server()
s.BindHandler("/page/template/{page}.html", func(r *ghttp.Request) {
page := gpage.New(100, 10, r.Get("page"), r.URL.String())
page.SetUrlTemplate("/order/list/{.page}.html")
page := r.GetPage(100, 10)
page.UrlTemplate = "/order/list/{.page}.html"
buffer, _ := gview.ParseContent(`
<html>
<head>

View File

@ -8,6 +8,9 @@ import (
func main() {
for i := 0; i < 100; i++ {
fmt.Println(grand.Rand(0, 99999))
fmt.Println(grand.S(16))
}
for i := 0; i < 100; i++ {
fmt.Println(grand.N(0, 99999999))
}
}

View File

@ -0,0 +1,13 @@
package main
import (
"fmt"
"github.com/gogf/gf/util/guid"
)
func main() {
for i := 0; i < 100; i++ {
s := guid.S()
fmt.Println(s, len(s))
}
}

View File

@ -0,0 +1,20 @@
package main
import (
"fmt"
"math"
"strconv"
)
func main() {
// 36*36^2+36*36+36
var s string
fmt.Println(strconv.ParseUint("zzz", 36, 3))
fmt.Println(1 << 1)
// MaxInt64
s = strconv.FormatUint(math.MaxUint64, 16)
fmt.Println(s, len(s))
// PID
s = strconv.FormatInt(1000000, 36)
fmt.Println(s, len(s))
}

View File

@ -0,0 +1,23 @@
package main
import (
"fmt"
"github.com/gogf/gf/util/guid"
)
func main() {
for i := 0; i < 100; i++ {
s := guid.S([]byte("123"))
fmt.Println(s, len(s))
}
fmt.Println()
for i := 0; i < 100; i++ {
s := guid.S([]byte("123"), []byte("456"))
fmt.Println(s, len(s))
}
fmt.Println()
for i := 0; i < 100; i++ {
s := guid.S([]byte("123"), []byte("456"), []byte("789"))
fmt.Println(s, len(s))
}
}

View File

@ -11,7 +11,7 @@ func main() {
fmt.Println(1)
gutil.Throw("error")
fmt.Println(2)
}, func(err interface{}) {
}, func(err error) {
fmt.Println(err)
})
}

View File

@ -0,0 +1,13 @@
package main
import (
"fmt"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/util/gvalid"
)
func main() {
g.I18n().SetLanguage("cn")
err := gvalid.Check("", "required", nil)
fmt.Println(err.String())
}

View File

@ -0,0 +1,14 @@
"gf.gvalid.required" = "字段不能为空"

3
.gitignore vendored
View File

@ -6,7 +6,7 @@
.idea/
.settings/
.vscode/
vender/
vendor/
composer.lock
gitpush.sh
pkg/
@ -15,3 +15,4 @@ cbuild
**/.DS_Store
.vscode/
go.sum
.example/other/

View File

@ -1,9 +1,14 @@
os: linux
arch: arm64-graviton2
language: go
go:
- "1.11.x"
- "1.12.x"
- "1.13.x"
- "1.14.x"
- "1.15.x"
branches:
only:
@ -12,7 +17,7 @@ branches:
- staging
env:
- GF_DEV=1 GO111MODULE=on
- TZ=Asia/Shanghai GF_DEBUG=1 GO111MODULE=on
services:
- mysql

View File

@ -1,47 +0,0 @@
# Donators
We currently accept donation by Alipay/WechatPay, please note your github/gitee account in your payment bill.
| Name | Channel | Amount | Comment
|---|---|--- | ---
|[hailaz](https://gitee.com/hailaz)|gitee|¥20.00 |
|[ireadx](https://github.com/ireadx)|alipay|¥301.00 |
|[mg91](https://gitee.com/mg91)|gitee|¥10.00 |
|[pibigstar](https://github.com/pibigstar)|alipay|¥10.00 |
|[tiangenglan](https://gitee.com/tiangenglan)|gitee|¥30.00 |
|[wxkj](https://gitee.com/wxkj)|wechat|¥10.00 |
|[zhuhuan12](https://gitee.com/zhuhuan12)|gitee|¥50.00 |
|[zfan_codes](https://gitee.com/zfan_codes)|gitee|¥10.00 |
|[arden](https://github.com/arden)|alipay|¥10.00 |
|[macnie](https://www.macnie.com)|wechat|¥100.00 |
|lah|wechat|¥100.00 |
|x*z|wechat|¥20.00 |
|潘兄|wechat|¥100.00 |
|Fly的狐狸|wechat|¥100.00 |
|全|alipay|¥100.00 |
|东东|wechat|¥100.00 |
|严宇轩|alipay|¥99.99 |
|土豆相公|alipay|¥66.60 |
|Hades|alipay|¥66.66 |
|蔡蔡|wechat|¥666.00 | gf越来越强
|上海金保证网络科技|bank|¥2000.00 |
|[foxhack](https://github.com/foxhack)|wechat|¥20.00 |
|*栈|wechat|¥5.00 |
|*络|wechat|¥10.00|
|M*e|wechat|¥20.00|
|*G|wechat|¥10.00|
|E*_|wechat|¥10.00|
|A*y|wechat|¥1.00| 感谢大佬goframe
|K*e|wechat|¥168.00| 感谢老大
|*雨|wechat|¥100.00|
|*洁|wechat|¥10.00|赞助你肥宅快乐水
|R*s|wechat|¥18.88| 谢谢GF辛苦了
|粟*e|wechat|¥50.00|
|[李超](https://github.com/effortlee)|wechat|¥124.00|
|张炳贤|wechat+qq|¥600.00|
|[王哈哈](https://gitee.com/develop1024)|wechat|¥6.66| 希望gf越来越好
|夕景|alipay+qq|¥9.96+3.57|
<img src="https://goframe.org/images/donate.png"/>

104
README.MD
View File

@ -1,6 +1,6 @@
# GoFrame
[![Go Doc](https://godoc.org/github.com/gogf/gf?status.svg)](https://godoc.org/github.com/gogf/gf/g#pkg-subdirectories)
[![Go Doc](https://godoc.org/github.com/gogf/gf?status.svg)](https://godoc.org/github.com/gogf/gf)
[![Build Status](https://travis-ci.org/gogf/gf.svg?branch=master)](https://travis-ci.org/gogf/gf)
[![Go Report](https://goreportcard.com/badge/github.com/gogf/gf?v=1)](https://goreportcard.com/report/github.com/gogf/gf)
[![Code Coverage](https://codecov.io/gh/gogf/gf/branch/master/graph/badge.svg)](https://codecov.io/gh/gogf/gf/branch/master)
@ -9,13 +9,13 @@
English | [简体中文](README_ZH.MD)
`GF(GoFrame)` is a modular, full-featured and production-ready application development framework of golang.
Providing a series of core components and dozens of practical modules,
such as: memcache, configure, validator, logging, array/queue/set/map containers,
timer/timing tasks, file/memory lock, object pool, database ORM, etc.
Supporting web server integrated with router, cookie, session, middleware, logger,
template, https, hooks, rewrites and many more features.
`GF(GoFrame)` is a modular, powerful, high-performance and enterprise-class application development framework
of Golang. Providing a series of core components and dozens of practical modules, such as:
cache, logging, containers, timer, resource, validator, database orm, etc.
Supporting web server integrated with router, cookie, session, middleware, logger, configure,
template, https, hooks, rewrites and many more features.
> If you're a newbie to `Go`, you may consider `GoFrame` easy and great as `Laravel` in `PHP`, `SpringBoot` in `Java` or `Django` in `Python`.
# Installation
```
@ -28,57 +28,85 @@ require github.com/gogf/gf latest
# Limitation
```
golang version >= 1.10
golang version >= 1.11
```
# Documentation
* [APIDoc](https://godoc.org/github.com/gogf/gf)
* [中文文档](https://goframe.org)
# Architecture
<div align=center>
<img src="https://goframe.org/images/arch.png?v=10"/>
<img src="https://itician.org/download/attachments/1114119/arch.png"/>
</div>
# Quick Start
# Packages
1. **Primary Package**
```go
package main
The `gf` repository maintains some basic and most commonly used packages, keeping it as lightweight and simple as possible.
import (
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/net/ghttp"
)
1. **Community Package**
func main() {
s := g.Server()
s.BindHandler("/", func(r *ghttp.Request) {
r.Response.Write("Hello World")
})
s.Run()
}
```
The community packages are contributed and maintained by community members, which are hosted in `gogf` organization. Some of the community packages are separated from the `gf` repository, which are not of common usage or are with heavy dependencies.
[More Features...](https://goframe.org/start/index)
# Performance
The `Web` component performance of `GoFrame`, please refer to third-party project: https://github.com/the-benchmarker/web-frameworks
# Documentation
* 中文官网: https://goframe.org
* GoDoc API: https://godoc.org/github.com/gogf/gf
# Discussion
- QQ Group[116707870](//shang.qq.com/wpa/qunwpa?idkey=195f91eceeb5d7fa76009b7cd5a4641f70bf4897b7f5a520635eb26ff17adfe7)
- WX GroupAdd friend`389961817` in WeChat, commenting `GF`
- Issueshttps://github.com/gogf/gf/issues
> It's recommended learning `GoFrame` through its awesome source codes and API reference.
# License
`GF` is licensed under the [MIT License](LICENSE), 100% free and open-source, forever.
# Part Of Users
- [Tencent](https://www.tencent.com/)
- [ZTE](https://www.zte.com.cn/china/)
- [Ant Financial Services](https://www.antfin.com/)
- [MedLinker](https://www.medlinker.com/)
- [KuCoin](https://www.kucoin.io/)
- [LeYouJia](https://www.leyoujia.com/)
- [IGG](https://igg.com)
- [XiMaLaYa](https://www.ximalaya.com)
- [ZYBang](https://www.zybang.com/)
> We list part of the users here, if your company or products are using `GoFrame`, please let us know [here](https://itician.org/pages/viewpage.action?pageId=1114415).
# Contributors
This project exists thanks to all the people who contribute. [[Contributors](https://github.com/gogf/gf/graphs/contributors)].
<a href="https://github.com/gogf/gf/graphs/contributors"><img src="https://opencollective.com/goframe/contributors.svg?width=890&button=false" /></a>
# Donators
We currently accept donation by Alipay/WechatPay, please note your github/gitee account in your payment bill. If you like `GF`, why not [buy developer a cup of coffee](DONATOR.MD)?
If you love `GF`, why not [buy developer a cup of coffee](https://itician.org/pages/viewpage.action?pageId=1115633)?
# Sponsors
We appreciate any kind of sponsorship for `GF` development. If you've got some interesting, please contact WeChat `389961817` / Email `john@goframe.org`.
# Thanks
<a href="https://www.jetbrains.com/?from=GoFrame"><img src="https://goframe.org/images/jetbrains.png" width="100" alt="JetBrains"/></a>
<!--
# Sponsor
We appreciate any kind of sponsorship for `GF` development. If you've got some interested, please contact john@goframe.org.
-->
<a href="https://www.jetbrains.com/?from=GoFrame"><img src="https://itician.org/download/thumbnails/1114119/jetbrains.png?version=1&modificationDate=1608649325806&api=v2" height="120" alt="JetBrains"/></a>
<a href="https://www.atlassian.com/?from=GoFrame"><img src="https://itician.org/download/thumbnails/1114119/u%3D605052180%2C3099422872%26fm%3D11%26gp%3D0.jpg?version=1&modificationDate=1608649343601&api=v2" height="120" alt="Atlassian"/></a>

View File

@ -1,5 +1,5 @@
# GoFrame
[![Go Doc](https://godoc.org/github.com/gogf/gf?status.svg)](https://godoc.org/github.com/gogf/gf/g#pkg-subdirectories)
[![Go Doc](https://godoc.org/github.com/gogf/gf?status.svg)](https://godoc.org/github.com/gogf/gf)
[![Build Status](https://travis-ci.org/gogf/gf.svg?branch=master)](https://travis-ci.org/gogf/gf)
[![Go Report](https://goreportcard.com/badge/github.com/gogf/gf?v=1)](https://goreportcard.com/report/github.com/gogf/gf)
[![Code Coverage](https://codecov.io/gh/gogf/gf/branch/master/graph/badge.svg)](https://codecov.io/gh/gogf/gf/branch/master)
@ -8,21 +8,28 @@
[English](README.MD) | 简体中文
`GF(Go Frame)`是一款模块化、高性能、生产级的Go基础开发框架。实现了比较完善的基础设施建设,包括常用的核心开发组件,
如:缓存、日志、文件、时间、队列、数组、集合、字符串、定时器、命令行、文件锁、内存锁、对象池、连接池、资源管理、数据校验、数据编码、文件监控、
定时任务、数据库ORM、TCP/UDP组件、进程管理/通信、并发安全容器等等。
并提供了Web服务开发的系列核心组件Router、Cookie、Session、Middleware、服务注册、配置管理、模板引擎等等
支持热重启、热更新、多域名、多端口、多服务、HTTPS、Rewrite等特性。
`GF(Go Frame)`是一款模块化、高性能、企业级的Go基础开发框架。
实现了比较完善的基础设施建设以及开发工具链,提供了常用的基础开发模块,
如:缓存、日志、队列、数组、集合、容器、定时器、命令行、内存锁、对象池、
配置管理、资源管理、数据校验、数据编码、定时任务、数据库ORM、TCP/UDP组件、进程管理/通信等等
并提供了Web服务开发的系列核心组件Router、Cookie、Session、Middleware、服务注册、模板引擎等等
支持热重启、热更新、域名绑定、TLS/HTTPS、Rewrite等特性。
> 如果您初识`Go`语言,您可以将`GoFrame`类似于`PHP`中的`Laravel`, `Java`中的`SpringBoot`或者`Python`中的`Django`。
# 特点
* 模块化、松耦合设计;
* 模块丰富开箱即用;
* 简便及可维护性为宗旨
* 模块丰富开箱即用;
* 简便易用、易于维护
* 高代码质量、高单元测试覆盖率;
* 社区活跃,大牛谦逊低调脾气好;
* 详尽的开发文档及示例;
* 完善的本地中文化支持;
* 更适合企业及团队使用;
* 更多请查阅文档及源码;
* 设计为团队及企业使用;
# 地址
- **主库**https://github.com/gogf/gf
- **码云**https://gitee.com/johng/gf
# 安装
```html
@ -38,48 +45,73 @@ require github.com/gogf/gf latest
golang版本 >= 1.11
```
# 架构
<div align=center>
<img src="https://goframe.org/images/arch.png?v=10"/>
<img src="https://itician.org/download/attachments/1114119/arch.png"/>
</div>
# 模块
1. **核心模块**
`GoFrame`提供了一些基础的、常用的模块,简单、易用和轻量级,并保持极少的外部依赖,这些模块由`gf`主仓库细致维护。
1. **社区模块**
社区模块主要由社区贡献并维护,大部分也是由`gf`主仓库的贡献者提供及维护,存放于`gogf`空间下,与`gf`主仓库处于同一级别。有的社区模块是从`gf`主仓库中剥离出来单独维护的模块,这些模块并不是特别常用,或者对外部依赖较重。
# 性能
大家较为感兴趣的`Web`组件性能测试请参考第三方性能测试评估https://github.com/the-benchmarker/web-frameworks
# 文档
开发文档:[https://goframe.org](https://goframe.org)
开发文档https://goframe.org
接口文档:[https://godoc.org/github.com/gogf/gf](https://godoc.org/github.com/gogf/gf)
接口文档https://godoc.org/github.com/gogf/gf
# 使用
```go
package main
import (
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/net/ghttp"
)
func main() {
s := g.Server()
s.BindHandler("/", func(r *ghttp.Request) {
r.Response.Write("Hello World")
})
s.Run()
}
```
[更多..](https://goframe.org/start/index)
# 帮助
- QQ交流群[116707870](//shang.qq.com/wpa/qunwpa?idkey=195f91eceeb5d7fa76009b7cd5a4641f70bf4897b7f5a520635eb26ff17adfe7)
- WX交流群微信添加`389961817`备注`GF`
- 主库ISSUEhttps://github.com/gogf/gf/issues
> 建议通过阅读`GoFrame`的源码以及API文档深度学习`GoFrame`,了解更多的精妙设计。
# 协议
`GF` 使用非常友好的 [MIT](LICENSE) 开源协议进行发布,永久`100%`开源免费。
# 用户
- [腾讯科技](https://www.tencent.com/)
- [中兴科技](https://www.zte.com.cn/china/)
- [蚂蚁金服](https://www.antfin.com/)
- [医联科技](https://www.medlinker.com/)
- [库币科技](https://www.kucoin.io/)
- [乐有家](https://www.leyoujia.com/)
- [IGG](https://igg.com)
- [喜马拉雅](https://www.ximalaya.com)
- [作业帮](https://www.zybang.com/)
> 在这里只列举了部分知名的用户,如果您的企业或者产品正在使用`GoFrame`,欢迎到 [这里](https://itician.org/pages/viewpage.action?pageId=1114415) 留言。
# 贡献
感谢所有参与`GoFrame`开发的贡献者。 [[贡献者列表](https://github.com/gogf/gf/graphs/contributors)].
<a href="https://github.com/gogf/gf/graphs/contributors"><img src="https://opencollective.com/goframe/contributors.svg?width=890&button=false" /></a>
# 捐赠
如果您喜欢`GF`,要不[给开发者来杯咖啡](DONATOR.MD)
如果您喜欢`GF`,要不给开发者 [来杯咖啡](https://itician.org/pages/viewpage.action?pageId=1115633) 吧
请在捐赠时备注您的`github`/`gitee`账号名称。
# 赞助
赞助支持`GF`框架的快速研发,如果您感兴趣,请联系 微信 `389961817` / 邮件 `john@goframe.org`。
# 感谢
<a href="https://www.jetbrains.com/?from=GoFrame"><img src="https://goframe.org/images/jetbrains.png" width="100" alt="JetBrains"/></a>
<a href="https://www.jetbrains.com/?from=GoFrame"><img src="https://itician.org/download/thumbnails/1114119/jetbrains.png?version=1&modificationDate=1608649325806&api=v2" height="120" alt="JetBrains"/></a>
<a href="https://www.atlassian.com/?from=GoFrame"><img src="https://itician.org/download/thumbnails/1114119/u%3D605052180%2C3099422872%26fm%3D11%26gp%3D0.jpg?version=1&modificationDate=1608649343601&api=v2" height="120" alt="Atlassian"/></a>

View File

@ -1,566 +0,0 @@
# `v1.8.0` (2019-07-15)
## 新功能改进
1. 框架目前 `69` 个开发模块(不包括内部模块),原生代码 `65302` 行(不包含第三包依赖包),单元测试覆盖率达到`77%`
1. 新增`gerror`错误处理模块https://goframe.org/errors/gerror/index
1. 改进`gcharset`字符编码转换模块支持更多的字符集https://goframe.org/encoding/gcharset/index
1. 新增`gmutex`模块,基于`channel`实现的高级互斥锁模块支持更丰富的互斥锁特性https://goframe.org/os/gmutex/index
1. 改进`glog`日志模块:
- 新增日志异步输出特性https://goframe.org/os/glog/async
- 新增`Flags`额外功能特性https://goframe.org/os/glog/flags
- 新增`Json`数据格式输出https://goframe.org/os/glog/json
- 新增自定义`Writer`接口特性https://goframe.org/os/glog/writer
- **修改`Backtrace`名称为`Stack`,并改进调用堆栈输出格式;**
- 新增`Expose`方法暴露内部默认`Logger`对象;
1. 改进`gdb`数据库ORM模块
- **改进错误处理,当数据库操作没有查询到数据时,`error`返回`sql.ErrNoRows`**https://goframe.org/database/gdb/error
- 改进`Update`/`Delete`方法支持`Order BY`及`LIMIT`特性;
- 数据库链式操作及方法操作中,预处理变量参数支持`slice`参数https://goframe.org/database/gdb/chaining/model
- **修改`Priority`权重配置名称为`Weight`**
- 新增`Debug`配置,可配置开启/关闭调试特性https://goframe.org/database/gdb/config
- 新增`Offset`方法,该方法为可选链式操作方法,`pgsql`数据库可直接通过`Limit`方法第二个参数自动识别为`Offset`语法;
- 改进数据库动态切换特性,支持不同数据库类型的当前操作数据库切换;
- 改进简化配置文件结构https://goframe.org/database/gdb/config
1. 改进`gconv`数据转换模块:
- 对结构体对象转换时支持更多的标签:`gconv/c/json`
- 支持`*struct/[]struct/[]*struct`自动初始化创建对象/数组https://goframe.org/util/gconv/struct
- 新增`Strusts/StrctsDeep`方法,用于结构体数组的递归转换;
- 新增`StructDeep`方法,用于对结构体对象的递归转换;
- 新增`MapDeep`方法,用于对结构体属性的递归转换;
1. 改进`ghttp`模块:
- 改进`ghttp`模块的分组路由功能,完善逻辑处理细节,程序更加稳健;
- 改进`ghttp.Request.Get*ToStruct`方法,支持`params/param/p`标签,支持结构体递归转换,并且支持`**struct`参数的对象自动初始化;
- 改进`ghttp.CORSDefault`的跨域设置参数,`AllowOrigin`参数调整为`*`
1. 改进`gvalid`数据校验模块:
- 增加对校验标签`gvalid/valid/v`的支持;
- 改进`CheckStruct`支持对结构体对象的递归校验https://goframe.org/util/gvalid/checkstruct
1. 改进`gtcp`TCP通信模块
- 改进通信包协议设计更加轻量级高效https://goframe.org/net/gtcp/conn/pkg
- 改进`TCP Server`增加对`TLS`的支持https://goframe.org/net/gtcp/tls
- 增加`Server.Cloce`服务端关闭方法;
1. 改进`gproc`模块的通信数据结构,并使用`gtcp`的轻量级包协议重构消息发送逻辑;
1. 改进`gqueue`模块增加数据同步缓冲机制,解决大数据量下的内存占用及延迟问题;
1. 改进`gmlock`模块,使用`gmutex`模块替换内部的互斥锁,增加更多的操作方法;
1. 改进`gaes`加密模块,增加`CBC`模式的加密/解密方法:
1. 改进`garray.Range/SubSlice`方法,改进设计,提高性能;
1. 改进`gjson`/`gparser`模块实现`MarshalJSON`接口以实现自定义的`JSON`数据格式转换;
1. **改进`crypto`分类下模块的方法返回值,增加`error`错误变量返回,以保证更严谨的接口设计风格;**
1. **改进`gbase64`模块,输入输出类型发生改变,并增加多个相关方法;**
1. 改进`gflock`修改方法名`UnLock`为`Unlock`,新增`IsRLocked`方法;
1. 新增`gfile.CopyFile/CopyDir`方法,用于文件及目录的复制;
1. 改进`gjson/gparser/gvar/gcfg`模块增加更多的类型转换方法;
1. 改进`gcache`模块,过期时间参数支持`time.Duration`类型;
1. 新增`internal/structs`包,强大且便捷的结构体解析,并改进框架中所有涉及到结构体反射处理的模块;
1. 改进`gbinary`增加封装方法对`BigEndian`的支持;
## Bug Fix
1. 修复`garray.Search`返回值问题;
1. 修复`garray.Contains`, `garray.New*ArrayFromCopy`方法逻辑问题;
1. 修复`gjson.Remove`删除`slice`参数问题;
1. 修复`gtree.AVLTree.Remove`方法返回值问题;
1. 修复`gqueue.Size`不准确的大小问题;
1. 修复`queue.Close`问题;
1. 修复`gcache.GetOrSetLockFunc`当回调函数返回`nil`结果时的死锁问题;
1. 修复`gfsnotify.Add`方法默认递归监控添加失效问题;
1. 修复`gdb.Model.Scan`在某些参数类型下的失效问题;
## 注意事项
请注意以上粗体文字部分,如有使用,在您升级时可能会出现不兼容性。
# `v1.7.0` (2019-06-10)
## 新功能/改进
1. 重构改进`glog`模块:
- 去掉日志模块所有的锁机制,改为无锁设计,执行性能更加高效
- 增加日志内容的异步输出特性https://goframe.org/os/glog/async
- 增加日志输出内容的`Json`格式支持https://goframe.org/os/glog/json
- 增加`Flags`额外特性支持包括文件行号打印、自定义时间格式、异步输出等特性控制https://goframe.org/os/glog/flags
- 增加`Writer`接口支持,便于开发者进行自定义的日志功能扩展,或者与第三方服务/模块对接集成https://goframe.org/os/glog/writer
- 修改`SetStdPrint`方法名为`SetStdoutPrint`
- 修改链式方法`StdPrint`方法名为`Stdout`
- 标记淘汰`*fln`日志输出方法,`*f`方法支持自动的换行输出
- 新增更多的链式方法支持https://goframe.org/os/glog/chain
1. 重构改进`gmap`模块:
- 增加更多数据格式支持:`HashMap`/`ListMap`/`TreeMap`
- 简化类型名称,如`gmap.StringInterfaceMap`简化为`gmap.StrAnyMap`
- 改进`Map/Keys/Values`方法以提高性能
- 修改`BatchSet`/`BatchRemove`方法名为`Sets`/`Removes`
- 新增更多功能方法支持https://goframe.org/container/gmap/index
1. 改进`gtime`时间模块:
- 增加并完善更多的类`PHP`时间格式支持
- 新增更多功能方法,如`FormatTo`/`LayoutTo`等等
- 详见开发文档https://goframe.org/os/gtime/index
1. 改进`gdb`数据库模块:
- 增加对继承结构体的数据转换支持https://goframe.org/database/gdb/senior
- 新增`GetLastSql`方法用以在调试模式下获取最近一条执行的SQL语句
- 其他的细节处理改进
1. 改进`gtcp`通信模块:
- 完善处理细节,提高通信性能;
- 增加`TLS`服务端/客户端通信支持https://goframe.org/net/gtcp/tls
- 增加简单协议支持,便于开发者封包/解包,并解决粘包/半包问题https://goframe.org/net/gtcp/conn/pkg
- TCP服务端增加`Close`方法
- 更多细节查看开发文档https://goframe.org/net/gtcp/index
1. 改进`gconv`类型转换模块
- 修改`gconv.TimeDuration`转换方法名称为`gconv.Duration`
- 新增`gconv.StructDeep`及`gconv.MapDeep`方法,支持递归转换
- 详见开发文档https://goframe.org/util/gconv/struct
1. 改进`ghttp`模块:
- 日志输出增加`http/https`字段https://goframe.org/net/ghttp/logs
- 新增`ghttp.Server.SetKeepAlive`设置方法,用以开启/关闭`KeepAlive`特性
- 增加`ghttp.Request.GetUrl`方法用以获取当前完整的URL请求地址
- `ghttp.Client`客户端支持开发者自定义`Transport`属性,`ghttp.Client.Post`方法支持`浏览器模式`https://goframe.org/net/ghttp/client
1. 新增`gtree`树形数据结构容器支持https://goframe.org/container/gtree/index
1. 改进`gudp`通信模块具体请参考开发文档https://goframe.org/net/gudp/index
1. 改进`gcfg`配置管理模块,所有`Get*`方法增加默认值支持https://goframe.org/os/gcfg/index
1. `gredis`模块新增`DoVar`/`ReceiveVar`方法以便于开发者对执行结果进行灵活的数据格式转换https://goframe.org/database/gredis/index
1. `gcache`模块`BatchSet`/`BatchRemove`方法名修改为`Sets`/`Removes`
1. 改进`gjson`/`gparser`模块增加更多方法https://goframe.org/encoding/gjson/index
1. 改进`gfile.MainPkgPath`方法,以支持不同平台的开发环境;
1. 改进`grpool`协程池模块提高执行性能https://goframe.org/os/grpool/index
1. 改进`TryCatch`方法,当开发者不传递`Catch`参数时,默认抑制并忽略错误的处理
1. 改进`gmlock`模块,增加`TryLockFunc`/`TryRLockFunc`方法,并且为`gmlock.Mutex`高级互斥锁对象增加`TryLockFunc`/`TryRLockFunc`方法
1. 去除`gvar.VarRead`接口类型支持
## Bug Fix
1. 解决`gdb`模块与其他第三方`ORM`模块同时使用的冲突;
1. 修复`gcron.AddOnce`方法的细节逻辑问题;
1. 修复内部`empty`模块的`IsEmpty`方法对结构体属性的空校验错误;
1. 修复`gview`模板引擎的并发安全问题;
1. 修复`ghttp.Server`的SESSION初始化过期时间问题
# `v1.6.0` (2019-04-09)
## 新功能/改进
1. `gcron`定时任务模块增加运行日志记录功能https://goframe.org/os/gcron/index
1. `gredis`增加全局分组配置功能,并增加更多的配置选项`maxIdle/maxActive/idleTimeout/maxConnLifetime`https://goframe.org/database/gredis/index
1. `gcfg`模块增加更多的默认配置文件检索路径,并且增加全局分组配置特性,增加`Instance`单例方法https://goframe.org/os/gcfg/index
1. `gview`模块增加更多的默认配置文件检索路径,并且增加`Instance`单例方法https://goframe.org/os/gview/index
1. `ghttp`模块新功能及改进:
- 新增`CORS`HTTP(S)跨域请求特性: https://goframe.org/net/ghttp/cors
- 增加`TLSConfig`配置功能;
- 去掉路由注册方法的`error`返回值,当产生注册错误时直接终端打印错误/输出到日志文件;
- 增加在`HTTP Code 302`跳转时的`Set-Cookie`支持;
- 增加对`SESSION ID`的安全性检查;
- 增加对基于`HTTPS`的`WebSocket`支持(`WSS`https://goframe.org/net/ghttp/websocket/index
- `Request`对象增加`Error`方法,用于输出自定义错误信息到`WebServer`错误日志中;
- 其他一些改进;
1. `gdb`模块新功能及改进:
- 新增`Instance`单例管理方法;
- 新增`Structs/Scan`链式操作方法,`gdb.DB/TX`新增`GetStructs/GetScan`方法,用于结果集`struct`/`slice`映射转换https://goframe.org/database/gdb/chaining
- 新增`Safe`链式操作方法默认非并发安全用于链式安全控制https://goframe.org/database/gdb/chaining
- `Where`链式操作方法改进:
- 方法支持任意的`string/map/slice/struct/*struct`类型;
- 逻辑调整,当链式操作中存在多个`Where`方法调用时,自动转换为`And`条件;
- 支持`slice`条件参数,常用在`SELECT IN`查询中,例如:`Where("uid IN(?)", g.Slice{1,2,3})`
- 支持在`map`类型条件参数的`key`中传递条件,例如:`Where(g.Map{"uid>?", uid})`
1. `gconv`及`gvalid`模块改进并去掉对私有`struct`方法属性的转换/校验;
1. `gconv.Map`转换方法新增对`json tag`: `-`, `omitempty`的支持: https://goframe.org/util/gconv/map
1. `gstr`模块新增 `ReplaceI/ReplaceIByArray/ReplaceIByMap`大小写非敏感替换方法;
1. `gutil`模块增加`IsEmpty`方法用于判断给定变量是否为空整型0, 布尔false, slice/map长度为0, 其他为nil的情况判断为空并增加快捷方法`g.IsEmpty`
1. `gutil`模块增加`Export`方法,用于导出返回格式化打印的变量内容字符串,并增加快捷方法`g.Export`
1. `gspath`增加缓存及非缓存检索检索方法`Search`/`SearchWithCache`
1. `gjson`模块增加默认的`UseNumber`功能支持;
1. `gmap`增加`SetIfNotExistFunc/SetIfNotExistFuncLock`方法;
1. 迁移`greuseport`模块到新的仓库https://github.com/gogf/greuseport
1. 大量的单元测试完善;
## Bug Fix
1. 修复`gqueue`模块的资源竞争问题;
1. 修复`gconv.GTime`转换失败问题;
1. 修复`gconv.String`在转换`int`参数时字节溢出问题;
1. 修复`ghttp.Request`的`HTTP Basic Auth`校验问题;
1. 修复`gxml`针对于非`UTF-8`编码内容转换的并发安全问题;
1. 修复`gtime`部分`Format``G`&`j`)格式失效问题;
1. 修复`gudp.Conn`对象的`RemoteAddr`获取客户端连接地址方法问题;
1. 修复`gmap/gcache`模块的`GetOrSetFuncLock`方法,增加对回调方法返回值的`nil`判断只有非nil返回值才会被保存
# `v1.5.8` (2019-02-28)
## 新特性
1. 主库从`gitee`迁移到了`github`( https://github.com/gogf/gf )`gitee`作为镜像站用于国内的代码贡献及ISSUE提交迁移说明详见https://goframe.org/upgradeto150
1. 对常用的`container`数组模块: `garray`做了大量改进/完善工作新增大量常用方法并完善单元测试用例及方法注释详见API文档https://godoc.org/github.com/gogf/gf/container/garray
1. 对常用的`container`集合模块: `gset`做了大量改进/完善工作新增大量常用方法并完善单元测试用例及方法注释详见API文档https://godoc.org/github.com/gogf/gf/container/gset
1. 对常用的`container`MAP模块: `gmap`做了大量改进/完善工作新增大量常用方法并完善单元测试用例及方法注释详见API文档https://godoc.org/github.com/gogf/gf/container/gmap
1. 对常用的字符串模块: `gstr`做了大量改进/完善工作新增大量常用方法并完善单元测试用例及方法注释详见API文档https://godoc.org/github.com/gogf/gf/text/gstr
1. 改进`gform`中对`struct`/`*struct`参数的支持,`*Insert/*Save/*Replace/*Update/Where/Data`方法的参数调整为`interface{}`类型,并支持任意类型的: `string/map/slice/struct/*struct`参数传递具体请参考https://goframe.org/database/orm/chaining
1. 新增/完善若干模块的单元测试用例, 包括:`gvalid`/`gregex`/`garray`/`gset`/`gmap`/`gstr`/`gconv`/`ghttp`/`gdb`
1. 由于`gkafka`模块比较重且不是框架核心模块因此将该模块迁移到新的仓库中独立管理并去掉相关依赖包https://github.com/gogf/gkafka
1. 新增`greuseport`模块用以实现TCP的`REUSEPORT`特性https://godoc.org/github.com/gogf/gf/net/greuseport
## 新功能/改进
1. 去掉模板引擎内置变量中自动初始化`session`对象带来的内存占用问题;
1. `ghttp.Client`改进增加若干方法详见https://goframe.org/net/ghttp/client
1. `ghttp`分组路由增加`COMMON`方法,用以注册常用的`HTTP METHOD`(`GET/PUT/POST/DELETE`)路由;
1. 更新框架依赖的`golang.org/x/sys`模块;
1. 改进`gform`的批量操作(`Batch*`操作)返回结果对象,可以通过该结果对象获得批量操作准确的受影响记录行数;
1. 将`gstr`/`gregex`模块从`util`分类迁移到了`text`分类目录下;
1. 将`gtest`模块从`util`分类迁移到了`test`分类目录下;
1. 完善`glog`方法注释;
## Bug Fix
1. 修复带点的邮件格式,用`gvalid.Check`的"`email`"规则不能匹配成功;
1. 修复`gvalid.Check`在`regex`规则下的检查失败问题;
1. 修复`gcron`模块定时规则中天和周不允许`?`符号的问题;
1. 修复`ghttp.Server`在部分异常情况下仍然返回`200`状态码的问题;
1. 修复`gfpool`模块中由于原子操作问题造成的高并发"内存泄露"问题;
1. 修复分组路由注册对象/控制时,方法`Index`的路由仅能通过`/xxx/index`访问的问题;
1. 修复模板引擎使用中,当不存在`config.toml`(即使没使用)配置文件时的报错问题;
1. 其他一些修复;
# `v1.4.6` (2019-01-24)
## 新特性
1. 新增并发安全的高性能任务定时器模块`gtimer`, 类似于Java的`Timer`但是比较于Java的`Timer`更加强大,内部实现采用灵活高效的`分层时间轮`设计,被设计为可管理维护百万级别以上数量的定时任务。`gtimer`为`GF`框架的核心模块之一,单元测试覆盖率达到`93.6%`[https://goframe.org/os/gtimer/index](https://goframe.org/os/gtimer/index)
1. 采用任务定时器`gtimer`重构`gcron`定时任务模块,去掉第三方`github.com/robfig/cron`包的使用。`gcron`增加单例模式的定时任务:[https://goframe.org/os/gcron/index#](https://goframe.org/os/gcron/index#)
1. `gconv`类型转换模块支持对`struct`结构体中的**指针属性**转换:[https://goframe.org/util/gconv/struct](https://goframe.org/util/gconv/struct)
1. `gform`增加对数据库类型的自动识别特性,这一特性在需要将查询结果`json`编码返回时非常有用: [https://goframe.org/database/orm/index](https://goframe.org/database/orm/index)
1. `Travis CI`增加对`386`架构的自动化测试支持(目前已支持`386`和`amd64`)
## 新功能
1. `ghttp`模块新增`Exit`、`ExitAll`、`ExitHook`方法用于HTTP请求处理流程控制: [https://goframe.org/net/ghttp/service/object](https://goframe.org/net/ghttp/service/object)
1. `grand`模块增加`Meet/MeetProb`方法,用于给定概率的随机满足判断,增加别名方法`N/Str/Digits/Letters`
1. `gvalid`数据/表单校验模块增加`16X`及`19X`手机号的校验支持;
## 功能改进
1. `gform`设置默认的数据库连接池`CONN_MAX_LIFE`参数值为`30`秒;
1. 改进`glist`模块,提高约`20%`左右性能,并增加若干链表操作方法;
1. 改进`gqueue`模块,提高约`50`左右性能,并增加模块对`select`语法的支持(使用`Queue.C`): [https://goframe.org/container/gqueue/index](https://goframe.org/container/gqueue/index)
1. 改进`gmlock`内存锁模块,并完善单元测试用例:[https://goframe.org/os/gmlock/index](https://goframe.org/os/gmlock/index)
1. 改进并发安全容器所有的模块,调整并发安全控制非必需参数`safe...bool`为`unsafe...bool`
1. 改进`gpool`对象复用模块,支持并发安全;
1. 更新`gkafka`模块的第三方依赖包;
1. 完善`ghttp`模块的单元测试用例;
## Bug Fix
1. 修复`gmd5`模块操作文件时的文件指针未关闭问题;
1. 修复`gcache`缓存项过期删除失效问题;
1. 其他修复;
# `v1.3.8` (2018-12-26)
## 新特性
1. 对`gform`完成重构,以提高扩展性,并修复部分细节问题、完善单元测试用例([https://goframe.org/database/orm/index](https://goframe.org/database/orm/index))
1. `WebServer`路由注册新增分组路由特性([https://goframe.org/net/ghttp/group](https://goframe.org/net/ghttp/group));
1. `WebServer`新增`Rewrite`路由重写特性([https://goframe.org/net/ghttp/static](https://goframe.org/net/ghttp/static));
1. 增加框架运行时对开发环境的自动识别;
1. 增加了`Travis CI`自动化构建/测试;
## 新功能
1. 改进`WebServer`静态文件服务功能,增加`SetStaticPath`/`AddStaticPath`方法([https://goframe.org/net/ghttp/static](https://goframe.org/net/ghttp/static))
1. `gform`新增`Filter`链式操作方法,用于过滤参数中的非表字段键值对([https://goframe.org/database/orm/linkop](https://goframe.org/database/orm/linkop)
1. `gcache`新增`Data`方法,用以获取所有的缓存数据项;
1. `gredis`增加`GetConn`方法获取原生redis连接对象
## 功能改进
1. 改进`gform`的`Where`方法,支持`slice`类型的参数,并更方便地支持`in`操作查询([https://goframe.org/database/orm/linkop](https://goframe.org/database/orm/linkop)
1. 改进`gproc`进程间通信数据结构,将`pid`字段从`16bit`扩展为`24bit`
1. 改进`gconv`/`gmap`/`garray`,增加若干操作方法;
1. 改进`gview`模板引擎中的`date`内置函数,当给定的时间戳为空时打印当前的系统时间;
1. 改进`gview`模板引擎中,当打印的变量不存在时,显示为空(标准库默认显示为`<no value>`
1. 改进`WebServer`,去掉`HANGUP`的信号监听,避免程序通过`nohup`运行时产生异常退出问题;
1. 改进`gcache`性能,并完善基准测试;
## Bug Fix
1. 修复`gcache`在非LRU特性开启时的缓存关闭资源竞争问题并修复`doSetWithLockCheck`内部方法的返回值问题;
1. 修复`grand.intn`内部方法在`x86`架构下的随机数位溢出问题;
1. 修复`gbinary`中`Int`方法针对`[]byte`参数长度自动匹配造成的字节长度溢出问题;
1. 修复`gjson`由于官方标准库`json`不支持`map[interface{}]*`类型造成的Go变量编码问题
1. 修复`garray`中部分方法的数据竞争问题,修复二分查找排序问题;
1. 修复`ghttp.Request.GetVar`方法获取参数问题;
1. 修复`gform`的数据库连接池不起作用的问题;
# `v1.2.11` (2018-11-26)
## 新特性
1. `ORM`新增对`SQLServer`及`Oracle`的支持([https://goframe.org/database/orm/database](https://goframe.org/database/orm/database))
1. 完成`gvalid`模块校验结果的顺序特性([https://goframe.org/util/gvalid/checkmap](https://goframe.org/util/gvalid/checkmap));
1. 改进`ghttp.Request.Exit`,使得调用该方法时立即退出业务执行,开发者无需调用`Exit`方法时再使用`return`返回([https://goframe.org/net/ghttp/service/object](https://goframe.org/net/ghttp/service/object))
1. 模板引擎新增若干内置函数:`text/html/htmldecode/url/urldecode/date/compare/substr/strlimit/hidestr/highlight/toupper/tolower/nl2br` ([https://goframe.org/os/gview/funcs](https://goframe.org/os/gview/funcs));
1. 模板引擎新增内置变量`Config` ([https://goframe.org/os/gview/vars](https://goframe.org/os/gview/vars));
1. 改进`gconv.Struct`转换默认规则,支持不区分大小写的键名与属性名称匹配;
1. `gform`配置文件支持`linkinfo`自定义数据库连接字段([https://goframe.org/database/orm/config](https://goframe.org/database/orm/config))
1. `gfsnotify`模块增加对特定回调的取消注册功能([https://goframe.org/os/gfsnotify/index](https://goframe.org/os/gfsnotify/index)
## 新功能
1. 改进`ghttp.Request`,增加`SetParam/GetParam`请求流程自定义变量设置/获取方法,用于在请求流程中的回调函数共享变量([https://goframe.org/net/ghttp/request](https://goframe.org/net/ghttp/request);
1. 改进`ghttp.Response`,增加`ServeFileDownload`方法用于WebServer引导客户端下载文件([https://goframe.org/net/ghttp/response](https://goframe.org/net/ghttp/response));
1. `gvar`模块新增`gvar.VarRead`只读接口,用于控制对外只暴露数据读取功能;
1. 增加`g.Throw`抛异常方法,`g.TryCatch`异常捕获方法封装;
1. 改进`gcron`模块增加自定义的Cron管理对象增加`New/Start/Stop`方法;
## 功能改进
1. WebServer添加`RouterCacheExpire`配置参数,用于设置路由检索缓存过期时间;
1. WebServer允许同一`HOOK`事件被多次绑定注册,先注册的回调函数优先级更高([https://goframe.org/net/ghttp/service/hook](https://goframe.org/net/ghttp/service/hook));
1. 当前工作目录为系统临时目录时,`gcfg`/`gview`/`ghttp`模块默认不添加工作目录到搜索路径;
1. 改进`WebSocket`默认支持跨域请求([https://goframe.org/net/ghttp/websocket](https://goframe.org/net/ghttp/websocket));
1. 改进`gtime.Format`支持中文;
1. 改进`gfsnotify`,支持编辑器对文件非执行标准编辑时(RENAME+CHMOD)的热更新问题;
1. 改进`gtype.Set`方法增加Set原子操作返回旧的变量值;
1. `gfile.ScanDir`增加支持`pattern`多个文件模式匹配,使用'`,`'符号分隔多个匹配模式;
1. `gcfg`模块增加获取配置变量为`*gvar.Var`;
1. `gstr`模块增加对中文截取方法;
1. 改进`gtime.StrToTime`对常用时间格式匹配模式,新增`gtime.ParseTimeFromContent`方法;
1. 修改配置管理、模板引擎、调试模式的环境变量名称为大写下划线标准格式;
1. 改进`grand`模块随机数生成设计,底层使用`crypto/rand`+缓冲区实现高速的随机数生成([https://goframe.org/util/grand/index](https://goframe.org/util/grand/index));
## 问题修复
1. 修复`gspath`模块在`windows`下搜索失效问题;
1. 修复`gspath`模块Search时带有indexFiles的检索问题;
1. bug fix INZS1([https://github.com/gogf/gf/issues/INZS1](https://github.com/gogf/gf/issues/INZS1));
1. 修复`gproc.ShellRun`在windows下的执行问题;
# `v1.0.898 stable` (2018-10-24)
## 新特性
1. `gf-orm`增加`sqlite`数据库类型支持([http://gf.johng.cn/database/orm/database](http://gf.johng.cn/database/orm/database))
1. 增加`gkafka`模块对kafka的客户端程序封装支持分组消费及指定起始位置等特性并提供简便易用的API接口([http://gf.johng.cn/database/gkafka/index](http://gf.johng.cn/database/gkafka/index))
1. 增加go语言最新版本的`go modules`特性支持;
1. 增加`gcron`定时任务模块([http://gf.johng.cn/os/gcron/index](http://gf.johng.cn/os/gcron/index))
1. `Web Server`增加路由注册项获取/打印特性,所有的路由注册/回调注册一览无余;
1. 模板引擎增加全局变量管理,并增加多个常用的内置函数及内置变量([http://gf.johng.cn/os/gview/funcs](http://gf.johng.cn/os/gview/funcs)
1. `gredis`改进为单例操作方式(基于基层连接池特性),每次操作`redis`服务器时开发者无需显示调用`Close`方法执行关闭([http://gf.johng.cn/database/gredis/index](http://gf.johng.cn/database/gredis/index)
1. `gf-orm`增加数据库操作自动`Close`特性(基于底层链接池特性),开发者无需再`defer db.Close()`,并增加`g.DB`数据库对象单例别名([http://gf.johng.cn/database/orm/linkop](http://gf.johng.cn/database/orm/linkop)
1. 增加`gvar`通用动态变量模块([http://gf.johng.cn/container/gvar/index](http://gf.johng.cn/container/gvar/index)
1. 数据结构容器增加`并发安全特性开启/关闭功能`,当关闭后和普通的数据结构无异,且在非并发安全模式下性能会得到提高;
1. 新增`gmlock`内存锁模块([http://gf.johng.cn/os/gmlock/index](http://gf.johng.cn/os/gmlock/index)
1. 增加`gaes`算法模块([http://gf.johng.cn/crypto/gaes/index](http://gf.johng.cn/crypto/gaes/index)
1. `gproc`模块增加执行`shell`命令方法([http://gf.johng.cn/os/gproc/index](http://gf.johng.cn/os/gproc/index)
1. 新增`gfcache`模块,用于带自动缓存更新的文件内容操作(文档待完善);
## 新功能
1. `glog`增加链式操作方法,增加日志级别管理控制、分类管理、调试管理功能;
1. `g.View`增加分组名称设置,支持通过`g.*`对象管理器获取多个命名的单例模板引擎对象;
1. `glog`增加对文件名称格式的自定义设置,支持`gtime日期格式`
1. `gconv`增加`Ints/Uints/Floats/Interfaces`转换方法;
1. `gjson`增加`Append`方法;
1. `gparser`增加`NewUnsafe/Append`方法;
1. `gcache`增加`GetOrSet/GetOrSetFunc/GetOrSetFuncLock`方法;
1. `gset`增加`LockFunc/RLockFunc`方法;
1. `ghttp.Response`方法完善,增加`ParseTpl/ParseTplContent/TplContent`方法,`Template`修改为`Tpl`方法;
1. `ghttp.Request`增加获取用户真实IP判断;
1. `Session`增加`Contains`方法;
1. 完善`ghtml`模块,增加多个方法;
1. `gcache`新增`Contains/SetIfNotExist`方法;
1. `gvalid`增加`Error`对象,用以管理校验错误信息;
1. `gvalid`模块增加`struct tag`的校验规则、自定义错误提示信息绑定的支持特性([http://gf.johng.cn/util/gvalid/index](http://gf.johng.cn/util/gvalid/index)
1. `ghttp`增加输入参数与`struct`的`绑定机制`,并增加对应`params`标签支持([http://gf.johng.cn/net/ghttp/service/handler](http://gf.johng.cn/net/ghttp/service/handler)
1. `ghttp.Request`增加服务端`BasicAuth`功能(文档待完善)
1. `gvalid`增加字段校验别名用于自定义返回结果字段并更新WebServer中相关使用的模块
1. `gf-orm`链式操作增加`ForPage`方法,调整`Chunks`方法;
1. `ghttp`对象路由注册增加`Init&Shut`自动回调方法,增加重复路由注册检测功能;
1. `gfsnotify`增加默认递归`Add/Remove`特性;
1. `ghttp.Response`增加`ServiceFile`方法;
1. 其他一些新功能;
## 功能改进
1. 改进`ghttp.Server`配置管理;
1. 改进`gcache`底层对象继承关系,改进部分设计细节,提高性能;
1. 改进`gfpool`文件指针池,修复部分错误,提升性能,并增加基准测试代码;
1. 改进`gmap`系列并发安全map数据结构增加多个易用性的方法
1. 改进`gconv.Struct`对象转换功能([http://gf.johng.cn/util/gconv/index](http://gf.johng.cn/util/gconv/index)
1. 改进`grand`随机数生成规则,提供了极高的随机数生成性能,并保证每一次调用随机方法时生成的都是不同的随机数值([http://gf.johng.cn/util/grand/index](http://gf.johng.cn/util/grand/index)
1. 改进`gfile`文件内容操作方法,增加若干常用的文件内容读取方法;
1. 改进`gtime`模块,并增加时区转换方法;
1. 改进`COOKIE`,去掉锁机制;
1. 改进`SESSION`获取方法,新增多个类型获取方法;
1. 改进`g.DB/g.Config`单例缓存键名;
1. 改进`gtcp/gudp`超时错误判断机制;
1. 改进`gtype`底层统一修改为原子操作;
1. 改进`gvalid`对`struct`的`string`属性的默认值非必需校验;
1. 改进`gvalid`在关联规则下的非必需校验;
1. 改进`gf-orm`在调试模式下日志自动输出功能;
1. `ghttp.Server/gspath`模块静态文件检索改进;
1. 优化`ghttp.ServerConfig`配置,增加`struct/method``名称到uri`的转换规则,通过`SetNameToUri`方法进行灵活配置([http://gf.johng.cn/net/ghttp/service/object](http://gf.johng.cn/net/ghttp/service/object)
1. 改进`*any/:name`路由匹配规则,支持不带名字的`*/:`路由规则;
1. 修改默认配置文件名称 `config.yml` -> `config.toml`[http://gf.johng.cn/os/gcfg/index](http://gf.johng.cn/os/gcfg/index)
1. 调整服务注册的`BindControllerMethod`及`BindObjectMethod`逻辑为绑定路由到指定的方法执行;
1. 改进`garray`二分查找方法,增加安全操作处理;
1. 改进`gdb.Result/Recorde` `ToXml`方法,增加可选的`rootTag`参数;
1. 其他一些改进;
## 问题修复
1. 修复`ghttp.Server`在`windows`下的重启失效问题;
1. 修复`ghttp.Server`服务注册与回调注册路由重复判断问题;
1. 修复`garray`排序数组`Add`变参时的死锁问题;
1. 修复`gfsnotify`默认递归监控整个`gspath.Add`添加的目录的问题;
1. 修复`ghttp.BindParams`对`@file`文件上传标识符的转义问题;
1. 修复`ghttp.Server`日志路径丢失问题;
1. 修复`多WebServer`下的状态检测问题;
1. 修复`gvalid`模块`min/max`校验问题;
1. 修复控制器和执行对象服务注册时绑定'/'路由的问题;
1. 修复`gvalid.CheckStruct`自定义错误提示失效问题;
1. `ghttp.Server`修复`hook`与`serve`方法的路由影响,并新增跳转方法;
1. 其他一些修复;
## 其他改动
1. 去掉`gfile.IsExecutable`方法;
1. 目录调整,将`加密/解密`相关的包从`encoding`目录迁移到`crypto`目录下;
1. 增加`gfsnotify/gfcache`调试信息;
1. `gf-orm`允许写入的键值为`nil`时往数据库中写入`null`;
1. 统一使用`gview.Params`类型作为模板变量类型;
1. `gconv.MapToStruct`方法名称修改为`gconv.Struct`
1. `ghttp.Server`完善重启及停止的终端提示信息;
1. 完善`gring`模块,增加`约瑟夫问题`代码作为`gring`示例程序;
1. 其他一些改动;
# `v0.99.682 beta` (2018-08-07)
## 新特性
1、新增gdes包用于DES加密/加密算法处理;
2、新增gkafka包kafka的golang客户端
3、新增gpool对象复用池比较于标准库的sync.Pool更加灵活强大可自定义对象的缓存时间、创建方法、销毁方法(http://gf.johng.cn/686654)
4、完成网络通信gtcp/gudp包的重构并进行了大量的改进工作新增了详尽的开发文档及示例代码(http://gf.johng.cn/494382)
5、增加gring并发安全环标准库container/ring包的并发安全版本并做了易用性的封装(http://gf.johng.cn/686655)
6、gtime包新增了自定义日期格式话的支持格式化语法类似PHP的date语法(http://gf.johng.cn/494387)
7、gdb增加调试模式特性使用SetDebug方法实现在调试模式下可以获取详细的SQL执行记录增加了详细的开发文档及示例代码(http://gf.johng.cn/702801)
8、gdb增加查询缓存特性使用Cache方法实现增加了详细的开发文档及示例代码(http://gf.johng.cn/702801)
9、ghttp.Server路由功能增加字段匹配规则特性支持如/order/list/{page}.html 动态路由规则特性(http://gf.johng.cn/702766)
10、gpage分页包增加分页URL规则生成模板特性内部可使用{.page}变量指定页码位置(http://gf.johng.cn/716438)
11、增加gmap.Map对象这是gmap.InterfaceInterfaceMap的别名
## 新功能
1、gdb增加MaxIdleConnCount/MaxOpenConnCount/MaxConnLifetime三项配置并增加SetMaxConnLifetime方法
2、ghttp.Client增加HTTP账号密码设置功能(SetBasicAuth)
3、glog新增对系统换行符号的自适配调整(\n|\r\n)
4、增加glog控制台调试模式打印开关(SetDebug)
5、gcfg增加SetFileName方法设置默认读取的配置文件名称
6、gcfg/gjson/gparser包新增Int8/16/32/64,Uint8/16/32/64方法
7、增加gzip方法的封装(Zip/Unzip)
8、gview增加模板变量分隔符设置方法SetDelimiters
9、ghttp.Response增加Writef、Writefln方法
## 功能改进
1、改进gfilepool文件指针池设计改进gfile文本内容写入增加指针池使用
2、gdb包增加调试模式特性并支持在调试模式下获得已执行的SQL列表结果
3、改进gproc进程间通信机制增加进程消息分组特性并限定队列大小
4、gdb结果方法处理增加ToXml/ToJson方法
5、gregx包名修改为gregex
6、改进gtime.StrToTime方法新增对常见标准时间日期的自动转换以及对时区的自动识别支持并调整gconv,gvalid对该包的引用
7、增加对字符集转换的封装gxml包中使用新增的字符集转换包来做处理
8、ghttp.Server.EnableAdmin页面Restart接口支持GET参数newExeFilePath支持
9、ghttp.Server平滑重启机制增加可自定义重启可执行文件路径特别是针对windows系统特别有用(因为windows下不支持可执行文件覆盖更新)
10、改进ghttp.Server静态文件检索设计增加开发环境时的main包源码目录查找机制改进gcfg/gview的main包源码目录查找机制
11、优化gcache设计LRU特性非默认开启优化gtype/gcache基准测试脚本新增gregx基准测试脚本改进设计提升性能
12、gfile包增加GoRootOfBuild方法用于获取编译时的GOROOT数值并改进glog包中backtrace的GOROOT路径过滤处理
13、改进grpool代码质量并改进对池化goroutine数量的限制设计
14、改进gdb.Map/List及g.Map/List的类型定义改用别名特性以便支持原生类型输入(map/slice)并修复gdb.Model.Update方法参数处理问题
15、调整ghttp包示例代码目录结构增加ghttp.Client自定义Header方法ghttp.Cookie增加Map方法用于获得客户端提交的所有cookie值构造成map返回
16、删除gcharset中的getcharset方法
17、去掉gmap中常用的基本数据类型转换获取方法
18、改进gconv.String方法当无法使用基本类型进行字符串转换时使用json.Marshal进行转换
19、gvalid.CheckObject方法名称修改为gvalid.CheckStruct
## 问题修复
1、修正gstr.IsNumeric错误
2、修复当xml中encoding字符集为非UTF-8字符集时报错的问题
3、修正gconv包float32->float64精度问题
4、修复gpage包分页计数问题
5、修复gdb批量数据Save错误
6、去掉gpool中math.MAXINT64常量的使用以修复int64到int类型的转换错误兼容32位系统
7、修正ghttp包没有使用Server仍然初始化相关异步goroutine的问题
# `v0.98.503 beta` (2018-05-21)
## 新特性
1、平滑重启特性( http://gf.johng.cn/625833 )
2、gflock文件锁模块( http://gf.johng.cn/626062 )
3、gproc进程管理及通信模块( http://gf.johng.cn/626063 )
4、gpage分页管理模块强大的动态分页及静态分页功能并为开发者自定义分页样式提供了极高的灵活度( http://gf.johng.cn/597431 )
5、ghttp.Server增加多端口监听特性并支持HTTP/HTTPS( http://gf.johng.cn/494366 , http://gf.johng.cn/598802 )
6、增加gspath目录检索包管理工具支持对多目录下的文件检索特性
7、ghttp包控制器及执行对象注册增加更灵活的动态路由特性路由规则增加{method}变量支持;
## 新功能
1、gutil包增加MapToStruct方法支持将map数据类型映射为struct对象
2、gconv
1)、gconv包增加按照类型名称字符串进行类型转换
2)、gconv包新增Time/TimeDuration类型转换方法
3、ghttp
1)、增加Web Server目录安全访问控制机制
2)、ghttp.Server增加自定义状态码回调函数注册处理
4、gdb
1)、gdb包增加gdb.GetStruct/gdb.Model.Struct方法获取查询结果记录自动转换为指定对象
2)、gdb增加Value/Record/Result类型增加对Value类型的系列类型转换方法
3)、gdb包增加db.GetCount,tx.GetCount,model.Count数量查询方法
## 功能改进
1、改进gredis客户端功能封装
2、改进grand包随机数生成性能
3、grand/gdb/gredis包增加benchmark性能测试脚本
4、改进gjson/gparser包的ToStruct方法实现
5、gdb 改进gdb.New获取ORM操作对象性能
6、gcfg :改进配置文件检索功能;
7、gview模板引擎增加多目录检索功能
8、gfile增加源码main包目录获取方法MainPkgPath
9、ghttp
1)、ghttp.Request增加请求进入和完成时间记录并增加到默认日志内容中
2)、ghttp.Server事件回调之间支持通过ghttp.Request.Param自定义参数进行流程传参
10、gdb
1)、改进gdb.Result与gdb.List, gdb.Record与gdb.Map之间的类型转换便于业务层数据编码处理(如json/xml)
2)、改进gdb.Tx.GetValue返回值类型
3)、gdb.Model.Data参数支持更加灵活的map参数
## 问题修复
1、ghttp
1)、修复ghttp包路由缓存问题
2)、修复服务注册时的控制器及执行对象方法丢失问题;
2、gconv
1)、修正gconv.Float64方法位大小设置问题
2)、修复gconv.Int64(float64(xxx))问题;
2、gdb
1)、修复gdb.GetAll针对返回数据列表的for..range...的返回结果slice相同指针问题
2)、修复gdb.Delete方法错误
3)、修复gdb.Model.And/Or方法
4)、修复gdb.Model.Where方法参数处理问题
3、garray修复garray包Remove方法锁机制问题
4、gtype 修复gtype.Float32/gtype.Float64对象类型的方法逻辑错误
5、gfsnotify修复在windows下文件参数中不同文件分隔符引起的热更新机制失效问题
6、修复gvalid包验证问题如果值为nil并且不需要require*验证时,其他验证失效。并增加单元测试项,测试通过。
# `v0.97.399 beta` (2018-04-23)
1、 增加gfsnotify文件监控模块
2、 配置管理模块增加配置文件自动检测更新机制;
3、 模板引擎增加对模板文件的自动检测更新机制;
4、 改进gconv包基本类型转换功能提高转换性能
5、 增加gpage分页管理包支持动态分页、静态分页以及自定义分页样式特性
6、 ghttp.Request增加Exit方法用以标记服务退出当在服务执行前调用后服务将不再执行
7、 ghttp.Response去掉WriteString方法统一使用Write方法返回数据流是使用灵活的参数形式
8、 模板引擎增加模板变量暴露接口LockFunc/RLockFunc以便支持开发者灵活处理模板变量
9、 ghttp.Server增加access & error log功能并支持开发者自定义日志处理回调函数注册
10、增加gredis包支持对redis的客户端操作封装并将gredis.Redis对象加入到gins单例管理器中进行统一配置管理维护
11、gins单例管理器增加对单例对象配置文件的自动检测更新机制当配置文件在外部发生变更时自动刷新单例管理器中的单例对象
12、gdb数据库ORM包增加And/Or条件链式方法并改进Where/Data方法参数灵活性
13、对于新增加的模块同时也增加了对应的开发文档并梳理完善了现有的其他模块开发文档
14、修复ISSUE:
#IISWI github.com/gogf/gf/issues/IISWI,
#IISMY github.com/gogf/gf/issues/IISMY,
反馈并跟踪完成第三方依赖mxj包的ISSUE修复(github.com/clbanning/mxj/issues/48)

View File

@ -1,266 +0,0 @@
# `v1.10.0` (2019-12-05)
各位`gfer`久等了,较上一次发布时间过去已有两个多月了,这段时间`GF`也在不断地迭代改进,细节比较多,拟了个大概,以下是`release log`。
另外,`GoFrame`也参加了2019最受欢迎中国开源软件评选投票明天就结束了欢迎为`GF`投票啊https://www.oschina.net/project/top_cn_2019 网页可以投一票,微信也可以投一票。
## 新特性
1. `Web Server`新特性:
- 改进中间件及分组路由实现https://goframe.org/net/ghttp/router/middleware
- 增加文件配置管理特性https://goframe.org/net/ghttp/config
- 改进参数获取https://goframe.org/net/ghttp/request
- 改进文件上传https://goframe.org/net/ghttp/client/demo/upload
1. `Session`增加内置的多种`Storage`实现:
- 基本介绍https://goframe.org/os/gsession/index
- 文件存储https://goframe.org/os/gsession/file
- 内存存储https://goframe.org/os/gsession/memory
- `Redis`存储https://goframe.org/os/gsession/redis
1. 增加日志组件单例对象,并优化配置管理:
- https://goframe.org/frame/g/index
- https://goframe.org/os/glog/config
1. 常用的`container`容器增加`JSON`数据格式的`Marshal`/`UnMarshal`接口实现:
- https://goframe.org/container/gmap/index
- https://goframe.org/container/garray/index
- https://goframe.org/container/gset/index
- https://goframe.org/container/gvar/index
- https://goframe.org/container/gtype/index
- https://goframe.org/container/glist/index
- https://goframe.org/container/gvar/index
1. 新增`guuid`模块,用于通用的`UUID`生成https://goframe.org/util/guuid/index
## 功能改进
### `net`
1. `ghttp`
- 改进请求流程处理性能;
- `Server`增加对`Logger`日志对象的配置;
- `Server`开放了`GetRouterMap`方法,用于获得当前服务的路由列表信息,使得开发者可以更方便地实现自定义权限管理;
- `Server`配置管理优化;
- `Client`客户端对象进行了大量的改进工作;
- `Client`客户端对象增加多文件上传功能;
- `Request`对象增加`GetError`方法,用于获取当前处理错误;
- `Request`对象增加独立的视图对象及视图变量绑定功能,使得每个请求可以独立视图管理,也可以通过中间件切换请求对象的视图对象。默认情况下该功能关闭,视图解析时使用的是`Server`对象的视图对象;
- 改建`Response`对象的`CORS`功能;
- 增加`Response.WriteTplDefault`方法,用于解析并返回默认的模板内容;
- 增加更多的单元测试用例;
- 其他改进;
1. `gipv4`/`gipv6`
- 一些改进工作;
1. `gtcp`/`gudp`
- 一些改进工作;
### `database`
1. `gdb`
- 大量细节改进工作;
- 去掉查询数据为空时的`sql.ErrNoRows`错误返回,保留`Struct`/`Structs`/`Scan`方法在操作数据为空的该错误返回;
- 调试模式开启时输出的SQL语句改进为完整的带参数的SQL仅作参考
- `Where`方法增加对`gmap`数据类型支持,包括顺序性的`ListMap`/`TreeMap`等等;
- 查询缓存方法`Cache`的缓存时间参数类型修改为`time.Duration`
- 修改`Record`/`Result`的数据类型转换方法名称,原有的转换方法标记为`deprecated`
- `Record`/`Result`查询结果类型增加`IsEmpty`方法,用于判断结果集是否为空;
- `Record`类型增加`GMap`方法,用于将查询记录转换为`gmap`类型;
- 增加`Option`/`OptionOmitEmpty`方法,用于输入参数过滤,包括`Data`参数及`Where`参数https://goframe.org/database/gdb/empty
- 增加字段排除方法`FieldsEx`https://goframe.org/database/gdb/senior
- 增加日志功能特性https://goframe.org/database/gdb/senior
- 改进数据库配置管理https://goframe.org/database/gdb/config
- 增加大量单元测试;
1. `gredis`
- 返回数据类型转换改进https://github.com/gogf/gf/issues/415
- 完善单元测试;
- 其他改进;
### `os`
1. `gcache`
- 需要注意了:缓存的有效时间参数从`interface{}`类型调整为了`time.Duration`类型,因此不再兼容之前的`int`参数类型,以保证更好的性能;
1. `gfcache`
- 由于`gcache`组件的缓存时间参数类型的变更,因此该组件的时间参数也变更为了`time.Duration`类型;
1. `gcfg`
- 增加`Available`方法,用以判断配置是否有效;
1. `gfile`
- 增加`Chdir`方法,用于工作目录切换;
1. `gtime`
- 增加`JSON`数据格式的`Marshal`/`UnMarshal`接口实现;
### `container`
1. `gmap`
- 增加`MapStrAny`方法,用于常见`map`类型的转换;
- 增加`MapCopy`方法,用于底层`map`数据复制;
- 增加`FilterEmpty`方法,用于`map`空值过滤;
- 增加`Pop`/`Pops`方法,用于随机返回`map`中的数据项(并删除);
- 增加`Replace`方法,用于给定的`map`数据覆盖底层`map`数据项;
- 完善单元测试;
- 其他改进;
1. `garray`
- 增加`Interfaces`转换方法,返回`[]interface{}`类型;
- 对排序数组增加`SetComparator`方法用户自定义修改比较器;
- 完善单元测试;
- 其他改进;
1. `glist`
- 增加`NewFrom`方法,基于给定的`[]interface{}`变量创建链表;
- 增加`Join`方法,用于将链表项使用给定字符串连接为字符串返回;
- 完善单元测试;
- 其他改进;
1. `gset`
- 增加`AddIfNotExistFunc`/`AddIfNotExistFuncLock`方法;
- 完善单元测试;
- 其他改进;
1. `gtree`
- 增加`Replace`方法,用于更新现有树的数据项;
- 其他改进;
1. `gtype`
- 一些细节改进工作,不一一列出;
- 完善基准测试、单元测试;
1. `gvar`
- 增加`Ints`/`Uints`类型转换方法;
- 其他改进;
### `crypto`
1. `gmd5`
- 小细节改进;
1. `gsha1`
- 小细节改进;
### `text`
1. `gstr`
- 改进`SplitAndTrim`方法,将`SplitAndTrimSpace`标记为`deprecated`
- 增加`TrimStr`方法;
- 完善单元测试;
- 其他改进;
### `debug`
1. `gdebug`
- 增加`CallerFileLineShort`/`FuncPath`/`FuncName`方法;
- 其他改进;
### `encoding`
1. `gbase64`
- 增加`EncodeToString`/`EncodeFile`/`EncodeFileToString`/`DecodeToString`方法;
- 完善单元测试;
1. `gjson`
- 完善单元测试;
### `frame`
1. `g`/`gins`
- https://goframe.org/frame/g/index
- 增加`CreateVar`方法;
- 完善单元测试;
- 其他改进;
### `util`
1. `gconv`
- 改进优化部分类型转换方法性能;
- 增加`Uints`/`SliceUint`类型转换方法;
- 增加`UnsafeStrToBytes`/`UnsafeBytesToStr`高性能的类型转换方法;
- 增加对`MapStrAny`接口方法的支持,用于常见`map`类型的转换;
- 其他改进;
1. `gvalid`
- 改进对中国身份证号的识别校验功能;
- 增加`luhn`银行卡号的校验功能;
1. `grand`
- 一些性能改进工作;
## Bug Fix
1. 解决`WebSocket`关闭时的`hijacked`报错问题https://github.com/gogf/gf/issues/381
1. 解决静态文件服务时大文件的内存占用问题;
1. 修复前置`Nginx`后默认情况下的`Cookie`域名设置问题;
1. 修复`gconv.Struct`在属性为`[]struct`并且输入属性参数为空时的转换失败问题https://github.com/gogf/gf/issues/405
1. 其他一些修复;
# `v1.9.3` (2019-09-24)
该版本实际为`v2.0`的大版本发布,为避免`go module`机制严格要求`v2`版本以上需要修改`import`并加上`v2`后缀,因此使用了`v1.9`版本进行发布。
## 新特性
1. 新增`gf`命令行开发辅助工具https://goframe.org/toolchain/cli
1. 新增`gres`资源管理器模块https://goframe.org/os/gres/index
1. 重构`Session`功能,新增`gsession`模块,`WebServer`默认使用文件存储`Session`https://goframe.org/net/ghttp/session
1. `WebServer`新增中间件特性并保留原有的HOOK设计两者都可实现请求拦截、预处理等等特性https://goframe.org/net/ghttp/router/middleware
1. 新增`gi18n`国际化管理模块https://goframe.org/i18n/gi18n/index
1. 新增`gini`模块https://goframe.org/encoding/gini/index
1. `WebServer`新增更便捷的层级路由注册方式https://goframe.org/net/ghttp/group/level
1. `gcmd`命令行参数解析模块重构,增加`Parser`解析对象https://goframe.org/os/gcmd/index
1. 新增`gdebug`模块,用于堆栈信息获取/打印https://goframe.org/debug/gdebug/index
## 重大调整
1. 去掉`1.x`版本中已经被标记为`deprecated`的方法;
1. 调整`container`分类的容器模块,将默认并发安全参数调整为默认非并发安全;
1. 目录调整:
- 去掉`third`目录,统一使用`go module`管理包依赖;
- 将原有`g`目录中的模块移出到框架主目录,原有的`g`模块移动到`frame/g`目录;
- 将原有`geg`示例代码目录名称修改为`.example`
## 功能改进
1. `ghttp`
- 改进`Request`参数解析方式https://goframe.org/net/ghttp/request
- 改进跨域请求功能,新增`Origin`设置及校验功能https://goframe.org/net/ghttp/cors
- `Cookie`及`Session`的`TTL`配置数据类型修改为`time.Duration`;
- 新增允许同时通过`Header/Cookie`传递`SessionId`
- 新增`ConfigFromMap/SetConfigWithMap`方法,支持通过`map`参数设置WebServer
- 改进默认的`CORS`配置,增加对常见`Header`参数的默认支持;
- 新增`IsExitError`方法,用于开发者自定义处理`recover`错误处理时,过滤框架本身自定义的非异常错误;
- 新增`SetSessionStorage`配置方法,用于开发者自定义`Session`存储;
- `ghttp.Request`新增更多的参数获取方法;
1. `gdb`
- 增加对SQL中部分字段的自动转义(`Quote`)功能;
- 增加对方法操作以及链式操作中的`slice`参数的支持;
- 增加`SetLogger`方法用于开发者自定义数据库的日志打印;
- 增加`Master/Slave`方法,开发者可自主选择数据库操作执行的主从节点;
- 增加对`mssql/pgsql/oracle`的单元测试;
- 在`debug`模式支持完整带参数整合的SQL语句调试打印
- 增加了更多的功能方法;
1. `glog`
- 新增`Default`方法用于获取默认的`Logger`对象;
- 新增`StackWithFilter`方法用于自定义堆栈打印过滤;
- 增加了更多的功能方法;
1. `gfile`
- 部分方法名称调整:`Get/PutBinContents`修改为`Get/PutBytes`
- 增加`ScanDirFile`方法,用于仅检索文件目录,支持递归检索;
- 增加了更多的功能方法;
1. `gview`
- 新增`SetI18n`方法用于设置视图对象自定义的`gi18n`国际化对象;
- 新增对`gres`资源管理器的内置支持;
1. `gcompress`
- 增加`zip`算法的文件/目录的压缩/解压方法;
- 文件/目录压缩参数支持多路径;
1. `gconv`
- 改进对`[]byte`数据类型参数的支持;
- 新增`Unsafe`转换方法,开发者可在特定场景下使用,提高转换效率;
- 新增`MapDeep/StructDeep/StructsDeep`方法,支持递归`struct`转换;
1. `gjson/gparser`
- 改进类型自动识别功能;
- 新增`LoadJson/LoadXml/LoadToml/LoadYaml/LoadIni`方法用于自定义的数据类型内容加载;
- 增加了更多的功能方法;
1. `gerror`
- 改进错误堆栈获取逻辑;
- 增加了更多的功能方法;
1. `gmap/garray/gset/glist/gvar`
- 改进并发安全基准测试脚本;
- 修改`garray.StringArray`为`garray.StrArray`
- 增加了更多的功能方法;
1. `gdes`
- 规范化修改方法名称;
1. `gstr`
- 增加`Camel/Snake`相关命名转换方法;
- 增加了更多的功能方法;
1. `genv`
- 增加了更多的功能方法;
## Bug Fix
1. 修复`gvalid`校验`struct`时的`tag`自定义错误失效的问题;
1. 修复`gcfg`配置管理模块在特定情况下的内容类型自动识别失败问题;
1. 修复`gqueue`在用户主动关闭队列时的并发安全问题;
1. 修复`session`在开发者设置的`TTL`过大时的整型变量溢出问题;

132
TODO.MD
View File

@ -1,132 +0,0 @@
# ON THE WAY
1. 增加图形验证码支持,至少支持数字和英文字母;
1. Cookie&Session数据池化处理
1. ghttp.Client增加proxy特性
1. gtime增加对时区转换的封装并简化失去转换时对类似+80500时区的支持
1. orm增加sqlite对Save方法的支持(去掉触发器语句);
1. ghttp.Server增加Ip访问控制功能(DenyIps&AllowIps)
1. ghttp增加返回数据压缩机制
1. ghttp.Server增加proxy功能特性本地proxy和远程proxy本地即将路由规则映射远程即反向代理
1. gjson对大json数据的解析效率问题
1. ghttp增加route name特性并同时支持backend和template(提供内置函数)引用可以通过RedirectRoute方法给定route name和路由参数跳转到指定的路由地址上
1. gvalid校验支持当第一个规则失败后便不再校验后续的规则最好做成链式操作
1. gvalid增加支持对[]rune的长度校验(一个中文占3个字节)
1. ghttp.Request增加对输入参数的自动HtmlEncode机制
1. 常量命名风格根据golint进行修改
1. 开放rwmutex包并将gjson的互斥锁使用自定义的mutex替换
1. 文档完善:
- gconv struct tag、
- 控制器及执行对象注册的Init&Shut方法、
- ghttp.Response&ServeFile、gfcache、gproc shell执行、
- ghttp Server&Client basic auth、
- glog分类&日志等级&链式操作、gdb debug自动输出调试信息、gmlock内存锁、
1. 服务注册域名增加对泛域名的支持;
1. Cookie设置中文失效问题
1. 使用gconv将slice映射到struct属性上例如redis hscan的结果集
1. 项目参考:
- https://github.com/namreg/godown
- https://github.com/Masterminds/sprig
1. gform参考 https://gohouse.github.io/gorose/dist/index.html 进行改进
1. gtcp提供简便的包发送/接收方法(SendPkg/RecvPkg)以解决常见的TCP通信粘包问题并完善文档参考https://www.cnblogs.com/kex1n/p/6502002.html
1. 路由增加不区分大小写得匹配方式;
1. 改进WebServer获取POST参数处理逻辑当提交非form数据时例如json数据针对某些方法可以直接解析
1. WebServer增加可选择的路由覆盖配置默认情况下不覆盖
1. grpool性能压测结果变慢的问题
1. 增加jumplist的数据结构容器
1. DelayQueue/PriorityQueue
1. 权限管理模块;
1. 从ghttp中剥离SESSION功能构成单独的模块gsession
1. 改进gproc进程间通信处理逻辑提高稳定性以应对进程间大批量的数据发送/接收;
1. ghttp的热重启的本地进程端口监听在不使用该特性时默认关闭掉
1. gtcp增加对TLS加密通信的支持
1. 添加Save/Replace/BatchSave/BatchReplace方法对sqlite数据库的支持
1. 添加sqlite数据库的单元测试用例
1. gredis增加cluster支持
1. gset.Add/Remove/Contains方法增加批量操作支持
1. gmlock增加手动清理机制当内存锁不再使用时由调用端决定是否清理内存锁
1. gtimer增加DelayAdd*方法返回Entry对象以便DelayAdd*的定时任务也能进行状态控制gcron同理需要改进
1. 改进gdb对pgsql/mssql/oracle的支持使用方法覆盖的方式改进操作而不是完全依靠正则替换的方式
1. gdb的Cache缓存功能增加可自定义缓存接口以便支持外部缓存功能缓存接口可以通过io.ReadWriter接口实现
1. grpool增加支持阻塞添加任务接口
1. gdb.Model在链式安全的对象创建中增加sync.Pool的使用
1. 增加g.Table快捷方法以方便操作数据表但是得考虑后续模型操作设计特别是脚手架的模型管理
1. 改进ghttp分组路由中对hook的支持方式以便格式与BindHookHandler统一
# DONE
1. gconv完善针对不同类型的判断例如尽量减少sprintf("%v", xxx)来执行string类型的转换
2. ghttp.Server请求执行中增加服务退出的方法不再执行后续操作
3. ghttp.Response对象完善并改进数据返回方法(Write/WriteString)
4. ghttp.Server请求执行中增加服务退出的方法不再执行后续操作
5. 增加fsnotify包支持
6. 改进gcfg和gview的文件自动更新机制
7. 将模板变量进行暴露,以便应用端可以进行灵活控制;
8. 跟踪第三方mxj包的issue问题https://github.com/clbanning/mxj/issues/48
9. gdb Where方法参数的改进研究是否可以将string参数类型修改为interface{}
10. gpage分页控制功能
11. https支持
12. ghttp.Server日志中增加请求时间和返回时间以便计算执行时间差
13. 由于去掉了gdb的单例模式并且将gins的部分对象封装迁移到了g包中需要同时梳理文档完善修改
14. 在代码中增加https与http同时开启使用的示例代码这块大家问得比较多
15. ghttp.Server多个事件之间通过ghttp.Request.Param自定义参数传参
16. 研究是否增加配置文件目录检索功能,特别是如何友好改进开发环境的配置文件默认目录问题;
17. 增加ghttp.Server不同状态码的自定义处理方法
18. ghttp.Server平滑重启方案
19. 完善gconv类型转换功能增加time.Time/time.Duration类型转换并增加benchmark测试脚本
20. 当二进制参数为nil时gjson.LoadContent并将gjson.Json对象ToMap时会报错
21. 改进控制器及执行对象注册,更友好地支持动态路由注册,例如:注册规则为 /channel/:name现有的控制器及执行对象注册很难友好支持这种动态形式
22. 当前gpage分页包的输出标签不支持li大多数CSS框架都是li+a标签模式需要提供可更加灵活的定制化功能实现
23. 平滑重启机制改进,以便于开发阶段调试;
24. 对grpool进行优化改进包括属性原子操作封装采用gtype实现修正设计BUGhttps://github.com/gogf/gf/issues/6
25. gredis增加redis密码支持
26. 改进ghttp.Server平滑重启机制当新进程接管服务后再使用进程间通信方式通知父进程销毁
27. gproc进程间通信增加分组特性不同的进程间可以通过进程ID以及分组名称发送/获取进程消息;
28. ORM增加获取被执行的sql语句的方法
29. gdb增加查询缓存特性
30. gpage分页增加对自定义后缀的支持如:2.html, 2.php等等
31. gvalid包增加struct tag的校验规则、自定义错误提示信息绑定的支持特性
32. 增加文件缓存包可根据fsnotify机制进行缓存更新
33. *any/:name路由匹配路由改进支持不带名字的*/:路由规则;
34. ghttp静态文件服务改进(特别是403返回状态的修改)
35. map转struct增加对tag的支持
36. gcache检查在i386下的int64->int转换问题
37. ghttp获取参数支持直接转struct功能
38. gfsnotify增加对于目录的监控
39. 检查windows下的平滑重启失效问题
40. ghttp.Server的Cookie及Session锁机制优化(去掉map锁机制);
41. 解决glog串日志情况
42. glog增加对日志文件名称的生成规则设定支持时间格式规则
43. ghttp日志增加客户端IP信息
44. 完善gform配置管理说明g.DB/Database和gdb.New的区别
1. 完善配置管理章节,说明默认的配置文件更改方式;
1. 服务注册时判断方法定义满足规范时才执行绑定否则提示WARN信息
1. `gfsnotify`增加添加监听文件时的监听ID返回以便调用端删除监听时只删除自己添加的监听而不影响其他对该同一文件的监听回调
1. `gfsnotify`针对添加目录监听时无法使用多个`Watcher`,考虑改进,并考虑动态扩容全局`Watcher`方案;
1. 由于系统对inotify实例数量(`fs.inotify.max_user_instances`)以及队列大小(`fs.inotify.max_user_watches`)有限制,需要改进`gfsnotify`
1. WebServer事件回调允许对同一个路由规则绑定多个事件回调
1. gcfg/gview/ghttp等模块加上对临时文件目录的自动添加监听判断基本是开发环境下特别是windows环境去掉临时文件的监听避免临时文件过大引起的运行缓慢占用内存问题
1. 改进gfpool在文件指针变化时的更新
1. ghttp hook回调使用方式在注册路由比较多的时候优先级可能使得开发者混乱考虑方式便于管理
1. gform对于MySQL字段类型为datetime类型的时区问题分析
1. 改进证书打开失败时的WebServer错误提示前置HOOK校验后关闭后续的HOOK逻辑执行
1. 目前WebServer的HOOK是按照优先级执行的需要增加覆盖特性
1. 更新跨域请求CORS相关功能文档
1. ghttp.Response增加输出内容后自动退出当前请求机制不需要用户手动return参考beego如何实现
1. gcfg包目前允许添加重复的目录路径需要在SetPath/AddPath时判断重复性不能添加重复的路径
1. gdb执行数据写入时如果参数为struct/[]struct自动映射与表字段对应关系不再使用gconv标签标识
1. gdb的Data方法支持struct参数传入
1. gfcache依旧使用gcache作为缓存控制对象不要使用gmap
1. 增加对ghttp路由注册的{.struct}/{.method}单元测试;
1. gconv针对struct的转换增加json tag支持gconv.Map默认也支持json tag, 完善开发文档;
1. 增加SO_REUSEPORT的支持
1. gkafka这个包比较重未来从框架中剥离出来
1. str_ireplace: http://php.net/manual/en/function.str-ireplace.php
1. strpos/stripos/strrpos/strripos: http://php.net/manual/en/function.stripos.php
1. gfile对于文件的读写强行使用了gfpool在某些场景下不合适需要考虑剥离开并为开发者提供单独的指针池文件操作特性
1. ghttp.Client自动Close机制
1. ghttp路由功能增加分组路由特性
1. 增加可选择性的orm tag特性用以数据表记录与struct对象转换的键名属性映射
1. gview中的template标签失效问题

View File

@ -1,8 +1,8 @@
// Copyright 2018 gf Author(https://github.com/gogf/gf). All Rights Reserved.
// 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 garray provides concurrent-safe/unsafe arrays.
// Package garray provides most commonly used array containers which also support concurrent-safe/unsafe switch feature.
package garray

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