Browse Source

En cours de développement

master
losyme 5 months ago
parent
commit
5bda4630ba
  1. 12
      go.mod
  2. 24
      go.sum
  3. 27
      internal/application/application.go
  4. 4
      internal/storage/memory/memory.go

12
go.mod

@ -3,17 +3,17 @@ module forge.chapril.org/dune/dune
go 1.17
require (
forge.chapril.org/dune/jw v0.0.0-20211126094337-5011155e7d32
forge.chapril.org/dune/sdk v0.0.0-20211126094413-f2c8d7cae712
forge.chapril.org/dune/jw v0.0.0-20211205143034-b316149dd167
forge.chapril.org/dune/sdk v0.0.0-20211205143121-15eea5fca05a
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-20211203204434-cf0d27ba59a2
forge.chapril.org/losyme/config v0.0.0-20211205154014-06de4cde67a6
forge.chapril.org/losyme/errors v0.0.0-20211003204336-ad5510c24b40
forge.chapril.org/losyme/kong v0.0.0-20211124133008-c867a5726aae
forge.chapril.org/losyme/kong v0.0.0-20211205154055-bf4a6a1aa2f7
forge.chapril.org/losyme/logger v0.0.0-20211119225711-ee831caaf5d4
forge.chapril.org/losyme/minikit v0.0.0-20211205140141-c0fa98f5316b
forge.chapril.org/losyme/minikit v0.0.0-20211205155148-984950a34eda
forge.chapril.org/losyme/scheduler v0.0.0-20211003204604-f14dada88faf
forge.chapril.org/losyme/util v0.0.0-20211124132718-3fccea15a31b
forge.chapril.org/losyme/util v0.0.0-20211205153848-3e13eadb49eb
forge.chapril.org/losyme/uuid v0.0.0-20211007082235-8d502169e034
github.com/Showmax/go-fqdn v1.0.0
)

24
go.sum

