Browse Source

En cours de développement

master
mls-361 3 months ago
parent
commit
ac072b04b8
  1. 12
      go.mod
  2. 28
      go.sum
  3. 8
      internal/api/api.go

12
go.mod

@ -3,15 +3,15 @@ module forge.chapril.org/armen/armen
go 1.16
require (
forge.chapril.org/armen/jw v0.0.0-20210505210255-89e8c7b87962
forge.chapril.org/armen/memory v0.0.0-20210505210329-90370ab4e43b
forge.chapril.org/armen/model v0.0.0-20210505210440-63fccc4a7970
forge.chapril.org/armen/runner v0.0.0-20210505210541-946f84d83fe7
forge.chapril.org/armen/workers v0.0.0-20210505210630-7d277d71365a
forge.chapril.org/armen/jw v0.0.0-20210506161145-8f6819ff38d9
forge.chapril.org/armen/memory v0.0.0-20210506161253-5c487968385f
forge.chapril.org/armen/model v0.0.0-20210506162438-98372fbf0fe6
forge.chapril.org/armen/runner v0.0.0-20210506162524-217f63ff5e06
forge.chapril.org/armen/workers v0.0.0-20210506162555-34217f894f3d
forge.chapril.org/mls-361/application v0.0.0-20210505210056-fb6d8a49172f
forge.chapril.org/mls-361/crypto v0.0.0-20210505210121-8b90bff2c6d0
forge.chapril.org/mls-361/errors v0.0.0-20210505205959-6bf0da3026e8
forge.chapril.org/mls-361/jsonapi v0.0.0-20210505210236-164f544297fe
forge.chapril.org/mls-361/jsonapi v0.0.0-20210506164608-b4dc891f8da5
forge.chapril.org/mls-361/logger v0.0.0-20210505210208-50f76d793833
forge.chapril.org/mls-361/uuid v0.0.0-20210411123640-49d47af267ff
github.com/julienschmidt/httprouter v1.3.0

28
go.sum

@ -1,15 +1,15 @@
forge.chapril.org/armen/factory v0.0.0-20210505210410-24f1e3c19dcc h1:xQbQ5iW+2llWa1NYCW5lH/qATpLcPAL3HAp75VzHYSU=
forge.chapril.org/armen/factory v0.0.0-20210505210410-24f1e3c19dcc/go.mod h1:9XmFPZ5zO9vrPSQHRu69XJAAJgaNczy1qTmOwOzE2sQ=
forge.chapril.org/armen/jw v0.0.0-20210505210255-89e8c7b87962 h1:FoTwzGPFV/7dl9c8qvEQHZHZziCH5GIrngrF1I/aqGg=
forge.chapril.org/armen/jw v0.0.0-20210505210255-89e8c7b87962/go.mod h1:RYOpGtRpJlIv0VWxYcRQIeTQ8Ec6b3KUFq9bhYoIcBY=
forge.chapril.org/armen/memory v0.0.0-20210505210329-90370ab4e43b h1:n58sX4qKl2CeyX9iiFkV0/mXbl1vccMl8zW5K4Uyh/M=
forge.chapril.org/armen/memory v0.0.0-20210505210329-90370ab4e43b/go.mod h1:Weyg11jWH3VhSeseZ8K/FC4o2EdfXw7jYiT7F66vUBE=
forge.chapril.org/armen/model v0.0.0-20210505210440-63fccc4a7970 h1:gajXz3KQovSeLjLdQYoylTV94nz+ZKBHHcFstQU7Szo=
forge.chapril.org/armen/model v0.0.0-20210505210440-63fccc4a7970/go.mod h1:Nti1WVIQ1Y3sdMeBtDT/D+986uUThafubKWhO3Nr+3U=
forge.chapril.org/armen/runner v0.0.0-20210505210541-946f84d83fe7 h1:tszgazWXnYYjznGx22UKz2yhablZpjkWpiu1FmoroII=
forge.chapril.org/armen/runner v0.0.0-20210505210541-946f84d83fe7/go.mod h1:m9VxBIMAzEa3t67rjk7IZBWL+ReOZQNmfCS3EXQWopU=
forge.chapril.org/armen/workers v0.0.0-20210505210630-7d277d71365a h1:9uXVnLAp1D3v3moQqraT5O8Fl5yDVXOibtMgOrKe3pU=
forge.chapril.org/armen/workers v0.0.0-20210505210630-7d277d71365a/go.mod h1:kVujxf0HclbbvqQPBQ8RMEsomsBncxG3Vg62mIWYlnI=
forge.chapril.org/armen/factory v0.0.0-20210506161649-74bac90e9000 h1:mIb9oxBspXq0b+Ru70gY2xAOkayhxlai1bm0So/3L8k=
forge.chapril.org/armen/factory v0.0.0-20210506161649-74bac90e9000/go.mod h1:MzYIhut8ynRufOSW1bLezS+nL/B7BVhl4HhztNaEp14=
forge.chapril.org/armen/jw v0.0.0-20210506161145-8f6819ff38d9 h1:fumImlGtrLWV0GjrPmODacBk634oJCjuJdsVp/ogqJg=
forge.chapril.org/armen/jw v0.0.0-20210506161145-8f6819ff38d9/go.mod h1:RYOpGtRpJlIv0VWxYcRQIeTQ8Ec6b3KUFq9bhYoIcBY=
forge.chapril.org/armen/memory v0.0.0-20210506161253-5c487968385f h1:6f4Bae56k1hbDfcY8ySw9dNRmNGut/m3qSoLSRaXO+A=
forge.chapril.org/armen/memory v0.0.0-20210506161253-5c487968385f/go.mod h1:OkZiy/KPR184h4W5aOqXcpLwJBXVJNQiDo/BG0ila0Y=
forge.chapril.org/armen/model v0.0.0-20210506162438-98372fbf0fe6 h1:N7u30DWnlWbo0r96yfodnXW1rMpie630OOlFcXukeZg=
forge.chapril.org/armen/model v0.0.0-20210506162438-98372fbf0fe6/go.mod h1:Bxm1m663HTTVn3L1scSp2nmvnL0zIA7v8EPDwdl3e/k=
forge.chapril.org/armen/runner v0.0.0-20210506162524-217f63ff5e06 h1:tmjWz/IoTPTlU7T6h6WayVHpAGgfSMne86v3xCbrKVE=
forge.chapril.org/armen/runner v0.0.0-20210506162524-217f63ff5e06/go.mod h1:HbKW91zOGUMHpUCHFoYHftP10oJSwgVaxqErkBiZbNg=
forge.chapril.org/armen/workers v0.0.0-20210506162555-34217f894f3d h1:rZNfTaQA2tR8OEMYR2RVaDK+W/SkUzcciijbwFmzUPU=
forge.chapril.org/armen/workers v0.0.0-20210506162555-34217f894f3d/go.mod h1:XK64WFxB3/VMtH4gri02kA1Cqh49TilE2PiC5j2QR5w=
forge.chapril.org/mls-361/application v0.0.0-20210505210056-fb6d8a49172f h1:qRaX7CVi7gVypxwGdULsu+3PaAi51C6mNQBvIAITYfI=
forge.chapril.org/mls-361/application v0.0.0-20210505210056-fb6d8a49172f/go.mod h1:Be1Go6JIhn7bVHMIueZYvv3r8Gt99PJZbf4EonLuYDA=
forge.chapril.org/mls-361/buffer v0.0.0-20210410182428-5dc7a7b2ae79 h1:Lh+y98uVFC7btl5FdxKNtokzHD2j14R4ZIgJECao6r4=
@ -20,8 +20,8 @@ forge.chapril.org/mls-361/errors v0.0.0-20210505205959-6bf0da3026e8 h1:AUS2mIV1t
forge.chapril.org/mls-361/errors v0.0.0-20210505205959-6bf0da3026e8/go.mod h1:lp680bNqiwsJyXCCeOoW2jyoq/x7jv4HAgurHqNiVhw=
forge.chapril.org/mls-361/fqdn v0.0.0-20210505210026-544124883654 h1:VZpYvM5/PdtNQgmguSxtoD9sMlRI+/ndvyPNCSScTsA=
forge.chapril.org/mls-361/fqdn v0.0.0-20210505210026-544124883654/go.mod h1:WwEQJZi7shs5QbHJU/qcOWtv8xmkuEoIgX5nKypwXSg=
forge.chapril.org/mls-361/jsonapi v0.0.0-20210505210236-164f544297fe h1:UD90+QY3yc4nLh2UsN/pVSVypzpLZNUUkHN21EfaCHg=
forge.chapril.org/mls-361/jsonapi v0.0.0-20210505210236-164f544297fe/go.mod h1:Gehbj8OeDiaN+zoNoWyfLneb8zxKhBH6dAz41q43Qaw=
forge.chapril.org/mls-361/jsonapi v0.0.0-20210506164608-b4dc891f8da5 h1:twdFRv8G7lxT4WCqprfHtnDGpBuccIi5jKikQbjQEzY=
forge.chapril.org/mls-361/jsonapi v0.0.0-20210506164608-b4dc891f8da5/go.mod h1:Gehbj8OeDiaN+zoNoWyfLneb8zxKhBH6dAz41q43Qaw=
forge.chapril.org/mls-361/kvfmt v0.0.0-20210505202529-c3d4b541e862 h1:QnY1J/F2CZpk0sOzjxx0ZA1dXoFyTpW4fNuiGQoyZ5s=
forge.chapril.org/mls-361/kvfmt v0.0.0-20210505202529-c3d4b541e862/go.mod h1:bv44R0CAd8lQV4ub1hjLE3kWYwpfsW4Ro9zRnD4YOMU=
forge.chapril.org/mls-361/logger v0.0.0-20210505210208-50f76d793833 h1:DQot7mdUNb43d7yXxEUp8R+rDXLPFb3Wf1O00L7Er3s=

8
internal/api/api.go

@ -41,7 +41,7 @@ func (api *api) createJob(rw http.ResponseWriter, r *http.Request) {
return
}
done, err := api.model.CreateJob(job)
job, err := api.model.CreateJob(job)
if err != nil {
if errors.Is(err, model.ErrValidation) {
jsonapi.BadRequest(rw, err)
@ -52,12 +52,12 @@ func (api *api) createJob(rw http.ResponseWriter, r *http.Request) {
return
}
if done {
jsonapi.Render(rw, r, job, api.logger)
if job == nil {
rw.WriteHeader(http.StatusOK)
return
}
rw.WriteHeader(http.StatusOK)
jsonapi.Render(rw, r, http.StatusCreated, job, api.logger)
}
func Build(ccs *components.Components) {

Loading…
Cancel
Save