update / fix readme
This commit is contained in:
parent
049400e2be
commit
f157785cff
17
README.md
17
README.md
|
@ -130,7 +130,7 @@ In this example we have the controllers inside the `controller` folder, the midd
|
||||||
"driver": "plugin",
|
"driver": "plugin",
|
||||||
"types": {
|
"types": {
|
||||||
"default": true,
|
"default": true,
|
||||||
"folder": "type"
|
"folder": "checker"
|
||||||
},
|
},
|
||||||
"controllers": {
|
"controllers": {
|
||||||
"folder": "controller.plugin"
|
"folder": "controller.plugin"
|
||||||
|
@ -231,6 +231,7 @@ In this example we want 3 arguments :
|
||||||
"type": "?int",
|
"type": "?int",
|
||||||
"name": "get-param"
|
"name": "get-param"
|
||||||
},
|
},
|
||||||
|
// arg 3
|
||||||
"multipart-var": { /* ... */ }
|
"multipart-var": { /* ... */ }
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -281,7 +282,7 @@ Here is a base code for any controllers
|
||||||
package main
|
package main
|
||||||
import (
|
import (
|
||||||
"git.xdrm.io/go/aicra/driver"
|
"git.xdrm.io/go/aicra/driver"
|
||||||
"git.xdrm.io/go/aicra/response"
|
"git.xdrm.io/go/aicra/api"
|
||||||
e "git.xdrm.io/go/aicra/err"
|
e "git.xdrm.io/go/aicra/err"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -290,20 +291,20 @@ type MyController interface{}
|
||||||
func Export() driver.Controller { return new(MyController) }
|
func Export() driver.Controller { return new(MyController) }
|
||||||
|
|
||||||
// GET method management
|
// GET method management
|
||||||
func (c MyController) Get(args response.Arguments) response.Response {
|
func (c MyController) Get(args api.Arguments) api.Response {
|
||||||
res := response.New()
|
res := api.NewResponse()
|
||||||
res.Err = e.Success
|
res.Err = e.Success
|
||||||
return *res
|
return *res
|
||||||
}
|
}
|
||||||
|
|
||||||
// POST method management
|
// POST method management
|
||||||
func (c MyController) Post(args response.Arguments) response.Response { /*...*/ }
|
func (c MyController) Post(args api.Arguments) api.Response { /*...*/ }
|
||||||
|
|
||||||
// PUT method management
|
// PUT method management
|
||||||
func (c MyController) Put(args response.Arguments) response.Response { /*...*/ }
|
func (c MyController) Put(args api.Arguments) api.Response { /*...*/ }
|
||||||
|
|
||||||
// DELETE method management
|
// DELETE method management
|
||||||
func (c MyController) Delete(args response.Arguments) response.Response { /*...*/ }
|
func (c MyController) Delete(args api.Arguments) api.Response { /*...*/ }
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -501,7 +502,7 @@ func main() {
|
||||||
- [ ] `<a:b>` - map containing **only** keys of type `a` and values of type `b` (*a or b can be ommited*)
|
- [ ] `<a:b>` - map containing **only** keys of type `a` and values of type `b` (*a or b can be ommited*)
|
||||||
- [x] generic controllers implementation (shared objects)
|
- [x] generic controllers implementation (shared objects)
|
||||||
- [x] response interface
|
- [x] response interface
|
||||||
- [ ] devmode watcher : watch manifest, watch plugins to compile + hot reload them
|
- [ ] ~~devmode watcher~~ : watch manifest, watch plugins to compile + hot reload them
|
||||||
- [x] driver for Go plugins
|
- [x] driver for Go plugins
|
||||||
- [x] controllers
|
- [x] controllers
|
||||||
- [x] middlewares
|
- [x] middlewares
|
||||||
|
|
Loading…
Reference in New Issue