Redirectory API Reference¶
This part of the documentation is for developers who would like to know the insides of the project. Here you will find all of the documentation of the source code of Redirectory.
libs_int overview¶
Libs_int is the main package that holds most of the main logic of the application. The main goal is to move out the logic from the API endpoints themselves and have it in one place. This package holds logic for quite a few things:
- Config - .yaml configuration files
- Database - all the needed classes and methods to interact with the database
- Hyperscan - all of the logic of the Hyperscan regex engine
- Importers - different file importers. At the moment only CSV.
- Metrics - logic about Prometheus metrics
- Service - helper classes and methods for API functionality. Also Gunicorn.
models overview¶
Redirectory uses a SQLite3 database which sits as a file in the data folder of the application. The Models packages contains the different models for the database. Redirectory is using SQLAlchemy library to the it’s interactions with the database.
runnables overview¶
Again because Redirectory is made for Kubernetes we split up the application in three different parts:
- Management
- Worker
- Compiler
Because of this we need a nice way to separate between those different modes.
Here the runnables come in play. A runnable is a class which makes use of the
run()
method which loads different things and prepares the application to
run in the correct mode.
services overview¶
The service package is where all of the different API endpoints are situated. Because the application is made for Kubernetes there are a few different modes that Redirectory can run as. Therefore the API endpoints are split in the same manner:
- Management Endpoints
- Worker Endpoints
Based on the node_type which is specified in the config.yaml the different sets of API endpoints are loaded at startup. In other words, if you run the application as management you won’t be able to call worker endpoints and the other way around.
Important
Keep in mind the stats endpoints are loaded in both management and worker mode.
Contents¶
- Libs_Int package
- Models package
- Runnables package
- Services package