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:
24
Makefile
Normal file
24
Makefile
Normal file
@@ -0,0 +1,24 @@
|
||||
.PHONY: test fmt lint build clean
|
||||
|
||||
# Default target
|
||||
test: lint
|
||||
go test -v ./...
|
||||
|
||||
fmt:
|
||||
go fmt ./...
|
||||
|
||||
lint:
|
||||
go vet ./...
|
||||
golangci-lint run
|
||||
go mod tidy
|
||||
|
||||
build:
|
||||
go build -o bin/ipapi ./cmd/ipapi
|
||||
|
||||
clean:
|
||||
rm -rf bin/
|
||||
|
||||
run: build
|
||||
./bin/ipapi daemon
|
||||
|
||||
.DEFAULT_GOAL := test
|
||||
Reference in New Issue
Block a user