Documentation
¶
Index ¶
- func ComputeMetadataLinks(itemCount int, limit int, offset int, path string) []interface{}
- func EndWithLowerCase(s string) bool
- 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 *domains.BordeauxAPIResponse) error
- func GetSpecialEventName(reason domains.ClosingReason, eventName string) string
- func GetStringParams(c *gin.Context, paramName string) string
- func GetTimezoneFromHeader(c *gin.Context) (*time.Location, error)
- func InitOpenApi(logger *log.Entry)
- func JsonLoggerMiddleware() gin.HandlerFunc
- func MapBoats(closingReason domains.ClosingReason, boatNames string, ...) []domains.Boat
- func MapClosingReason(stringClosingReason string) domains.ClosingReason
- func MapClosingType(stringClosingType string) domains.ClosingType
- func StartWithUpperCase(s string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeMetadataLinks ¶ added in v0.1.0
ComputeMetadataLinks Create the metadata links associated to the response
func EndWithLowerCase ¶ added in v0.1.0
func FormatDataTime ¶
func FormatDataTime( stringTime string, closingDate string, offsetInSec int, location time.Location, ) (time.Time, error)
FormatDataTime Take the date, the hours and the timezone offset and return the related time.Time object
func GetIntParams ¶
GetIntParams Get the int param paramName passed into the request. Return an error if not specified or empty, the value either
func GetOpenAPIData ¶
func GetOpenAPIData(openDataAPIResponse *domains.BordeauxAPIResponse) error
GetOpenAPIData Get forecasts data from the Open-data API Populate the *domains.OpenDataAPIResponse pointer if the data are correct
func GetSpecialEventName ¶ added in v0.1.0
func GetSpecialEventName(reason domains.ClosingReason, eventName string) string
GetSpecialEventName Return the special name event (if this is a special event)
func GetStringParams ¶
GetStringParams Get the string param paramName passed into the request. Return empty string if not specified or empty, the value either
func GetTimezoneFromHeader ¶
GetTimezoneFromHeader Get the timezone passed into the request header. Return an error if the header is missing and/or mal formatted. The value either
func JsonLoggerMiddleware ¶
func JsonLoggerMiddleware() gin.HandlerFunc
func MapBoats ¶
func MapBoats( closingReason domains.ClosingReason, boatNames string, closingDuration time.Duration, circulationClosingDate time.Time, alreadySeenBoatNames *[]string, ) []domains.Boat
MapBoats Return a []domains.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) domains.ClosingReason
MapClosingReason Return the corresponding domains.ClosingReason according to the string value
func MapClosingType ¶
func MapClosingType(stringClosingType string) domains.ClosingType
MapClosingType Return the corresponding domains.ClosingType according to the string value
func StartWithUpperCase ¶ added in v0.1.0
Types ¶
This section is empty.