Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 556dd44

Browse files
committed
refactors
1 parent 10df566 commit 556dd44

File tree

198 files changed

+735
-873
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

198 files changed

+735
-873
lines changed

src/server/studygolang/background.go renamed to background.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77
package main
88

99
import (
10-
"db"
1110
"flag"
12-
"global"
13-
"logic"
14-
"model"
15-
"server"
1611
"time"
1712

13+
"github.com/studygolang/studygolang/modules/db"
14+
"github.com/studygolang/studygolang/modules/global"
15+
"github.com/studygolang/studygolang/modules/logic"
16+
"github.com/studygolang/studygolang/modules/model"
17+
"github.com/studygolang/studygolang/modules/server"
18+
1819
"github.com/polaris1119/config"
1920
"github.com/polaris1119/logger"
2021
"github.com/robfig/cron"

src/server/crawler/main.go renamed to cmd/crawler.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,20 @@
44
// http://studygolang.com
55
// Author: polaris [email protected]
66

7-
package main
7+
package cmd
88

99
import (
1010
"math/rand"
11-
"server"
1211
"time"
1312

13+
"github.com/studygolang/studygolang/modules/server"
14+
1415
"github.com/polaris1119/config"
1516
"github.com/polaris1119/keyword"
1617
"github.com/polaris1119/logger"
1718
)
1819

19-
func init() {
20-
// 设置随机数种子
21-
rand.Seed(time.Now().Unix())
22-
}
23-
24-
func main() {
20+
func Crawler() {
2521
logger.Init(config.ROOT+"/log", config.ConfigFile.MustValue("global", "log_level", "DEBUG"), "crawl")
2622
go keyword.Extractor.Init(keyword.DefaultProps, true, config.ROOT+"/data/programming.txt,"+config.ROOT+"/data/dictionary.txt")
2723

src/server/indexer/main.go renamed to cmd/indexer.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,20 @@
44
// http://studygolang.com
55
// Author: polaris [email protected]
66

7-
package main
7+
package cmd
88

99
import (
1010
"math/rand"
11-
"server"
1211
"time"
1312

13+
"github.com/studygolang/studygolang/modules/server"
14+
1415
"github.com/polaris1119/config"
1516
"github.com/polaris1119/keyword"
1617
"github.com/polaris1119/logger"
1718
)
1819

19-
func init() {
20-
// 设置随机数种子
21-
rand.Seed(time.Now().Unix())
22-
}
23-
24-
func main() {
20+
func Indexer() {
2521
logger.Init(config.ROOT+"/log", config.ConfigFile.MustValue("global", "log_level", "DEBUG"))
2622
go keyword.Extractor.Init(keyword.DefaultProps, true, config.ROOT+"/data/programming.txt,"+config.ROOT+"/data/dictionary.txt")
2723

src/server/migrator/main.go renamed to cmd/migrator.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,16 @@
33
// license that can be found in the LICENSE file.
44
// http://studygolang.com
55
// Author: javasgl [email protected]
6-
package main
6+
package cmd
77

88
import (
9-
"server"
9+
"github.com/studygolang/studygolang/modules/server"
1010

1111
"github.com/polaris1119/config"
1212
"github.com/polaris1119/logger"
1313
)
1414

15-
func init() {
16-
17-
}
18-
19-
func main() {
15+
func Migrator() {
2016

2117
logger.Init(config.ROOT+"/log", config.ConfigFile.MustValue("global", "log_level", "DEBUG"))
2218
server.MigratorServer()

go.mod

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
module github.com/studygolang/studygolang
2+
3+
go 1.12
4+
5+
require (
6+
github.com/PuerkitoBio/goquery v1.5.0
7+
github.com/Unknwon/goconfig v0.0.0-20190425194916-3dba17dd7b9e // indirect
8+
github.com/adamzy/cedar-go v0.0.0-20170805034717-80a9c64b256d // indirect
9+
github.com/dchest/captcha v0.0.0-20170622155422-6a29415a8364
10+
github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
11+
github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a // indirect
12+
github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51 // indirect
13+
github.com/facebookgo/freeport v0.0.0-20150612182905-d4adf43b75b9 // indirect
14+
github.com/facebookgo/grace v0.0.0-20180706040059-75cf19382434
15+
github.com/facebookgo/httpdown v0.0.0-20180706035922-5979d39b15c2 // indirect
16+
github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 // indirect
17+
github.com/facebookgo/stats v0.0.0-20151006221625-1b76add642e4 // indirect
18+
github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870 // indirect
19+
github.com/fatih/structs v1.1.0
20+
github.com/garyburd/redigo v1.6.0
21+
github.com/go-sql-driver/mysql v1.4.1
22+
github.com/go-validator/validator v0.0.0-20180514200540-135c24b11c19
23+
github.com/go-xorm/xorm v0.7.5
24+
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 // indirect
25+
github.com/gorilla/context v1.1.1
26+
github.com/gorilla/feeds v1.1.1
27+
github.com/gorilla/schema v1.1.0
28+
github.com/gorilla/sessions v1.2.0
29+
github.com/huichen/sego v0.0.0-20180617034105-3f3c8a8cfacc // indirect
30+
github.com/issue9/assert v1.3.3 // indirect
31+
github.com/jaytaylor/html2text v0.0.0-20190408195923-01ec452cbe43
32+
github.com/jmcvetta/randutil v0.0.0-20150817122601-2bb1b664bcff // indirect
33+
github.com/labstack/echo v2.0.0+incompatible
34+
github.com/labstack/gommon v0.2.9 // indirect
35+
github.com/lunny/html2md v0.0.0-20181018071239-7d234de44546
36+
github.com/mattn/go-runewidth v0.0.4 // indirect
37+
github.com/myesui/uuid v1.0.0 // indirect
38+
github.com/olekukonko/tablewriter v0.0.1 // indirect
39+
github.com/polaris1119/config v0.0.0-20160628025248-e4f8b7e9e2ef
40+
github.com/polaris1119/echoutils v0.0.0-20170312113056-5e14d4b37f74
41+
github.com/polaris1119/email v0.0.0-20171030115359-9c57dd3e3e7d
42+
github.com/polaris1119/goutils v0.0.0-20160602032428-582c98b3184b
43+
github.com/polaris1119/keyword v0.0.0-20170608075927-96ae6735f2f2
44+
github.com/polaris1119/logger v0.0.0-20170422061149-0233d014769e
45+
github.com/polaris1119/middleware v0.0.0-20170422072158-4876473158db
46+
github.com/polaris1119/nosql v0.0.0-20181019111233-3852ef28d084
47+
github.com/polaris1119/set v0.1.0
48+
github.com/polaris1119/slices v0.0.0-20160517071324-6ecacdb3cd38
49+
github.com/polaris1119/times v0.0.0-20160420102536-14f7f3ba487e
50+
github.com/qiniu/api.v6 v6.0.9+incompatible
51+
github.com/qiniu/bytes v0.0.0-20140728010635-4887e7b2bde3 // indirect
52+
github.com/qiniu/rpc v0.0.0-20140728010754-30c22466d920 // indirect
53+
github.com/robfig/cron v1.2.0
54+
github.com/smartystreets/goconvey v0.0.0-20190710185942-9d28bd7c0945 // indirect
55+
github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf // indirect
56+
github.com/sundy-li/html2article v0.0.0-20180131134645-09ac198090c2
57+
github.com/tidwall/gjson v1.3.2
58+
github.com/twinj/uuid v1.0.0
59+
github.com/tylerb/graceful v1.2.15
60+
golang.org/x/net v0.0.0-20190607181551-461777fb6f67
61+
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421
62+
golang.org/x/sys v0.0.0-20190609082536-301114b31cce // indirect
63+
golang.org/x/text v0.3.2
64+
gopkg.in/validator.v2 v2.0.0-20180514200540-135c24b11c19 // indirect
65+
xorm.io/core v0.7.0
66+
)
67+
68+
replace github.com/labstack/echo => github.com/labstack/echo v2.0.0+incompatible

0 commit comments

Comments
 (0)