Browse Source

En cours de développement

master
mls-361 8 months ago
parent
commit
8818f96d7a
  1. 2
      Taskfile.yml
  2. 14
      cmd/main.go
  3. 16
      go.mod
  4. 40
      go.sum
  5. 4
      internal/cmdline/cmdline.go
  6. 4
      internal/config/config.go
  7. 4
      internal/storage/storage.go

2
Taskfile.yml

@ -17,7 +17,7 @@ tasks:
- go get -u forge.chapril.org/armen/model
- go get -u forge.chapril.org/mls-361/application
- go get -u forge.chapril.org/mls-361/crypto
- go get -u forge.chapril.org/mls-361/failure
- go get -u forge.chapril.org/mls-361/errors
- go get -u forge.chapril.org/mls-361/jsonapi
- go get -u forge.chapril.org/mls-361/logger
- go get -u forge.chapril.org/mls-361/uuid

14
cmd/main.go

@ -14,7 +14,7 @@ import (
"time"
"forge.chapril.org/mls-361/application"
"forge.chapril.org/mls-361/failure"
"forge.chapril.org/mls-361/errors"
"forge.chapril.org/armen/armen/internal/api"
"forge.chapril.org/armen/armen/internal/cmdline"
@ -36,34 +36,34 @@ var (
func createComponents(app components.Application) (components.Logger, components.Server, error) {
config, err := config.Load(app)
if err != nil {
return nil, nil, failure.Wrap(err, "config") ///////////////////////////////////////////////////////////////////
return nil, nil, errors.Wrap(err, "config") ////////////////////////////////////////////////////////////////////
}
logger, err := logger.Build(app, config)
if err != nil {
return nil, nil, failure.Wrap(err, "logger") ///////////////////////////////////////////////////////////////////
return nil, nil, errors.Wrap(err, "logger") ////////////////////////////////////////////////////////////////////
}
crypto, err := crypto.Build(app)
if err != nil {
return nil, nil, failure.Wrap(err, "crypto") ///////////////////////////////////////////////////////////////////
return nil, nil, errors.Wrap(err, "crypto") ////////////////////////////////////////////////////////////////////
}
storage, err := storage.Build(app, config, logger, crypto)
if err != nil {
return nil, nil, failure.Wrap(err, "storage") //////////////////////////////////////////////////////////////////
return nil, nil, errors.Wrap(err, "storage") ///////////////////////////////////////////////////////////////////
}
model, err := model.Build(logger, storage)
if err != nil {
return nil, nil, failure.Wrap(err, "model") ////////////////////////////////////////////////////////////////////
return nil, nil, errors.Wrap(err, "model") /////////////////////////////////////////////////////////////////////
}
router := router.Build(logger)
server, err := server.Build(config, logger, router)
if err != nil {
return nil, nil, failure.Wrap(err, "server") ///////////////////////////////////////////////////////////////////
return nil, nil, errors.Wrap(err, "server") ////////////////////////////////////////////////////////////////////
}
api.Build(logger, router, model)

16
go.mod

@ -3,14 +3,14 @@ module forge.chapril.org/armen/armen
go 1.15
require (
forge.chapril.org/armen/jw v0.0.0-20210418170546-b15c98296cee
forge.chapril.org/armen/memory v0.0.0-20210412203213-31c00364097c
forge.chapril.org/armen/model v0.0.0-20210418170632-dd11d78d5aee
forge.chapril.org/mls-361/application v0.0.0-20210418170244-447662583133
forge.chapril.org/mls-361/crypto v0.0.0-20210418170259-779e1f6e73c9
forge.chapril.org/mls-361/failure v0.0.0-20210418162001-830a0944aa37
forge.chapril.org/mls-361/jsonapi v0.0.0-20210418170528-5106ffb37c0d
forge.chapril.org/mls-361/logger v0.0.0-20210418170327-6857e8c31608
forge.chapril.org/armen/jw v0.0.0-20210419152101-8df8e7745249
forge.chapril.org/armen/memory v0.0.0-20210419152138-2768ef42e06f
forge.chapril.org/armen/model v0.0.0-20210419152944-a253d0a648a0
forge.chapril.org/mls-361/application v0.0.0-20210419150458-e34518fabf18
forge.chapril.org/mls-361/crypto v0.0.0-20210419150713-2fc6d04c4850
forge.chapril.org/mls-361/errors v0.0.0-20210419145112-c1508d3017f8
forge.chapril.org/mls-361/jsonapi v0.0.0-20210419151416-6c8e8e391566
forge.chapril.org/mls-361/logger v0.0.0-20210419151129-c85106763b03
forge.chapril.org/mls-361/uuid v0.0.0-20210411123640-49d47af267ff
github.com/julienschmidt/httprouter v1.3.0
)

40
go.sum

@ -1,29 +1,26 @@
cloud.google.com/go v0.16.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
forge.chapril.org/armen/jw v0.0.0-20210412203118-f24a805abde4/go.mod h1:Yucy16A+11RDmTxRNi29F4eWGUjJwQ+tP8WxbP1xIMU=
forge.chapril.org/armen/jw v0.0.0-20210418170546-b15c98296cee h1:53Mwlt6M2bdjGnYvtfJBesTzNg8lB9iKHp8CZHaX/IM=
forge.chapril.org/armen/jw v0.0.0-20210418170546-b15c98296cee/go.mod h1:8rBUHomSg85wFn80HwvuzBhoyuN0hzqrSILxzmxsGHo=
forge.chapril.org/armen/memory v0.0.0-20210412203213-31c00364097c h1:djOYl2gDX9QIK1PijTPRXZDQA3SXfkS7vsSr/C0lWCM=
forge.chapril.org/armen/memory v0.0.0-20210412203213-31c00364097c/go.mod h1:/vKiV89+6GypVQ5HtbEzqEFhSpkWSIy8Y4QjM+UE3dY=
forge.chapril.org/armen/model v0.0.0-20210418170632-dd11d78d5aee h1:kVH3vHNBqpftZnUgwl2PwaSYA6mzAYnrlJ9oslpuEX4=
forge.chapril.org/armen/model v0.0.0-20210418170632-dd11d78d5aee/go.mod h1:77LSuNECLqoWLGAuCu9g0W3106tQhl7jNCdh841Yw3I=
forge.chapril.org/mls-361/application v0.0.0-20210418170244-447662583133 h1:gdeHIIiGbiuPRqJYAxm+d+451LLXGHScMcYbmC1dACU=
forge.chapril.org/mls-361/application v0.0.0-20210418170244-447662583133/go.mod h1:pP5yiIhq+W7vHjnESJqpaUkCAEwxzF+Qu0bSGbODHkc=
forge.chapril.org/armen/jw v0.0.0-20210419152101-8df8e7745249 h1:z9OsT3EATMw+odhBvSKYhKEe3MS+KVireJemvPr4zcI=
forge.chapril.org/armen/jw v0.0.0-20210419152101-8df8e7745249/go.mod h1:5Hsi6doo6khS4ObBurGUfrC7IK9tZ3BAj3/ExWdeZ6M=
forge.chapril.org/armen/memory v0.0.0-20210419152138-2768ef42e06f h1:rU7mHorcyWQlAyEsD+a/qxAi3ikXib1annrrl0a1Na8=
forge.chapril.org/armen/memory v0.0.0-20210419152138-2768ef42e06f/go.mod h1:LfKOwicIlKsTkqf6I0Smq/Oghmd8HQq368aDqtwJfrQ=
forge.chapril.org/armen/model v0.0.0-20210419152944-a253d0a648a0 h1:Sc8ZFkOnYjD8qOGzUyjgEGYEM4J0KrJor2ZKFuNZRK4=
forge.chapril.org/armen/model v0.0.0-20210419152944-a253d0a648a0/go.mod h1:PDptWO0VKSuMYNgthZxtG1vY/83YHXDqaKDIz0yLHYg=
forge.chapril.org/mls-361/application v0.0.0-20210419150458-e34518fabf18 h1:X6GYxFel5A5u8NresyJ9YTmsvp/wfbfe86i3ZavLeKc=
forge.chapril.org/mls-361/application v0.0.0-20210419150458-e34518fabf18/go.mod h1:oOPg97An4tKSxVRd8MxuvAP61EFYIvjuP0s9RaVYez4=
forge.chapril.org/mls-361/buffer v0.0.0-20210410182428-5dc7a7b2ae79 h1:Lh+y98uVFC7btl5FdxKNtokzHD2j14R4ZIgJECao6r4=
forge.chapril.org/mls-361/buffer v0.0.0-20210410182428-5dc7a7b2ae79/go.mod h1:JnOkXF+AEkQ4mv65rzW9eVLsauGzOYIUBQB0zUb5NGE=
forge.chapril.org/mls-361/crypto v0.0.0-20210418170259-779e1f6e73c9 h1:iGwqmz0LDa1oqp1CEn/+0uvv9uisYFnXKid8SomUArg=
forge.chapril.org/mls-361/crypto v0.0.0-20210418170259-779e1f6e73c9/go.mod h1:VR2+c9Va2NNETm721gtc1AvO3HJqyTW/Tpq/CguYXIY=
forge.chapril.org/mls-361/failure v0.0.0-20210412202827-a8d100489f9d/go.mod h1:DyK2Dj+C/nhpKvGiVsWEzK8mfkk140tJPdgIvUNWv9I=
forge.chapril.org/mls-361/failure v0.0.0-20210418162001-830a0944aa37 h1:QUZ+L7q7wTuiB9yKwlOhLWd6VlPHMKJmeHyVXUROgQE=
forge.chapril.org/mls-361/failure v0.0.0-20210418162001-830a0944aa37/go.mod h1:DyK2Dj+C/nhpKvGiVsWEzK8mfkk140tJPdgIvUNWv9I=
forge.chapril.org/mls-361/fqdn v0.0.0-20210418170211-3af5dcfceb57 h1:G0qCivtJaOyjTZH0OTt1Fc6kO0CYZVMdhgXAAriROgs=
forge.chapril.org/mls-361/fqdn v0.0.0-20210418170211-3af5dcfceb57/go.mod h1:GbKe59RQ6LTPYutLN2PuZg7VGIshtb4Yo2Z+Ubn98TA=
forge.chapril.org/mls-361/jsonapi v0.0.0-20210418170528-5106ffb37c0d h1:C6yf7WM9FsDJzkN0s7FtE/XaJfgsMIHITNhT7NWqPJ4=
forge.chapril.org/mls-361/jsonapi v0.0.0-20210418170528-5106ffb37c0d/go.mod h1:gpaVfpZYjsPo59PGjBAe0I1yapjEh75tf5Xbl6CYiw8=
forge.chapril.org/mls-361/crypto v0.0.0-20210419150713-2fc6d04c4850 h1:Q0WdLgVuZuYN3bZQKVjYOKftauaxywHqSU4PvsbGkoU=
forge.chapril.org/mls-361/crypto v0.0.0-20210419150713-2fc6d04c4850/go.mod h1:1QHsaso0KEWR1XbnmC/GUuyKTPR3n6u6nrvr3wIsOq0=
forge.chapril.org/mls-361/errors v0.0.0-20210419145112-c1508d3017f8 h1:eztQc4g0w+hhWbKSfdCVHeMaK7k/N/bGGFwfJciMNVw=
forge.chapril.org/mls-361/errors v0.0.0-20210419145112-c1508d3017f8/go.mod h1:tYV6p4tU+TxW2HlyaQvCVx/7XYBapDHZJ+ipgtjTrXQ=
forge.chapril.org/mls-361/fqdn v0.0.0-20210419150140-98fba3aef254 h1:ZdR6JTPIkGeUXsB7r2gWU37ucIqHAnMtubGz/XVFB64=
forge.chapril.org/mls-361/fqdn v0.0.0-20210419150140-98fba3aef254/go.mod h1:ULEPZweDdCZ79AXeY2GdGsCDfuKtey7agDTL0CXsZR8=
forge.chapril.org/mls-361/jsonapi v0.0.0-20210419151416-6c8e8e391566 h1:V17iEeKQrG+MkWPPmYaxBKZSAeyp3EGuMk5uQuzwlL4=
forge.chapril.org/mls-361/jsonapi v0.0.0-20210419151416-6c8e8e391566/go.mod h1:K/YsteATnPctR35D8k3URryRND9VmBG2zAw3dyPEYoc=
forge.chapril.org/mls-361/kvfmt v0.0.0-20210411202715-0e7c3e922d37 h1:6e1Y7hTJ0B8BYStiZSCdW4+v686rOpstQh2B5SWOhZU=
forge.chapril.org/mls-361/kvfmt v0.0.0-20210411202715-0e7c3e922d37/go.mod h1:bv44R0CAd8lQV4ub1hjLE3kWYwpfsW4Ro9zRnD4YOMU=
forge.chapril.org/mls-361/logger v0.0.0-20210412202904-dadda1a823de/go.mod h1:kQ2uGfvLdRl47OxE/GI8LThroYe6RnodiqfRUbJMst0=
forge.chapril.org/mls-361/logger v0.0.0-20210418170327-6857e8c31608 h1:+rV9WP1rBix4fDWo73bNOoZFwpzwvsVzYqRGaGgvtHc=
forge.chapril.org/mls-361/logger v0.0.0-20210418170327-6857e8c31608/go.mod h1:SWqzFutF8l6j8bATORg71p3LtadaFKA0k1jPnJQmjmk=
forge.chapril.org/mls-361/logger v0.0.0-20210419151129-c85106763b03 h1:WaF8QpRWQWqPbkBP9tpFHR520XDFSKnLQ3Yoa8RKCvU=
forge.chapril.org/mls-361/logger v0.0.0-20210419151129-c85106763b03/go.mod h1:hkP3gnadMzkPNjcJYz8H/2Ljk0y4yY/bhjFBC/P3q9o=
forge.chapril.org/mls-361/uuid v0.0.0-20210411123640-49d47af267ff h1:N7L3nN/9Wlck9qtIxH6gbQ9sbWtsZ048+eDEdpvD09g=
forge.chapril.org/mls-361/uuid v0.0.0-20210411123640-49d47af267ff/go.mod h1:OAYM+f6ErfC4jbruuG2crA5W7YSpr7+wEs2MrxIzR3Q=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
@ -44,7 +41,6 @@ github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk
github.com/gregjones/httpcache v0.0.0-20170920190843-316c5e0ff04e/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
github.com/hashicorp/hcl v0.0.0-20170914154624-68e816d1c783/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w=
github.com/inconshreveable/log15 v0.0.0-20170622235902-74a0988b5f80/go.mod h1:cOaXtrgN4ScfRrD9Bre7U1thNq5RtJ8ZoP4iXVGRj6o=
github.com/jinzhu/copier v0.2.8/go.mod h1:24xnZezI2Yqac9J61UC6/dG/k76ttpq0DdJI3QmUvro=
github.com/jinzhu/copier v0.2.9 h1:v0Wnz+GKEI63FX7cU2LI20mFFlhTNl+36cjDIuhq3QY=
github.com/jinzhu/copier v0.2.9/go.mod h1:24xnZezI2Yqac9J61UC6/dG/k76ttpq0DdJI3QmUvro=
github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U=

4
internal/cmdline/cmdline.go

@ -7,15 +7,15 @@
package cmdline
import (
"errors"
"fmt"
"os"
"forge.chapril.org/mls-361/application"
"forge.chapril.org/mls-361/crypto"
"forge.chapril.org/mls-361/errors"
)
var _errArgs = errors.New("not enough or too many arguments")
const _errArgs = errors.Sentinel("not enough or too many arguments")
func newCrypto(app *application.Application) (*crypto.Crypto, error) {
c := crypto.New()

4
internal/config/config.go

@ -7,7 +7,7 @@
package config
import (
"forge.chapril.org/mls-361/failure"
"forge.chapril.org/mls-361/errors"
"forge.chapril.org/armen/armen/internal/components"
"forge.chapril.org/armen/armen/internal/config/data"
@ -38,7 +38,7 @@ func Load(app components.Application) (components.Config, error) {
return nil, err
}
default:
return nil, failure.New( ///////////////////////////////////////////////////////////////////////////////////
return nil, errors.New( ////////////////////////////////////////////////////////////////////////////////////
"this configuration mode is not valid",
"mode", config,
)

4
internal/storage/storage.go

@ -8,7 +8,7 @@ package storage
import (
"forge.chapril.org/armen/memory"
"forge.chapril.org/mls-361/failure"
"forge.chapril.org/mls-361/errors"
"forge.chapril.org/armen/armen/internal/components"
)
@ -25,7 +25,7 @@ func Build(app components.Application,
case "memory":
return memory.New(), nil
default:
return nil, failure.New( ///////////////////////////////////////////////////////////////////////////////////////
return nil, errors.New( ////////////////////////////////////////////////////////////////////////////////////////
"this storage type is unknown",
"type", cfg.Type,
)

Loading…
Cancel
Save