Browse Source

En cours de développement

master
losyme 2 months ago
parent
commit
f986bb13f1
  1. 2
      go.mod
  2. 4
      go.sum
  3. 6
      internal/api/api.go
  4. 4
      internal/storage/memory/memory.go

2
go.mod

@ -3,7 +3,7 @@ module forge.chapril.org/dune/dune
go 1.17
require (
forge.chapril.org/dune/jw v0.0.0-20211107164502-530cf6d1f075
forge.chapril.org/dune/jw v0.0.0-20211111164336-4c6d344b02c3
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

4
go.sum

@ -1,5 +1,5 @@
forge.chapril.org/dune/jw v0.0.0-20211107164502-530cf6d1f075 h1:H36G3/qCMW+S8MYfOoywy6g4v3xoiWa6EEQBElMIH0s=
forge.chapril.org/dune/jw v0.0.0-20211107164502-530cf6d1f075/go.mod h1:7CyK2ZvzHntSlOZ7kWcqVhkmUzlE0QI3uKW9kPbNbOY=
forge.chapril.org/dune/jw v0.0.0-20211111164336-4c6d344b02c3 h1:dEg6UxI+lvWj9Vc6bVGtmosMCrqzx/rPaOUpjF9xAfw=
forge.chapril.org/dune/jw v0.0.0-20211111164336-4c6d344b02c3/go.mod h1:7CyK2ZvzHntSlOZ7kWcqVhkmUzlE0QI3uKW9kPbNbOY=
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=

6
internal/api/api.go

@ -44,7 +44,7 @@ func (api *API) setup() {
api.Router.Group("/api", func(g *router.Group) { // api.............................................................
g.Get("/status", api.status)
g.Get("/stats", api.stats)
g.Get("/dashboard", api.dashboard)
g.New("/jobs", func(g2 *router.Group) { // api/jobs..............................................................
g2.Post("", api.createJob)
@ -56,8 +56,8 @@ func (api *API) status(c *context.Context) error {
return c.JSON(http.StatusNoContent, nil)
}
func (api *API) stats(c *context.Context) error {
stats, err := api.Model.Storage.Stats()
func (api *API) dashboard(c *context.Context) error {
stats, err := api.Model.Storage.Dashboard()
if err != nil {
return err
}

4
internal/storage/memory/memory.go

@ -25,8 +25,8 @@ func New() jw.Storage {
}
}
func (m *memory) Stats() (*jw.Stats, error) {
stats := new(jw.Stats)
func (m *memory) Dashboard() (*jw.Dashboard, error) {
stats := new(jw.Dashboard)
m.sm.Lock()
defer m.sm.Unlock()

Loading…
Cancel
Save