Used to write a cache files to the disk.
More...
|
static string | VehiclePositionHistory (DateTime dateStartTime, TimeSpan timeSpan, string vehicle) |
| The file name for a the vehicle position history cache file. More...
|
|
Used to write a cache files to the disk.
◆ CreateCacheDirectory()
static void ReadingBusesAPI.Common.CacheWriter.CreateCacheDirectory |
( |
| ) |
|
|
static |
Creates the two hidden cache folders.
◆ ReadOrCreateCache< T >()
static async Task< T > ReadingBusesAPI.Common.CacheWriter.ReadOrCreateCache< T > |
( |
string |
cacheLocation, |
|
|
string |
liveURL, |
|
|
bool |
useCache |
|
) |
| |
|
static |
Checks is the data stored within cache, if so read it, else make a request to the live API and cache this result for next time.
- Template Parameters
-
T | The type of data we are wanting. |
- Parameters
-
cacheLocation | The location of cache on disk if it exists. |
liveURL | The live url to find the data within the API. |
useCache | States if we should check and use cache or not. |
- Returns
◆ TimetabledJourneys()
static string ReadingBusesAPI.Common.CacheWriter.TimetabledJourneys |
( |
BusService |
service, |
|
|
BusStop |
location, |
|
|
DateTime |
date |
|
) |
| |
|
static |
The file name for a Timetabled Journey cache file.
- Parameters
-
service | The bus service/ |
location | The bus stop |
date | The date of the request. |
- Returns
- The cache location.
◆ TrackingHistory()
static string ReadingBusesAPI.Common.CacheWriter.TrackingHistory |
( |
BusService |
service, |
|
|
BusStop |
location, |
|
|
DateTime |
date, |
|
|
string |
vehicle |
|
) |
| |
|
static |
The file name for a tracking history cache file.
- Parameters
-
service | The bus service/ |
location | The bus stop |
date | The date of the request. |
vehicle | The vehicle id |
- Returns
- The cache location.
◆ VehiclePositionHistory()
static string ReadingBusesAPI.Common.CacheWriter.VehiclePositionHistory |
( |
DateTime |
dateStartTime, |
|
|
TimeSpan |
timeSpan, |
|
|
string |
vehicle |
|
) |
| |
|
staticpackage |
The file name for a the vehicle position history cache file.
- Parameters
-
dateStartTime | The date of interest |
timeSpan | The time length of interest. |
vehicle | The vehicle id. |
- Returns
- The cache location.
◆ ARCHIVED_CACHE_FOLDER
readonly string ReadingBusesAPI.Common.CacheWriter.ARCHIVED_CACHE_FOLDER = "cache-archive" |
|
static |
◆ CACHE_FOLDER
readonly string ReadingBusesAPI.Common.CacheWriter.CACHE_FOLDER = "cache" |
|
static |
The documentation for this class was generated from the following file: