How hemanth354/relay_campaign_service works
The repository’s main product is an in-memory campaign-events HTTP service: clients submit event batches, the service rejects invalid records and deduplicates accepted events, then exposes campaign statistics and paginated event history. A separate command-line debugging program processes JSONL input and prints deterministic per-campaign summaries. The sampled service code supports the API, validation, aggregation, and concurrency-safe storage links shown here; the debugging program is also sampled. The README documents these capabilities, but no external database or provider integration is shown.
Main entry points: starter/main.go HTTP Server and Handlers · debugging/main.go Batch Processing · store.go Memory Store · types.go Campaign Event Model
Components 13
HTTP API
- HTTP Server and Handlers
starter/main.go
Event Data and Storage
- Campaign Event Model
starter/types.go - Event Validation
starter/types.go - Memory Store
starter/store.go - Campaign Statistics
starter/store.go - Paginated Event History
starter/store.go
Debugging Utility
- JSONL Input
debugging/main.go - Batch Processing
debugging/main.go - Event Deduplication
debugging/main.go - Unique and Daily Tracking
debugging/main.go - Concurrent Counter Updates
debugging/main.go - Sorted Summary Output
debugging/main.go
Other components
- API Client
Connections 16
- API Client → HTTP Server and Handlers: submits events
README.md - HTTP Server and Handlers → Campaign Event Model: decodes events
starter/main.go - HTTP Server and Handlers → Event Validation: validates events
starter/main.go - HTTP Server and Handlers → Memory Store: ingests valid events
starter/main.go - HTTP Server and Handlers → Memory Store: requests statistics
starter/main.go - HTTP Server and Handlers → Memory Store: requests event page
starter/main.go - Memory Store → Campaign Statistics: computes rates
starter/store.go - Memory Store → Paginated Event History: pages campaign events
starter/store.go - HTTP Server and Handlers → API Client: returns API results
README.md - JSONL Input → Batch Processing: reads event lines
debugging/main.go - Batch Processing → Event Deduplication: deduplicates batches
debugging/main.go - Batch Processing → Unique and Daily Tracking: tracks unique opens
debugging/main.go - Batch Processing → Concurrent Counter Updates: dispatches counters
debugging/main.go - Batch Processing → Sorted Summary Output: prints report
debugging/main.go - Event Deduplication → Unique and Daily Tracking: tracks accepted events
debugging/main.go - Concurrent Counter Updates → Sorted Summary Output: provides counters
debugging/main.go