This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
go build -v -race- Build the logferry binary with race detectiongo build -v -race(in logferry-api/) - Build the logferry-api binary with race detection./run- Run logferry client in development mode./logferry-api/run- Run logferry-api server in development modegofumpt -w .- Format all Go files (always run before commits)
go mod tidy- Clean up dependenciesmake sign- Sign with drone CI (production)
- logferry: Main client that watches for Avro log files and uploads them to the API server
- logferry-api: HTTP API server that receives log data and forwards to Kafka
- main.go: Client entry point with file watching, certificate management, and upload coordination
- uploader.go: Core upload functionality with retry logic and file processing
- http.go: HTTP client management with TLS and connection pooling
- cleaner.go: Directory cleanup for processed files
- logferry-api/: Server implementation with Echo framework, Kafka integration, and Avro processing
- Client watches directory for new .avro files
- Files are processed and uploaded via HTTPS with client certificates
- API server receives uploads and forwards to Kafka
- Processed files are cleaned up after successful upload
- Client uses command-line flags:
-cert,-key,-path,-upstream - API server uses environment variables:
TLS_CERT,TLS_KEY,KAFKA_* - Default config in
scripts/defaults
- Mutual TLS authentication between client and server
- Client certificates managed via apitls.GetCertman()
- Kafka connections use separate TLS certificates
- OpenTelemetry tracing integrated throughout
- Uses common ntppool.org libraries for TLS, logging, metrics, and tracing
- Kafka integration via segmentio/kafka-go
- Avro processing via hamba/avro
- Echo framework for HTTP API
- Prometheus metrics on port 9097 (client) and via Echo (server)