Browse Source

En cours de développement

master
losyme 2 months ago
parent
commit
4166f2492f
  1. 4
      go.mod
  2. 8
      go.sum
  3. 13
      internal/application/application.go
  4. 8
      internal/application/demo.go

4
go.mod

@ -4,14 +4,14 @@ go 1.17
require (
forge.chapril.org/dune/jw v0.0.0-20211114170701-4b66b0d705ea
forge.chapril.org/dune/sdk v0.0.0-20211119180115-f339659ec029
forge.chapril.org/dune/sdk v0.0.0-20211119183323-9610480b33ce
forge.chapril.org/losyme/application v0.0.0-20211029102910-b7db6effc015
forge.chapril.org/losyme/cmdline v0.0.0-20211029192907-e6f74788c44f
forge.chapril.org/losyme/config v0.0.0-20211025142334-51a8a7a73a4f
forge.chapril.org/losyme/errors v0.0.0-20211003204336-ad5510c24b40
forge.chapril.org/losyme/kong v0.0.0-20211102220824-8f8a63ae4cca
forge.chapril.org/losyme/logger v0.0.0-20211114152309-4801f8e79676
forge.chapril.org/losyme/minikit v0.0.0-20211114152424-7642b8c0bb53
forge.chapril.org/losyme/minikit v0.0.0-20211119184831-959c6c6e87ac
forge.chapril.org/losyme/scheduler v0.0.0-20211003204604-f14dada88faf
forge.chapril.org/losyme/uuid v0.0.0-20211007082235-8d502169e034
)

8
go.sum

@ -1,7 +1,7 @@
forge.chapril.org/dune/jw v0.0.0-20211114170701-4b66b0d705ea h1:EC1XXrDQ6E7Oed04iZFKsk2dbxJORBH2G+UxBFz42j4=
forge.chapril.org/dune/jw v0.0.0-20211114170701-4b66b0d705ea/go.mod h1:7CyK2ZvzHntSlOZ7kWcqVhkmUzlE0QI3uKW9kPbNbOY=
forge.chapril.org/dune/sdk v0.0.0-20211119180115-f339659ec029 h1:LPzlsg367WrDwdoJHhUEWlQCraT/Ncx8hj2bQgwUjak=
forge.chapril.org/dune/sdk v0.0.0-20211119180115-f339659ec029/go.mod h1:MoElZHMrmoc+AH8OXwduGLF+1ls73nS/+3JGx7K8ta4=
forge.chapril.org/dune/sdk v0.0.0-20211119183323-9610480b33ce h1:6DxWiyVsggO1G/fXP49DrHJp9yjm114R0Tzu2AIFh8Y=
forge.chapril.org/dune/sdk v0.0.0-20211119183323-9610480b33ce/go.mod h1:MoElZHMrmoc+AH8OXwduGLF+1ls73nS/+3JGx7K8ta4=
forge.chapril.org/losyme/application v0.0.0-20211029102910-b7db6effc015 h1:mZQ2kC2ucXI0lNRVyIOVEz3zu0ChOQ9wTPG0W69fI1Y=
forge.chapril.org/losyme/application v0.0.0-20211029102910-b7db6effc015/go.mod h1:olQo5n5tnBRHq0wcc0lNbymvsXdTuYaCjNfd2d/+01w=
forge.chapril.org/losyme/buffer v0.0.0-20211003203540-771701f5a518 h1:B7wu0DWUwpt0Mw/VTuWQZikhV/VD6kc2iJWbIY+jgEM=
@ -20,8 +20,8 @@ forge.chapril.org/losyme/kvfmt v0.0.0-20211003204256-34ac32764dae h1:RdYWXKy+OQN
forge.chapril.org/losyme/kvfmt v0.0.0-20211003204256-34ac32764dae/go.mod h1:wnVjwnCO2vFLLZ1EgFuFws1n8XLluufsGsdozGYSA7c=
forge.chapril.org/losyme/logger v0.0.0-20211114152309-4801f8e79676 h1:XGc8rZ/hTW9/mUUAJ7nVtmrqnxeKQFKGs3NO+tnIfgY=
forge.chapril.org/losyme/logger v0.0.0-20211114152309-4801f8e79676/go.mod h1:a3fN8yTjq5S/ramr03hIkutKM/35UsijUgRNKHjjlMU=
forge.chapril.org/losyme/minikit v0.0.0-20211114152424-7642b8c0bb53 h1:LxbGJXY/M1ZS6oo2muEZyXMOdMqy4UrVFSGLURvdZTw=
forge.chapril.org/losyme/minikit v0.0.0-20211114152424-7642b8c0bb53/go.mod h1:X8a2/jwJ5wuoPAK776Ci3KZbK3151M4FHvlrXEiFl4k=
forge.chapril.org/losyme/minikit v0.0.0-20211119184831-959c6c6e87ac h1:eh4tlfjQ1zyrur9z2tIKPYTV81ktyXcbrKHIcYmDWEg=
forge.chapril.org/losyme/minikit v0.0.0-20211119184831-959c6c6e87ac/go.mod h1:X8a2/jwJ5wuoPAK776Ci3KZbK3151M4FHvlrXEiFl4k=
forge.chapril.org/losyme/scheduler v0.0.0-20211003204604-f14dada88faf h1:5OIlwVBTdvjCXh2JHAh5rq8FgSe1lXuuKDFtO/ZRaRM=
forge.chapril.org/losyme/scheduler v0.0.0-20211003204604-f14dada88faf/go.mod h1:VNjFKl0Q2vvLDnR9tdNdTIZDLQNlR+gcIGNf2aIYv3o=
forge.chapril.org/losyme/util v0.0.0-20211025142031-fd89d32d86fe h1:xjMUKHxtG8jz57JyOxgNLlRaPLJeQvMV9K3HNlhKDB8=

