|
|
39f20bff4f
|
feat: implement routing graph and search algorithm (max 1 transfer) - Task 4
- Create Graph type with Node/Edge types and methods
- Implement BuildGraphFromStations, SortEdges
- Implement BFS/Dijkstra FindRoute with 1-transfer limit
- Implement ApplyMCT for Minimum Connection Time rules
- Add search algorithm tests (success route, no-route, transfer limit)
- Add MCT application tests (city hub reduction, mode change)
- Update plan Task 4 checkboxes
|
2026-08-13 20:13:49 +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 |
|