Welcome to aiolambda’s documentation!¶
Quickstart¶
Requirements:¶
- docker
- python3
- pip3
- aiolambda-cli:
- pip install -U aiolambda
API specs:¶
Define microservice OpenAPI specs, for example:
/auth/{user_id}:
get:
tags:
- auth
summary: Return JWT token
operationId: jwt.handlers.auth_handler
parameters:
- name: user_id
description: User unique identifier
in: path
required: true
example: 12
schema:
type: integer
responses:
'200':
description: JWT token
content:
'application/json':
schema:
type: string
Code¶
Define your custom handlers referenced in openAPI specs. For example, auth_handler:
async def auth_handler(user_id: str) -> Response:
return compose(
generate_token,
logger.debug,
return_200)(user_id)
Template init¶
TODO
Template update¶
Database¶
TODO
AMQP¶
TODO
Roadmap¶
- Add more examples:
- crud_users: postgres. Postgres calls.
- *Document project: [page:database:postgres]
- user_settings: mq. Send and subscribe AMQP messages.
- *Document project: [page:amqp]
- jwt: ci integration. Basic CI integration with travis.
- *Document project: [page:ci:travisci]
- jwt: container integration. Basic container integration.
- *Document project: [page:containers:docker:]
- jwt: functional implementations. Async compose, types: errors, ROP documentation.
- *Document project: [page:functional]
- Change command definitions:
- inputs:
- Command defined with env vars, not cli commands (only use cli commands for short commands [big execution number of times]).
- updates:
- Makes with inline, replace based ansible filters. (same things: number_of_postgres versions, etc… with default values)
- .env:
- Recomend .env for auto updates and load envars in each directory (projects).
- Contributions:
- databases:
- redis…
- mongo…
- containers:
- firecracker…
- code analysis:
- code climate
- automated api tests:
- dredd
- aiolambda functional
Aiolambda-cli¶
Usage:
aiolambda-cli init [--db=<name>] [--mq] [--ci] <project-name>
aiolambda-cli [-h]
Options:
-h --help Show this screen.
--version Show version.
--db=<name> Database to include: [postgresql].
--mq Include RabbitMQ/AMQP client library.
--ci Include Travis-CI configuration.