feat: implement Yandex /search method for on-demand edge expansion (Task 2)

- Add SearchRoutes method to yandex client for on-demand station pair searches
- Implement hub expansion via on-demand /search calls in lazy graph expansion
- Integrate cache key generation for search results (search:{from}:{to}:{date})
- Update expandFromStation and expandFromCityHub to use Yandex API
- Add NewGraphWithoutYandex constructor for testability
- Add tests for on-demand search integration and cache TTL policies
This commit is contained in:
2026-08-14 14:14:14 +03:00
parent 829e93fc8f
commit 181575e092
5 changed files with 337 additions and 84 deletions

View File

@@ -14,8 +14,8 @@ import (
func main() {
redisClient := initRedis()
router := routing.NewGraph()
yandexClient := yandex.NewClient("default-key")
router := routing.NewGraph(yandexClient)
handlerCtx := NewHandlerContext(redisClient, router, yandexClient)