Adrien Marquès f0aa6d2c5c | ||
---|---|---|
checker | ||
config | ||
err | ||
implement | ||
multipart | ||
request | ||
.gitignore | ||
LICENSE | ||
README.md | ||
build-controllers.sh | ||
build-types.sh | ||
server.go | ||
types.go | ||
util.go |
README.md
aicra: all-in-config REST API
Aicra is a self-working API coded in Go:
- It allows anyone to create a fully featured REST API
- it can be used in Go as a library, or as a proxy to launch external commands (e.g. php scripts)
It is based on the all-in-config idea, where you only have a configuration file, and your implementation and it works without no further work.
A working example is available here
changelog
- human-readable json configuration
- nested routes (i.e.
/user/:id:
and/user/post/:id:
) - nested URL arguments (i.e.
/user/:id:
and/user/:id:/post/:id:
) - useful http methods: GET, POST, PUT, DELETE
- manage URL, query and body arguments:
- multipart/form-data (variables and file uploads)
- application/x-www-form-urlencoded
- application/json
- required vs. optional parameters with a default value
- parameter renaming
- generic authentication system (i.e. you can override the built-in one)
- generic type check (i.e. implement custom types alongside built-in ones)
- built-in types
any
- wildcard matching all valuesint
- any number (e.g. float, int, uint)string
- any textvarchar(min, max)
- any string with a length betweenmin
andmax
<a>
- array containing only elements matchinga
type<a:b>
- map containing only keys of typea
and values of typeb
(a or b can be ommited)
- generic controllers implementation (shared objects)
- response interface