13
internal/application/application.go

@ -8,6 +8,7 @@ package application
import (
"forge.chapril.org/losyme/application"
"forge.chapril.org/losyme/errors"
"forge.chapril.org/losyme/minikit"
"forge.chapril.org/dune/dune/internal/components"
@ -57,24 +58,26 @@ func (app *Application) Run() error {
return app.minikit.RunServer(
func() error { // build..........................................................................................
if fn := app.cmdLine.runAfter; fn != nil {
return fn()
if err := fn(); err != nil {
return errors.WithMessage(err, "runAfter") /////////////////////////////////////////////////////////
}
}
if err := app.storage(); err != nil {
return err
return errors.WithMessage(err, "storage") //////////////////////////////////////////////////////////////
}
if err := app.model(); err != nil {
return err
return errors.WithMessage(err, "model") ////////////////////////////////////////////////////////////////
}
if err := app.API(); err != nil {
return err
return errors.WithMessage(err, "API") //////////////////////////////////////////////////////////////////
}
if app.cmdLine.demo {
if err := app.setupDemo(); err != nil {
return err
return errors.WithMessage(err, "demo") /////////////////////////////////////////////////////////////
}
}

8
internal/application/demo.go

@ -7,7 +7,7 @@
package application
import (
"forge.chapril.org/dune/sdk/runner"
// "forge.chapril.org/dune/sdk/runner"
"forge.chapril.org/dune/sdk/workers"
"forge.chapril.org/losyme/minikit/pkg/components"
)
@ -31,12 +31,12 @@ type demo struct {
}
func (app *Application) setupDemo() error {
runner := runner.New(app.components.Application.Name(), app.components.Model)
// runner := runner.New(app.components.Application.Name(), app.components.Model)
cfg := &workers.Config{
PoolSize: 2,
Runner: runner,
Logger: newDemoLogger(app.components.Logger),
// Runner: runner,
Logger: newDemoLogger(app.components.Logger),
}
workers, err := workers.New(cfg)

Loading…
Cancel
Save