How kodefluence/altair works
Altair is a Go API gateway whose principal runtime purpose is to accept API traffic and route it toward configured upstreams; its repository also includes a plugin system, OAuth management and authorization, and Prometheus metrics. The tree identifies configuration, routing, controller, plugin, and OAuth subsystems, while the sampled code confirms configuration compilation, controller interfaces, OAuth application-manager dependencies, and the metrics endpoint. Most runtime wiring and proxy request details were not sampled, so uncertain call relationships are omitted.
Main entry points: application_manager.go Application manager · altair.go Altair gateway · controller.go Controller interfaces · routing.go Route contracts
Components 21
Gateway runtime
- Altair gateway
altair.go - Controller interfaces
core/controller.go - Controller manager
module/controller/usecase/controller.go
Configuration and routing
- App configuration
cfg/app.go - Database configuration
cfg/database.go - Database access
cfg/database_bearer.go - Route contracts
core/routing.go - Route compiler
module/router/usecase/compiler.go - Route generator
module/router/usecase/generator.go
Plugin runtime
- Plugin registry
plugin/registry.go - Plugin runner
plugin/runner.go - Plugin interface
module/plugin.go
OAuth
- OAuth endpoints
plugin/oauth/module/authorization/controller/http/http.go - Authorization logic
plugin/oauth/module/authorization/usecase/authorization.go - Application endpoints
plugin/oauth/module/application/controller/http/http.go - Application manager
plugin/oauth/module/application/usecase/application_manager.go - OAuth formatter
plugin/oauth/module/formatter/usecase/formatter.go
State and metrics
- OAuth repositories
plugin/oauth/repository/mysql/oauth_application.go - Prometheus endpoint
plugin/metric/module/prometheus/controller/http/prometheus_controller.go
Other components
- API caller
- Prometheus
Connections 8
- API caller → Altair gateway: sends requests
- Altair gateway → Controller interfaces: handles routes
- Controller manager → Controller interfaces: manages controllers
- Route compiler → Route contracts: implements compile
- Route generator → Route contracts: implements generate
- Application manager → OAuth repositories: repository dependency
- Application manager → OAuth formatter: formatter dependency
- Prometheus → Prometheus endpoint: scrapes metrics