backend-antiginx¶
Package main provides the entry point for the backend-antiginx API server.
The server connects to PostgreSQL database and RabbitMQ message broker, performs database migrations, and starts an HTTP server for handling security scan requests.
Environment Variables¶
The following environment variables are required:
- DATABASE_URL: PostgreSQL connection string (e.g., postgres://user:pass@host:5432/db)
- RABBITMQ_URL: RabbitMQ connection string (e.g., amqp://user:pass@host:5672/)
Example¶
To run the server:
Index¶
func main¶
main initializes and starts the backend-antiginx API server.
It performs the following steps:
- Loads environment variables from .env file (optional)
- Establishes connection to PostgreSQL database
- Runs database migrations for Scan and ScanResult models
- Connects to RabbitMQ and declares the scan_queue
- Initializes HTTP handlers and starts the server on port 8080
The function will terminate with a fatal error if any critical initialization step fails (database connection, RabbitMQ connection, etc.)
Generated by gomarkdoc