mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
add caching intreface
This commit is contained in:
@@ -1,8 +1,18 @@
|
|||||||
import { GetterRepository } from "./GetterRepository";
|
import { GetterRepository } from "./GetterRepository";
|
||||||
import { IEta } from "../entities/entities";
|
import { IEta, IOrderedStop, IRoute } from "../entities/entities";
|
||||||
|
|
||||||
// TODO: implement
|
// TODO: implement
|
||||||
|
|
||||||
|
interface ApiBasedRepositoryCache {
|
||||||
|
etasForShuttleId: {
|
||||||
|
[shuttleId: string]: IEta[],
|
||||||
|
},
|
||||||
|
etasForStopId: {
|
||||||
|
[stopId: string]: IEta[],
|
||||||
|
},
|
||||||
|
// To speed things up, implement caches for other data later
|
||||||
|
}
|
||||||
|
|
||||||
export class ApiBasedRepository implements GetterRepository {
|
export class ApiBasedRepository implements GetterRepository {
|
||||||
public async getEtaForShuttleAndStopId(shuttleId: string, stopId: string): Promise<IEta | null> {
|
public async getEtaForShuttleAndStopId(shuttleId: string, stopId: string): Promise<IEta | null> {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user