Documentation ¶
Index ¶
- Variables
- func ComputeStationTriviaURLs(station *types.Station) map[string]string
- func DisturbanceReasonString(disturbance *types.Disturbance, alwaysReturn bool) string
- func DurationAbs(n time.Duration) time.Duration
- func FormatPortugueseDurationLong(d time.Duration) string
- func FormatPortugueseMonth(month time.Month) string
- func FormatPortugueseMonthShort(month time.Month) string
- func Fudge(value, approximateTo int) int
- func GetClientIP(r *http.Request) (ip string)
- func Int64Abs(n int64) int64
- func RequestIsTLS(r *http.Request) bool
- func SchedulesToLines(schedules []*types.LobbySchedule) []string
- func StationConnectionURLs(station *types.Station) map[string]map[string]string
Constants ¶
This section is empty.
Variables ¶
var Consts = map[string]reflect.Value{}
var Functions = map[string]reflect.Value{ "ComputeStationTriviaURLs": reflect.ValueOf(ComputeStationTriviaURLs), "DurationAbs": reflect.ValueOf(DurationAbs), "FormatPortugueseDurationLong": reflect.ValueOf(FormatPortugueseDurationLong), "FormatPortugueseMonth": reflect.ValueOf(FormatPortugueseMonth), "FormatPortugueseMonthShort": reflect.ValueOf(FormatPortugueseMonthShort), "Fudge": reflect.ValueOf(Fudge), "GetClientIP": reflect.ValueOf(GetClientIP), "Int64Abs": reflect.ValueOf(Int64Abs), "RequestIsTLS": reflect.ValueOf(RequestIsTLS), "SchedulesToLines": reflect.ValueOf(SchedulesToLines), "StationConnectionURLs": reflect.ValueOf(StationConnectionURLs), }
var SupportedLocales = [...]string{"pt", "en", "es", "fr", "de"}
SupportedLocales contains the supported locales for extra and meta content
var Types = map[string]reflect.Type{}
var Variables = map[string]reflect.Value{ "SupportedLocales": reflect.ValueOf(&SupportedLocales), }
Functions ¶
func ComputeStationTriviaURLs ¶
ComputeStationTriviaURLs returns a mapping from locales to URLs of the HTML file containing the trivia for the given station
func DisturbanceReasonString ¶
func DisturbanceReasonString(disturbance *types.Disturbance, alwaysReturn bool) string
DisturbanceReasonString returns a short human-friendly string explaining why a disturbance happened/what it is related to
func DurationAbs ¶
DurationAbs is math.Abs for time.Duration
func FormatPortugueseDurationLong ¶
FormatPortugueseDurationLong returns a long string representation of a duration in Portuguese
func FormatPortugueseMonth ¶
FormatPortugueseMonth returns the Portuguese name for a month
func FormatPortugueseMonthShort ¶
FormatPortugueseMonthShort returns the Portuguese name abbreviation for a month
func GetClientIP ¶
GetClientIP retrieves the client IP address from the request information. It detects common proxy headers to return the actual client's IP and not the proxy's.
func RequestIsTLS ¶
RequestIsTLS returns whether a request was made over a HTTPS channel Looks at the appropriate headers if the server is behind a proxy
func SchedulesToLines ¶
func SchedulesToLines(schedules []*types.LobbySchedule) []string
SchedulesToLines converts a lobby schedule to a set of human-readable lines
Types ¶
This section is empty.