Documentation ¶
Index ¶
- Variables
- func ComputeForecasts(forecasts *models.Forecasts, openDataForecasts models.OpenDataAPIResponse)
- func ComputeMetadaLinks(itemCount int, limit int, offset int, path string) []interface{}
- func FormatDataTime(stringTime string, closingDate string, offsetInSec int, location time.Location) (time.Time, error)
- func GetIntParams(c *gin.Context, paramName string) (int, error)
- func GetOpenAPIData(openDataAPIResponse *models.OpenDataAPIResponse) error
- func GetStringParams(c *gin.Context, paramName string) string
- func GetTimezoneFromHeader(c *gin.Context) (*time.Location, error)
- func JsonLoggerMiddleware() gin.HandlerFunc
- func MapBoats(closingReason models.ClosingReason, boatNames string, ...) []models.Boat
- func MapClosingReason(stringClosingReason string) models.ClosingReason
- func MapClosingType(stringClosingType string) models.ClosingType
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ComputeForecasts ¶
func ComputeForecasts(forecasts *models.Forecasts, openDataForecasts models.OpenDataAPIResponse)
Populate a []models.Forecast pointer with the OpenAPI data
func ComputeMetadaLinks ¶
Create the metadalinks associated to the response
func FormatDataTime ¶
func FormatDataTime( stringTime string, closingDate string, offsetInSec int, location time.Location, ) (time.Time, error)
Take the date, the hours and the timezone offset and return the related time.Time object
func GetIntParams ¶
Get the int param paramName passed into the request. Return an erro if not specified or empty, the value either
func GetOpenAPIData ¶
func GetOpenAPIData(openDataAPIResponse *models.OpenDataAPIResponse) error
Get forecasts data from the Opendata API Populate the *models.OpenDataAPIResponse pointer if the data are correct
func GetStringParams ¶
Get the string param paramName passed into the request. Return empty string if not specified or empty, the value either
func GetTimezoneFromHeader ¶
Get the timezone passed into the request header. Return an error if the header is missing and/or malformated. The value either
func JsonLoggerMiddleware ¶
func JsonLoggerMiddleware() gin.HandlerFunc
func MapBoats ¶
func MapBoats( closingReason models.ClosingReason, boatNames string, closingDuration time.Duration, circulationClosingDate time.Time, alreadySeenBoatNames *[]string, forecastID string, ) []models.Boat
Return a []models.Boat of a boat crossing forecast. closingReason : If it is a maintenance forecast, no computation boatNames : The raw string containing the boat name(s) closingDuration : Used to compute the approximated crossing time circulationClosingDate : Used to compute the approximated crossing time alreadySeenBoatNames : Array pointer to keep track of the boats. Used to compute the boat Maneuver forecastID : Used to compute the "self" link
func MapClosingReason ¶
func MapClosingReason(stringClosingReason string) models.ClosingReason
Return the corresponding models.ClosingReason according of the string value
func MapClosingType ¶
func MapClosingType(stringClosingType string) models.ClosingType
Return the corresponding models.ClosingType according of the string value
Types ¶
This section is empty.