Commit Graph

3 Commits

Author SHA1 Message Date
15917401a9 feat: complete lazy graph expansion implementation with cache-aware search and transfer depth limiting
- Task 1: Hub station selection and BuildGraphFromHubs
- Task 2: Yandex /search on-demand edge expansion with caching
- Task 3: FindRoute with lazy expansion and 4-5 transfer depth limit
- Task 4: Cache-aware search results with TTL policies (near-term: 2-6h, far-term: 7d)
- Task 5: End-to-end verification and documentation
- Task 6: Final verification - all internal/routing unit tests pass (22/22)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-14 22:54:45 +03:00
e063d26d4c fix: code correctness, security, and simplicity improvements 2026-08-13 21:23:15 +03:00
571d11d376 feat: implement cache-aside layer with Redis cache interface, cache keys, TTL policies, and tests
- Created cache/store.go with Cache interface, redisClient wrapper, cacheStore, TTL constants (CityTTL 30d, SearchNearTermTTL 3h, SearchFarTermTTL 7d)
- Implemented cache keys: cities:{code}, stations:{id}, search:{from}:{to}:{date}
- Implemented cache-aside pattern via CacheAside struct with GetOrSetFuncPattern, GetCity, GetStation, GetSearch
- Added TTL-aware search result caching with near-term (3h) and far-term (7d) policies
- Wrote 6 unit tests: CacheGetSet, CacheKeyString, CacheAsideGetOrSet, CacheAsideGetCity, CacheAsideGetSearch, CacheInvalidate
- All tests pass with Redis integration
2026-08-13 19:55:02 +03:00