Skip to content

Commit

Permalink
sync: 同步更新
Browse files Browse the repository at this point in the history
  • Loading branch information
qbhy committed Feb 13, 2023
1 parent d8bfdb6 commit c507beb
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 56 deletions.
8 changes: 4 additions & 4 deletions app/console/kernel.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
commands2 "github.com/goal-web/goal/app/console/commands"
)

func Service() contracts.ServiceProvider {
return &console.ServiceProvider{ConsoleProvider: NewKernel}
func NewService() contracts.ServiceProvider {
return console.NewService(NewKernel)
}

func NewKernel(app contracts.Application) contracts.Console {
Expand All @@ -23,11 +23,11 @@ type Kernel struct {
app contracts.Application
}

func (this *Kernel) Exists(schedule string) bool {
func (kernel *Kernel) Exists(schedule string) bool {
return true
}

func (this *Kernel) Schedule(schedule contracts.Schedule) {
func (kernel *Kernel) Schedule(schedule contracts.Schedule) {
//schedule.Call(func() {
// logs.Default().Info("周日每5秒钟打印 周日愉快")
//}).EveryFiveSeconds().Sundays()
Expand Down
2 changes: 1 addition & 1 deletion config/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var (
configs = make(map[string]contracts.ConfigProvider)
)

func Configs() map[string]contracts.ConfigProvider {
func GetConfigProviders() map[string]contracts.ConfigProvider {
return configs
}

Expand Down
13 changes: 11 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/goal-web/goal

go 1.17
go 1.19

require (
github.com/asim/go-micro/plugins/registry/etcd/v4 v4.0.0-20220224093209-dca3a3b5535c
Expand All @@ -10,7 +10,7 @@ require (
github.com/goal-web/cache v0.1.2
github.com/goal-web/config v0.1.3
github.com/goal-web/console v0.1.5
github.com/goal-web/contracts v0.1.57
github.com/goal-web/contracts v0.1.62
github.com/goal-web/database v0.1.12
github.com/goal-web/email v0.1.1
github.com/goal-web/encryption v0.1.1
Expand Down Expand Up @@ -120,3 +120,12 @@ require (
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
)

replace (
github.com/goal-web/auth => ../auth
github.com/goal-web/bloomfilter => ../bloomfilter
github.com/goal-web/cache => ../cache
github.com/goal-web/config => ../config
github.com/goal-web/console => ../console
github.com/goal-web/container => ../container
)
59 changes: 24 additions & 35 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -242,46 +242,36 @@ github.com/goal-web/application v0.1.0/go.mod h1:pHFKbdFw0UsckCsgHKF6agBqdfxT/qN
github.com/goal-web/application v0.1.2/go.mod h1:Kukcao7X+pkhk4J9Vn/fNWnjVkhAb1+82Wt31HmeVWo=
github.com/goal-web/application v0.1.4 h1:TJGM3ci+tSLYQ79PdqgDwc1IS6LS9qLmolaasvql53Q=
github.com/goal-web/application v0.1.4/go.mod h1:J82RNWrZfzUlwW6uoXKRKdmo0xs1lpJKXPSSd0Pj2ns=
github.com/goal-web/auth v0.1.10 h1:Ice4xQNtCgV3woL3yboMjFacytcEuGQhTCRqcPk2G18=
github.com/goal-web/auth v0.1.10/go.mod h1:nkTjON3ipd4lLvN62Q/GcSig8m9Cb5324/Vs0BH0F4k=
github.com/goal-web/bloomfilter v0.1.2 h1:cNvzxFZupzZ/t8E8A52cToexnWZMjD8Ce4RmA/C/zOs=
github.com/goal-web/bloomfilter v0.1.2/go.mod h1:7g57fH7lbbTqKgB4ArGcIhrCOoKev1A+yLJlDFRdp4I=
github.com/goal-web/cache v0.1.2 h1:Qh0etC5odjUhjUFSGnsdqYBoO83idTYhZKTe+z+dMHs=
github.com/goal-web/cache v0.1.2/go.mod h1:tIP+t1RTaBuWIdVhmBivQ4tma9IIJVT5Qi+/rYgTMVI=
github.com/goal-web/collection v0.1.5 h1:tkLBn0n9osENDnvWToaDvb1hbApR5OvHdNu3eLFVglw=
github.com/goal-web/collection v0.1.5/go.mod h1:Syaj+9lKGoSAenQTJErMvAG/iBAZlr+Rn4rENR1S5J4=
github.com/goal-web/config v0.1.3 h1:i31CoKkwtv0i1WWwqtUaD7kfuJWDd0RgRNASadN1Qms=
github.com/goal-web/config v0.1.3/go.mod h1:3rY+j12pspZ8ORNPpU/nWT9bG971XW+ZsN8IcNDUhrc=
github.com/goal-web/console v0.1.5 h1:yd5WpBOokwkeI+aMirDwWiMoEPZlKhdwVMDwAacZmiM=
github.com/goal-web/console v0.1.5/go.mod h1:GApWpbZ1UmMCFSceEMpGkPN5snkmEyRBHHfhzEml7Js=
github.com/goal-web/container v0.1.3/go.mod h1:IpfV+0J1xaKUTl7Pymc02h0wNQtCKWcQqI8ASFd/p/Y=
github.com/goal-web/container v0.1.4/go.mod h1:xbOKGHxV8Pg4IPTVDEEVQ21YZ2Fr2u7sjMUSTVmh05A=
github.com/goal-web/container v0.1.5 h1:tQi2FvmIEPua70TNFMKB3/XKGz6AKLmbq0IwtUK6VoA=
github.com/goal-web/container v0.1.5/go.mod h1:xbOKGHxV8Pg4IPTVDEEVQ21YZ2Fr2u7sjMUSTVmh05A=
github.com/goal-web/contracts v0.1.1/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.7/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.8/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.13/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.19/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.20/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.21/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.23/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.27/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.35/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.36/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.39/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.40/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.42/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.44/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.45/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.46/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.48/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.49/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.50/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.53/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.54/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.57 h1:aPu9CBOuRjaxAEXtXgnzi1aLuuNSWViGSceeKC0Rsu0=
github.com/goal-web/contracts v0.1.57/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.62.1/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.62.7/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.62.8/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.62.13/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.62.19/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.62.21/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.62.23/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.62.27/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.62.35/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.62.36/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.62.39/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.62.40/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.62.42/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.62.44/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.62.45/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.62.46/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.62.48/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.62.49/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.62.50/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.62/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.62.57/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.62.60/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/contracts v0.1.62.61 h1:gKmdeBK+u09/Y9Ul0P2sH5zZ6Rq5cGCjq/s8A7w8R0s=
github.com/goal-web/contracts v0.1.62.61/go.mod h1:lKHynU2Kgk6xyxL4afOJM4TO1kSa3RrCJ2bm5RtFMBw=
github.com/goal-web/database v0.1.8/go.mod h1:ZX2B3WKamsH/oZQvQSjeDGB67cQ2mQuUvj5uOpnQfiY=
github.com/goal-web/database v0.1.12 h1:nxrEYiuD+ql6wWFR3yxgIPfAJXSksPASLxwX+2LGOk4=
github.com/goal-web/database v0.1.12/go.mod h1:ZX2B3WKamsH/oZQvQSjeDGB67cQ2mQuUvj5uOpnQfiY=
Expand All @@ -306,7 +296,6 @@ github.com/goal-web/microdemo v0.0.0-20220219171937-6f3fca7dfbcb/go.mod h1:Z4fN1
github.com/goal-web/pipeline v0.1.5/go.mod h1:W4DFIzdiRvfEPQaK91HtQgp9oD8ywlj5ehDwRXE0e0g=
github.com/goal-web/pipeline v0.1.6 h1:/4hwryM//nJbGLcHvwUFhi4r2prG/+Zw50QulV/7dmA=
github.com/goal-web/pipeline v0.1.6/go.mod h1:heg8/W6brqpaq2StsyyvhfmCt4Iq+SCfKEHdQYdJmv8=
github.com/goal-web/querybuilder v0.1.12/go.mod h1:55Y9TFAlG1uSoO7ox8n4t2jjFaF2Fz8nO9kFtnV6bsQ=
github.com/goal-web/querybuilder v0.1.13/go.mod h1:nqNpXreTOLYvTYsZ2HOAPTlrjL2jZeXDGXq33cykbHE=
github.com/goal-web/querybuilder v0.1.16 h1:NBp2hpJjGqjGMEk9SkEjXinhpSzCwRJrZwJEXnfXj1M=
github.com/goal-web/querybuilder v0.1.16/go.mod h1:9IY+T4UVSpbwuMIMe1OA62s/pvUioOIiy8cKnmRFLNc=
Expand Down
25 changes: 13 additions & 12 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"github.com/goal-web/application"
"github.com/goal-web/application/signal"
"github.com/goal-web/auth"
"github.com/goal-web/bloomfilter"
"github.com/goal-web/cache"
"github.com/goal-web/config"
"github.com/goal-web/contracts"
Expand Down Expand Up @@ -34,30 +35,30 @@ func main() {
})

app.RegisterServices(
config.Service(os.Getenv("env"), path, config2.Configs()),
config.NewService(os.Getenv("env"), path, config2.GetConfigProviders()),
hashing.ServiceProvider{},
encryption.ServiceProvider{},
//filesystem.ServiceProvider{},
//filesystem.serviceProvider{},
&serialization.ServiceProvider{},
events.ServiceProvider{},
redis.ServiceProvider{},
cache.ServiceProvider{},
//&bloomfilter.ServiceProvider{},
auth.ServiceProvider{},
//&ratelimiter.ServiceProvider{},
console.Service(),
cache.NewService(),
bloomfilter.NewService(),
auth.NewService(),
//&ratelimiter.serviceProvider{},
console.NewService(),
database.Service(migrations.Migrations),
//&queue.ServiceProvider{},
//&email.ServiceProvider{},
//&queue.serviceProvider{},
//&email.serviceProvider{},
&http.ServiceProvider{RouteCollectors: []interface{}{
// 路由收集器
routes.Api,
routes.WebSocket,
routes.Sse,
}},
//&session.ServiceProvider{},
//sse.ServiceProvider{},
//websocket.ServiceProvider{},
//&session.serviceProvider{},
//sse.serviceProvider{},
//websocket.serviceProvider{},
providers.App{},
//providers.Gate(),
//providers.Micro(),
Expand Down
4 changes: 2 additions & 2 deletions tests/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func initApp(path ...string) contracts.Application {
Env: env,
Paths: []string{runPath},
Sep: "=",
ConfigProviders: config2.Configs(),
ConfigProviders: config2.GetConfigProviders(),
},
&console.ServiceProvider{
ConsoleProvider: func(application contracts.Application) contracts.Console {
Expand All @@ -61,7 +61,7 @@ func initApp(path ...string) contracts.Application {
auth.ServiceProvider{},
&email.ServiceProvider{},
&database.ServiceProvider{},
//&http.ServiceProvider{RouteCollectors: []interface{}{
//&http.serviceProvider{RouteCollectors: []interface{}{
// // 路由收集器
// routes.V1Routes,
//}},
Expand Down

0 comments on commit c507beb

Please sign in to comment.