Browse Source

En cours de développement

master
losyme 9 months ago
parent
commit
00bb7fc09c
  1. 1
      Taskfile.yml
  2. 10
      go.mod
  3. 20
      go.sum
  4. 70
      internal/application/application.go

1
Taskfile.yml

@ -24,7 +24,6 @@ tasks:
- go get -u forge.chapril.org/losyme/logger
- go get -u forge.chapril.org/losyme/minikit
- go get -u forge.chapril.org/losyme/scheduler
- go get -u forge.chapril.org/losyme/util
- go get -u forge.chapril.org/losyme/uuid
- go mod tidy
lint:

10
go.mod

@ -3,16 +3,16 @@ module forge.chapril.org/dune/dune
go 1.17
require (
forge.chapril.org/dune/jw v0.0.0-20211020130157-3c3c3fe4d012
forge.chapril.org/dune/memory v0.0.0-20211020130347-474549465ac2
forge.chapril.org/dune/model v0.0.0-20211020130416-c773f1d2fa0b
forge.chapril.org/dune/jw v0.0.0-20211029164044-350503f0b1a4
forge.chapril.org/dune/memory v0.0.0-20211029164139-d24fd16b46ff
forge.chapril.org/dune/model v0.0.0-20211029164216-a176025f7311
forge.chapril.org/losyme/application v0.0.0-20211029102910-b7db6effc015
forge.chapril.org/losyme/cmdline v0.0.0-20211029130359-b1c68c725e92
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-20211028140748-e4aa975543a6
forge.chapril.org/losyme/logger v0.0.0-20211020125912-674a399f933c
forge.chapril.org/losyme/minikit v0.0.0-20211029130438-3d3b26d82d7d
forge.chapril.org/losyme/logger v0.0.0-20211029145618-53281f68122e
forge.chapril.org/losyme/minikit v0.0.0-20211029165330-669b33c46628
forge.chapril.org/losyme/scheduler v0.0.0-20211003204604-f14dada88faf
forge.chapril.org/losyme/util v0.0.0-20211025142031-fd89d32d86fe
forge.chapril.org/losyme/uuid v0.0.0-20211007082235-8d502169e034

20
go.sum

@ -1,9 +1,9 @@
forge.chapril.org/dune/jw v0.0.0-20211020130157-3c3c3fe4d012 h1:4e/BuwKlQcBJm3k7DdztDaTpJ1N8xntKjMOr79DaC4I=
forge.chapril.org/dune/jw v0.0.0-20211020130157-3c3c3fe4d012/go.mod h1:BNHjflFTnZI23b+5wmY17ruK/Yg13v+A30d/swZeDWk=
forge.chapril.org/dune/memory v0.0.0-20211020130347-474549465ac2 h1:gj9NfEbXMnYYQ9kVzNWgHNI99FVuLFy8oZl4r16JcdE=
forge.chapril.org/dune/memory v0.0.0-20211020130347-474549465ac2/go.mod h1:3/uYWmGaCQHUWsjyXjOYZJB36MPhsWEBjZ/i2Sj/FXs=
forge.chapril.org/dune/model v0.0.0-20211020130416-c773f1d2fa0b h1:Sjgl+8N4nVtOsQLCNpLuJK9XSccNsY54xKNp39cmBiY=
forge.chapril.org/dune/model v0.0.0-20211020130416-c773f1d2fa0b/go.mod h1:NbcPP22feQcoXHLo9EyWsPtwv+zD/lLERCReI4XNecM=
forge.chapril.org/dune/jw v0.0.0-20211029164044-350503f0b1a4 h1:ecOrzWxS3nlsyFZ5FZXbAWXpdpJwuHz+/RVu4d5HOt0=
forge.chapril.org/dune/jw v0.0.0-20211029164044-350503f0b1a4/go.mod h1:5TC6jMyQEwDLdNl3AIyhaETgyV7I4cYDbodGKBBjC2k=
forge.chapril.org/dune/memory v0.0.0-20211029164139-d24fd16b46ff h1:YLcSA1aXVsEzXmsXzKGmOczcBDHs7pm13brNLFfszxw=
forge.chapril.org/dune/memory v0.0.0-20211029164139-d24fd16b46ff/go.mod h1:Rx/ESRHZdnGlZCsTvz/MW+FMbAOBFFiw0U+c+JaVVic=
forge.chapril.org/dune/model v0.0.0-20211029164216-a176025f7311 h1:AhLALJeqNaA45HaCI+jg28H4judsW3W5u9xesKaMaPQ=
forge.chapril.org/dune/model v0.0.0-20211029164216-a176025f7311/go.mod h1:NlUU33e9ugdMxvRY4f1kcCu/f1F6HbpyVEFDMlSHcgQ=
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,10 +20,10 @@ forge.chapril.org/losyme/kong v0.0.0-20211028140748-e4aa975543a6 h1:gOr0gpuR0BLt
forge.chapril.org/losyme/kong v0.0.0-20211028140748-e4aa975543a6/go.mod h1:sOhHc+IcV5vGNnygTML5/P7Ftmlsf9UB2oL+HQRpsYw=
forge.chapril.org/losyme/kvfmt v0.0.0-20211003204256-34ac32764dae h1:RdYWXKy+OQNJueb4Qqqo7sL4OY3/TpfUvmoIoH8ua9E=
forge.chapril.org/losyme/kvfmt v0.0.0-20211003204256-34ac32764dae/go.mod h1:wnVjwnCO2vFLLZ1EgFuFws1n8XLluufsGsdozGYSA7c=
forge.chapril.org/losyme/logger v0.0.0-20211020125912-674a399f933c h1:AsWWDqFMigGp33sHDqGdJVVACiPYcY1ChSmBN7olBrk=
forge.chapril.org/losyme/logger v0.0.0-20211020125912-674a399f933c/go.mod h1:a3fN8yTjq5S/ramr03hIkutKM/35UsijUgRNKHjjlMU=
forge.chapril.org/losyme/minikit v0.0.0-20211029130438-3d3b26d82d7d h1:Zk1jq3UGIMNc/AvXTdDFs3nmge8Q0vtQjgyqCbW+NsM=
forge.chapril.org/losyme/minikit v0.0.0-20211029130438-3d3b26d82d7d/go.mod h1:HDuZ30h0eBH9fLgK395zPLvtqJ8sumsnKtt0YjK5QYg=
forge.chapril.org/losyme/logger v0.0.0-20211029145618-53281f68122e h1:646YpIqqMaIMvmURBgxKx6vM2KI2GUZ/tk0HQT1AehI=
forge.chapril.org/losyme/logger v0.0.0-20211029145618-53281f68122e/go.mod h1:a3fN8yTjq5S/ramr03hIkutKM/35UsijUgRNKHjjlMU=
forge.chapril.org/losyme/minikit v0.0.0-20211029165330-669b33c46628 h1:VHHaTogScX8bRi9pAvclMTu7Gmniev5m+FyP9Jq7jD8=
forge.chapril.org/losyme/minikit v0.0.0-20211029165330-669b33c46628/go.mod h1:ZfaneFtHmdtMHzkVKGe1E48wpxYXMf0fgxJdYq3I+nk=
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=

70
internal/application/application.go

@ -9,7 +9,6 @@ package application
import (
"forge.chapril.org/losyme/application"
"forge.chapril.org/losyme/minikit"
"forge.chapril.org/losyme/util"
"forge.chapril.org/dune/dune/internal/api"
"forge.chapril.org/dune/dune/internal/components"
@ -54,58 +53,33 @@ func New(name, version, builtAt string, args []string) *Application {
return app
}
func (app *Application) run() error {
if err := app.minikit.Build(); err != nil {
return err
}
if run := app.cmdLine.runAfter; run != nil {
return run()
}
if err := app.storage(); err != nil {
return err
}
if err := app.model(); err != nil {
return err
}
if err := api.Setup(app.components); err != nil {
return err
}
app.components.Scheduler.Start()
group, endCh := util.WaitAppEnd(func() {
<-app.components.Scheduler.Stop().Done()
ctx, cancel := util.CtxWithTimeout(10)
defer cancel()
_ = app.components.Server.Shutdown(ctx) //AFINIR
})
func (app *Application) Run() error {
return app.minikit.RunServer(
func() error { //build..........................................................................................
if run := app.cmdLine.runAfter; run != nil {
return run()
}
err := app.components.Server.ListenAndServe()
if err := app.storage(); err != nil {
return err
}
close(endCh)
group.Wait()
if err := app.model(); err != nil {
return err
}
return err
}
if err := api.Setup(app.components); err != nil {
return err
}
func (app *Application) Run() error {
err := app.run()
app.components.Scheduler.Start()
if logger := app.components.Logger; logger != nil {
if err != nil {
logger.Fatal(err.Error()) //////////////////////////////////////////////////////////////////////////////////
}
logger.Close()
}
return app.components.Application.OnError(err) //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
return nil
},
func() { //atEnd................................................................................................
<-app.components.Scheduler.Stop().Done()
},
)
}
/*

Loading…
Cancel
Save