Adrien Marquès
f2423bd71a
make internal/multipart use internal/cerr constant errors
...
- instead of defining its own
2020-03-08 16:26:55 +01:00
Adrien Marquès
638f5e44c8
test internal/config trick to have a 100% coverage (as conflict check is undeterministic, merge all conditions)
2020-03-08 16:26:55 +01:00
Adrien Marquès
228f5b9a02
test internal/config empty parameter rename should not rename
2020-03-08 16:26:55 +01:00
Adrien Marquès
aba95d4163
remove dead code
2020-03-08 16:26:55 +01:00
Adrien Marquès
e9c7160d2e
expand internal/config test coverage
...
- make parameter type "?" invalid as it marks it as optional only
- check optional vs. required parameters
- test subservice in method description error check
2020-03-08 16:26:55 +01:00
Adrien Marquès
61b58a9f98
add internal/config test for the Browse() method
2020-03-08 16:26:55 +01:00
Adrien Marquès
dd0e321cbd
test internal/config parsing and illegal/missing fields
2020-03-08 16:26:55 +01:00
Adrien Marquès
5ac3b81f6d
parameter name conflict: on rename conflicting rename, return original name
2020-03-08 16:26:55 +01:00
Adrien Marquès
4accad7286
refactor internal/config
...
- create cerr (constant errors) with wrapped context (service name, method, parameter name)
- fix comments numbering
- remove duplicate check
2020-03-08 16:26:55 +01:00
Adrien Marquès
dec7fd9a62
test internal/cerr package + add WrapString() to use a raw string
2020-03-08 16:26:55 +01:00
Adrien Marquès
d1d581bd75
Test json: add a check with invalid json (no parameter is parsed)
2020-03-08 16:26:55 +01:00
Adrien Marquès
5f1d76a0a8
Test json body parameters
2020-03-08 16:26:55 +01:00
Adrien Marquès
ac7adcbd1f
Test with url encoded body parameters
2020-03-08 16:26:55 +01:00
Adrien Marquès
5897461323
Test store agains Query parameters
2020-03-08 16:26:55 +01:00
Adrien Marquès
44d19e8b65
Test store with uri arguments
2020-03-08 16:26:55 +01:00
Adrien Marquès
613233faef
Test empty store -> fix
2020-03-08 16:26:55 +01:00
Adrien Marquès
c40fb03aa7
merge parseParameter
2020-03-08 16:26:55 +01:00
Adrien Marquès
be84c86172
fix: use t.Run in tests instead of for{} with i
2019-05-05 19:01:54 +02:00
Adrien Marquès
21f48a65ee
feat: parallelize tests +ci
2019-05-05 19:01:54 +02:00
Adrien Marquès
bf3e651c2c
ref: clean comments and make errors constants
2019-05-05 19:01:54 +02:00
Adrien Marquès
eb5ce4c0d0
fix: semantic renaming : internal.config.Method.Permission is now Scope
2019-05-05 19:01:54 +02:00
Adrien Marquès
189d3b40a6
fix: semantic (comments) renaming : 'controller' to 'service', more explicit names
2019-05-05 19:01:54 +02:00
Adrien Marquès
0e498607ba
clean
2019-05-05 19:01:54 +02:00
Adrien Marquès
b9f240b86b
feat: fix error creation to bind arguments directly + add optional error argument in NewResponse()
2019-05-05 19:01:54 +02:00
Adrien Marquès
cd2bcdd8bc
ref 0: first working version ; totest
2019-05-01 15:14:49 +02:00
Adrien Marquès
7e66b6ddd5
ref 0: big refactor of concerns between api request, server, etc
2019-05-01 13:44:45 +02:00
Adrien Marquès
16d3399ee9
ref 0: internal.checker renamed typecheck (no more internal)
2019-05-01 11:28:55 +02:00
Adrien Marquès
8d45d3241b
ref 0: internal.checker defines an interface ; default types are in internal.checker.builtin
2019-05-01 11:23:05 +02:00
Adrien Marquès
8109f57d15
ref 0: internal.apidef becomes internal.config + refactoe
2019-05-01 10:29:23 +02:00
Adrien Marquès
a63e227538
ref 0: internal/request
2019-05-01 00:02:28 +02:00
Adrien Marquès
0eee615aea
rename 'internal/api' to 'internal/apidef' (api definition)
2018-10-07 11:40:35 +02:00
Adrien Marquès
5e7ece3f30
fix mispelled words
2018-10-07 11:14:54 +02:00
Adrien Marquès
d590d31327
add exported fields' comments
2018-10-07 11:14:04 +02:00
Adrien Marquès
fe3034818d
add 'id' (positive 'int') type checker
2018-10-02 12:00:57 +02:00
Adrien Marquès
93aa8b66dc
add 'bool' type checker
2018-10-02 11:59:12 +02:00
Adrien Marquès
12ddf1feae
add 'float' type checker
2018-10-02 11:55:47 +02:00
Adrien Marquès
e43623d108
default type check 'string' does not use 'reflect' no more
2018-10-02 11:50:01 +02:00
Adrien Marquès
50de7a4297
default type check 'int' does not use 'reflect' anymore
2018-10-02 11:46:22 +02:00
Adrien Marquès
f9a928c181
add 'digest(length)' type checker + minfix import in cmd/main
2018-10-02 11:34:58 +02:00
Adrien Marquès
b1092437f9
refactor default type checkers | load default types if set in aicra.json (.build/DEFAULT_TYPES/*.so)
2018-10-02 11:10:21 +02:00
Adrien Marquès
d406338777
implement driver for type checkers | move controller/middleware/checker definition inside the 'driver' package (all uses are exported from this place) | now driver.Driver returns 'Controller', 'Middleware', and 'Checker' in the interface | a lot a junk
2018-10-01 19:27:38 +02:00
Adrien Marquès
37fe30ebc7
rename 'internal/meta' to 'internal/config' | move driver type definition into explicit file + remove 'import' driver | remove useless method to parse multipart
2018-10-01 17:43:18 +02:00
Adrien Marquès
7bcbefdf35
rename 'internal/config' to 'internal/api' | rename 'internal.api.Load()' to 'internal.api.Parse()'
2018-10-01 14:15:00 +02:00
Adrien Marquès
fd6d7b661e
add implementation to 'default types'
2018-10-01 14:02:09 +02:00
Adrien Marquès
b6e19c255b
implement 'AICRA' command | system to parse config, set defaults, infer map of sources from a folder, etc
2018-10-01 12:29:05 +02:00
Adrien Marquès
9c9079f06b
add 'driver.Driver.Name() string' and use it to select the default type/middleware folder (.build/middleware or middleware) | fix driver.Generic.LoadMiddleware() | remove variadic arguments for middleware.CreateRegistry() and checker.CreateRegistry()
2018-09-28 15:59:21 +02:00
Adrien Marquès
2cfc5a2ba0
update 'middleware' types | rename driver.Driver.Load() into RunController() | add driver.Driver.LoadMiddleware() | add driver management to middleware.Registry at creation | [TODO] implement diver.Generic.LoadMiddleware()
2018-09-28 10:54:13 +02:00
Adrien Marquès
74e4ce83cb
restrict parameter names in config + ignore parameter names in received requests
2018-09-28 08:54:04 +02:00
Adrien Marquès
f5800900b0
rename 'internal/apirequest' to 'internal/request' but use import alias 'apirequest' in dependencies
2018-09-28 08:10:41 +02:00
Adrien Marquès
fced676c42
add 'driver/generic' (to test, alpha version)
2018-09-27 14:11:48 +02:00