@ -1,31 +1,31 @@
forge.chapril.org/dune/jw v0.0.0-20211126094337-5011155e7d32 h1:g2IrK2c0Nkz+AJbabpkDImtDxLddi97xpWDzAgQehCA=
forge.chapril.org/dune/jw v0.0.0-20211126094337-5011155e7d32/go.mod h1:LEDlIDkGkdvYAzSdZeucZDkbhkf0K5WUV7rTK8ILsc4=
forge.chapril.org/dune/sdk v0.0.0-20211126094413-f2c8d7cae712 h1:LplFsnhc/1Ap/oUISdYTgZFA4oTxvgf/i0glAdccH+Q=
forge.chapril.org/dune/sdk v0.0.0-20211126094413-f2c8d7cae712/go.mod h1:lI5NTCj9urBLdGAQaCUmWh7TV+wU4uIs1Z3NDi+irF8=
forge.chapril.org/dune/jw v0.0.0-20211205143034-b316149dd167 h1:IslU++qhiIM+BxkfeduMfjEu6TgwaRrqSYlNcucLzKE=
forge.chapril.org/dune/jw v0.0.0-20211205143034-b316149dd167/go.mod h1:LEDlIDkGkdvYAzSdZeucZDkbhkf0K5WUV7rTK8ILsc4=
forge.chapril.org/dune/sdk v0.0.0-20211205143121-15eea5fca05a h1:6XhCEdtK6KvV5Hi6qctl6By6JhRkGzbosdNNDqPQEGU=
forge.chapril.org/dune/sdk v0.0.0-20211205143121-15eea5fca05a/go.mod h1:pAC2czwWpGqhB+Y+/RW67Ea3eP/yjr9+k+U1oho7YYE=
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=
forge.chapril.org/losyme/buffer v0.0.0-20211003203540-771701f5a518/go.mod h1:4Yl585hmF3bWZfuwGF2Ym8ErykJZiF9yawlmK7szIkc=
forge.chapril.org/losyme/cmdline v0.0.0-20211029192907-e6f74788c44f h1:7m6EpAj3iSvPiRd0mbrxwJ6TI0vMRRrp7M8PFq7AIXI=
forge.chapril.org/losyme/cmdline v0.0.0-20211029192907-e6f74788c44f/go.mod h1:NvAXbqc+LzdATB2GY72fvK4q2EtxxanmrNs03H7+Do4=
forge.chapril.org/losyme/config v0.0.0-20211203204434-cf0d27ba59a2 h1:DBH8UyYF402FZJIMkbWhdLwco4UnHOMoNaQEHArHf8A=
forge.chapril.org/losyme/config v0.0.0-20211203204434-cf0d27ba59a2/go.mod h1:rOIDZdgb02Cfc1zAkmUJykPCBrc9w9R8duXIgf2lIYo=
forge.chapril.org/losyme/config v0.0.0-20211205154014-06de4cde67a6 h1:ryXwFzFY7WjRZPEhrrn/Bcn6LVhdNmrXpb26SAiiwGQ=
forge.chapril.org/losyme/config v0.0.0-20211205154014-06de4cde67a6/go.mod h1:DGn0ueEigyU4tI9unlnjDheP2JnzvziOB89ILU/hHKk=
forge.chapril.org/losyme/crypto v0.0.0-20211003213528-e97d4ebea720 h1:tMwzjPmGvBb5/5Cx0OIPKqT9zMMR6gQn6398rwT0ghc=
forge.chapril.org/losyme/crypto v0.0.0-20211003213528-e97d4ebea720/go.mod h1:zSawWghP8cyqaQNOtKBAWGfAeR93uAyHMqpaXtZJsF8=
forge.chapril.org/losyme/errors v0.0.0-20211003204336-ad5510c24b40 h1:EoVVFHoIsWRlecHmXP4kx3ALchz5DAfNwso3gcl/Jbk=
forge.chapril.org/losyme/errors v0.0.0-20211003204336-ad5510c24b40/go.mod h1:saYfIRBW9zjiCik+/+5ZaajMEnTPBNI00lF9EnO+2kM=
forge.chapril.org/losyme/kong v0.0.0-20211124133008-c867a5726aae h1:a5ws5r6iLJV6SwiB6ru4ZBJH6ZFeldp7pdABLUq1/io=
forge.chapril.org/losyme/kong v0.0.0-20211124133008-c867a5726aae/go.mod h1:zm87kUwqY6/O20Wzl0j2WE/3ZXSHrifghlA1wDjeYow=
forge.chapril.org/losyme/kong v0.0.0-20211205154055-bf4a6a1aa2f7 h1:DNo+MNkV1HnDp/sBbCpwFHVc3Fnhv8kFplLo+FWnW54=
forge.chapril.org/losyme/kong v0.0.0-20211205154055-bf4a6a1aa2f7/go.mod h1:U3yf9xOhi1keNKqO5Xr5eo2rdwK6FAsbJJqTUCmpib4=
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-20211119225711-ee831caaf5d4 h1:+5xllpRoYR2wNkBd5FSACEcf7ZSDk6Nm4Y/qFSCvISE=
forge.chapril.org/losyme/logger v0.0.0-20211119225711-ee831caaf5d4/go.mod h1:a3fN8yTjq5S/ramr03hIkutKM/35UsijUgRNKHjjlMU=
forge.chapril.org/losyme/minikit v0.0.0-20211205140141-c0fa98f5316b h1:UEKSITcC53LtWxi8r6duOdyKJCdSsK08NGOp2wtUaDE=
forge.chapril.org/losyme/minikit v0.0.0-20211205140141-c0fa98f5316b/go.mod h1:7aR/0oHoSGuK+N8H0wXc1d+c9Ryi/BN69VhVrasK0/I=
forge.chapril.org/losyme/minikit v0.0.0-20211205155148-984950a34eda h1:sHILEVTuzTcQ6RvXeGkcVL39xVqhT0RzxIXj7T4Dp0g=
forge.chapril.org/losyme/minikit v0.0.0-20211205155148-984950a34eda/go.mod h1:ikaGjjiILzv3Btu9gGkv4Wh3F2suGTTt0I0uemVNGjM=
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-20211124132718-3fccea15a31b h1:5+j6/qkKuv383vxmROry6BgTbU5Fg3VbLaGaiaYew58=
forge.chapril.org/losyme/util v0.0.0-20211124132718-3fccea15a31b/go.mod h1:lKYvkuBOTU3E2HuQZDh4ZSA4u3VcFopQbdPUKaHGHEk=
forge.chapril.org/losyme/util v0.0.0-20211205153848-3e13eadb49eb h1:zJ8AFh3nkvoLfwqXrRbSgJTqMhYTxdETrzkUFXGLoOM=
forge.chapril.org/losyme/util v0.0.0-20211205153848-3e13eadb49eb/go.mod h1:lKYvkuBOTU3E2HuQZDh4ZSA4u3VcFopQbdPUKaHGHEk=
forge.chapril.org/losyme/uuid v0.0.0-20211007082235-8d502169e034 h1:4NMOPXxwRiXS7wltj2ZZmMO1nFRMPmG1dXK4Ta4MtiM=
forge.chapril.org/losyme/uuid v0.0.0-20211007082235-8d502169e034/go.mod h1:AgvbvGzTkQkbiM+s9eVhvLUSHbA0V6N+q5oBFI2v0LA=
github.com/Showmax/go-fqdn v1.0.0 h1:0rG5IbmVliNT5O19Mfuvna9LL7zlHyRfsSvBPZmF9tM=

27
internal/application/application.go

@ -7,6 +7,8 @@
package application
import (
"time"
"forge.chapril.org/losyme/application"
"forge.chapril.org/losyme/errors"
"forge.chapril.org/losyme/minikit"
@ -14,6 +16,8 @@ import (
"forge.chapril.org/dune/dune/internal/components"
)
const _serverShutdownTimeout = 10 * time.Second
type Application struct {
minikit *minikit.Kit
components *components.Components
@ -54,8 +58,8 @@ func New(name, version, builtAt string, args []string) *Application {
}
func (app *Application) Run() error {
return app.minikit.RunServer(
func() error { // build..........................................................................................
return app.minikit.Run(
func() error {
if fn := app.cmdLine.runAfter; fn != nil {
if err := fn(); err != nil {
return errors.WithMessage(err, "runAfter") /////////////////////////////////////////////////////////
@ -86,18 +90,19 @@ func (app *Application) Run() error {
app.components.Scheduler.Start()
return nil
},
func() { // atEndiBefore........................................................................................
cs := app.components
return app.minikit.RunServer(
func() { // beforeShutdown..............................................................................
cs := app.components
<-cs.Scheduler.Stop().Done()
<-cs.Scheduler.Stop().Done()
if app.cmdLine.demo {
cs.Demo.Stop()
}
if app.cmdLine.demo {
cs.Demo.Stop()
}
},
_serverShutdownTimeout,
)
},
nil, // atEndAfter..............................................................................................
)
}

4
internal/storage/memory/memory.go

@ -64,6 +64,10 @@ func (m *memory) Dashboard() (*jw.Dashboard, error) {
return stats, nil
}
func (m *memory) Close() error {
return nil
}
/*
######################################################################################################## @(°_°)@ #######
*/

Loading…
Cancel
Save