Browse Source

En cours de développement

master
losyme 10 months ago
parent
commit
ec27b2f338
  1. 8
      go.mod
  2. 15
      go.sum
  3. 11
      internal/api/api.go
  4. 4
      internal/api/jobs.go

8
go.mod

@ -6,14 +6,14 @@ 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/eckmuhl/context v0.0.0-20211026142645-05b9f636b527
forge.chapril.org/eckmuhl/render v0.0.0-20211026142608-7f6574a2e63f
forge.chapril.org/eckmuhl/router v0.0.0-20211026162052-2c65fc3da9f8
forge.chapril.org/eckmuhl/context v0.0.0-20211026213906-a0839d6012a9
forge.chapril.org/eckmuhl/render v0.0.0-20211026212913-24b58019a3b4
forge.chapril.org/eckmuhl/router v0.0.0-20211026214139-369ea57a8819
forge.chapril.org/losyme/application v0.0.0-20211008200819-b014e639a171
forge.chapril.org/losyme/cmdline v0.0.0-20211010173716-509a4c1f872e
forge.chapril.org/losyme/config v0.0.0-20211025142334-51a8a7a73a4f
forge.chapril.org/losyme/errors v0.0.0-20211003204336-ad5510c24b40
forge.chapril.org/losyme/minikit v0.0.0-20211026162327-78b60b77f768
forge.chapril.org/losyme/minikit v0.0.0-20211026165509-439b096ebe15
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

15
go.sum

@ -5,12 +5,15 @@ forge.chapril.org/dune/memory v0.0.0-20211020130347-474549465ac2/go.mod h1:3/uYW
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/eckmuhl/context v0.0.0-20211010163718-0742c5d7087c/go.mod h1:mLBQDTayRooyfmrjPQWbIFobAIclOW3ERaikGuQLiUA=
forge.chapril.org/eckmuhl/context v0.0.0-20211026142645-05b9f636b527 h1:26OTuChO9SoLtgFc5W6EvcAbg9V9/k12SeBAGdlXZ/8=
forge.chapril.org/eckmuhl/context v0.0.0-20211026142645-05b9f636b527/go.mod h1:eXJ4ESFj4jBKcDf7AjcthZLn+RKtqDLM29euWqao/SY=
forge.chapril.org/eckmuhl/render v0.0.0-20211026142608-7f6574a2e63f h1:E4+XKIE/Hy6akDbG+6oZwx/GX00VIJG0M/0peJRpLRw=
forge.chapril.org/eckmuhl/context v0.0.0-20211026213906-a0839d6012a9 h1:uIbO0DNTTMfs2gkrQepHCokkF1uywhDj2Btswm6mvDI=
forge.chapril.org/eckmuhl/context v0.0.0-20211026213906-a0839d6012a9/go.mod h1:C+BFg7gqtYFkvDWwkCOirG+bLmPMBv2h9Ev7Vpqqi5Q=
forge.chapril.org/eckmuhl/render v0.0.0-20211026142608-7f6574a2e63f/go.mod h1:NfRA+CqB0f4RLDqQ/Q5QozEHSPBqyWUAyGI+7sJRuBw=
forge.chapril.org/eckmuhl/router v0.0.0-20211026162052-2c65fc3da9f8 h1:shzYN/bGpHLAwOYV6paOgfC7hUWnM+yuqZ2Z+8Dmuf0=
forge.chapril.org/eckmuhl/router v0.0.0-20211026162052-2c65fc3da9f8/go.mod h1:xO6y8Gc6IABsLJaZyl9MmmksISqhPTx0JKjZcQCS3wk=
forge.chapril.org/eckmuhl/render v0.0.0-20211026212913-24b58019a3b4 h1:PjkgKjWgARf9HeTn6Enle89DSrXICSBfglCpT2RtTzE=
forge.chapril.org/eckmuhl/render v0.0.0-20211026212913-24b58019a3b4/go.mod h1:NfRA+CqB0f4RLDqQ/Q5QozEHSPBqyWUAyGI+7sJRuBw=
forge.chapril.org/eckmuhl/router v0.0.0-20211026165418-3f11f6828a20/go.mod h1:xO6y8Gc6IABsLJaZyl9MmmksISqhPTx0JKjZcQCS3wk=
forge.chapril.org/eckmuhl/router v0.0.0-20211026214139-369ea57a8819 h1:UnqMU+zrousfzjHpiEyzxOAPgX1jaC0JsP0D8dk3Iog=
forge.chapril.org/eckmuhl/router v0.0.0-20211026214139-369ea57a8819/go.mod h1:hwUhBRA9dfGphnhLqOL5YKoRK240k0vr0Tmc294zn/o=
forge.chapril.org/eckmuhl/server v0.0.0-20211025142833-6bfb82ee5b8e h1:3vqsUmtMp2zb/o4uDZ3yQ47zJgQfkajVwBXsCo1YSUw=
forge.chapril.org/eckmuhl/server v0.0.0-20211025142833-6bfb82ee5b8e/go.mod h1:pCqVQ1FeaeRUymuC/LYA1c+5AY2uqjOZVKZjLysaotk=
forge.chapril.org/losyme/application v0.0.0-20211008200819-b014e639a171 h1:T8MQXGNCs1AsjtIQMYw1gjp0g4H9Frflosm6kkY8e7g=
@ -29,8 +32,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-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-20211026162327-78b60b77f768 h1:WwxrUSYgxR5IUZWd4xJt/wwlCg51wPpNz/29XvS9BKg=
forge.chapril.org/losyme/minikit v0.0.0-20211026162327-78b60b77f768/go.mod h1:io15THAlEjQjdd/T0qUEBCV72eACry+2Xjv4BKXJLs8=
forge.chapril.org/losyme/minikit v0.0.0-20211026165509-439b096ebe15 h1:k7vwu6zrjxvUlKY4Swrkb/JOb1X6qf0B5Q/OR4BtEcw=
forge.chapril.org/losyme/minikit v0.0.0-20211026165509-439b096ebe15/go.mod h1:1LQrGSfGmQijoP00fpinYqEqRNBQsbZuBsAIZM37ai4=
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=

11
internal/api/api.go

@ -10,6 +10,7 @@ import (
"net/http"
"forge.chapril.org/eckmuhl/context"
"forge.chapril.org/eckmuhl/render"
"forge.chapril.org/eckmuhl/router"
"forge.chapril.org/dune/dune/internal/components"
@ -20,19 +21,21 @@ type api struct {
}
func (api *api) status(c *context.Context) error {
return c.JSON(http.StatusOK, nil)
return c.JSON(http.StatusOK, render.MSI{
"request_id": "",
})
}
func Setup(cs *components.Components) {
api := &api{cs}
cs.Router.Group("/api", func(g *router.Group) {
cs.Router.Group("/api", func(g *router.Group) { //api...............................................................
g.Get("/status", api.status)
jobs := &jobs{cs}
g.New("/jobs", func(g *router.Group) {
g.Post("", jobs.create)
g.New("/jobs", func(g2 *router.Group) { //api/jobs..............................................................
g2.Post("", jobs.create)
})
})
}

4
internal/api/jobs.go

@ -20,8 +20,8 @@ type jobs struct {
}
func (j *jobs) create(c *context.Context) error {
return c.JSON(http.StatusOK, render.MSI{
"id": "",
return c.JSON(http.StatusCreated, render.MSI{
"request_id": "",
})
}

Loading…
Cancel
Save