Implement IP API daemon with GeoIP database support

- Create modular architecture with separate packages for config, database, HTTP, logging, and state management
- Implement Cobra CLI with daemon command
- Set up Uber FX dependency injection
- Add Chi router with health check and IP lookup endpoints
- Implement GeoIP database downloader with automatic updates
- Add state persistence for tracking database download times
- Include comprehensive test coverage for all components
- Configure structured logging with slog
- Add Makefile with test, lint, and build targets
- Support both IPv4 and IPv6 lookups
- Return country, city, ASN, and location data in JSON format
This commit is contained in:
2025-07-27 18:15:38 +02:00
commit 2a1710cca8
24 changed files with 2402 additions and 0 deletions

10
cmd/ipapi/main.go Normal file
View File

@@ -0,0 +1,10 @@
// Package main is the entry point for the ipapi command.
package main
import (
"git.eeqj.de/sneak/ipapi/internal/ipapi"
)
func main() {
ipapi.CLIEntry()
}