package
0.0.0-20230712103438-30a0ae6ad38f
Repository: https://github.com/underlx/disturbancesmlx.git
Documentation: pkg.go.dev

# Functions

ComputeAPISecretHash calculates the hash for the specified secret with SHA256 HMAC using the specified key.
CountPairActivationsByDay counts APIPair activations by day between the specified dates.
CountPPPlayerAchievementsAchieved returns the total of achieved achievements.
CountPPPlayers returns the total number of players.
CountPPXPTransactionsWithType returns the count of transactions with this type.
CountTripsByDay counts trips by day between the specified dates.
GenerateAPIKey returns a securely randomly generated API key.
GenerateAPISecret returns a securely randomly generated API secret.
GetAutorunScriptsWithType returns a slice with all registered Scripts with the given type and specified autorun level.
GetConnection returns the Connection with the given ID.
GetConnections returns a slice with all registered connections.
GetConnectionsFrom returns the Connections that point out of the given ID.
GetConnectionsFromPlatform returns the Connections that start on the given platform ID.
GetConnectionsTo returns the Connections that point to the given ID.
GetConnectionsToPlatform returns the Connections that end on the given platform ID.
GetDataset returns the Dataset with the given network ID.
GetDatasets returns a slice with all registered Datasets.
GetDisturbance returns the Disturbance with the given ID.
GetDisturbances returns a slice with all registered disturbances.
GetDisturbancesBetween returns a slice with disturbances affecting the specified interval.
GetExit returns the Exit with the given ID.
GetExits returns a slice with all registered exits.
GetFeedback returns the Feedback with the given ID.
GetFeedbacks returns a slice with all registered feedback.
GetLatestNDisturbances returns up to `limit` most recent disturbances.
GetLine returns the Line with the given ID.
GetLineCondition returns the LineCondition with the given ID.
GetLineConditions returns a slice with all registered line conditions.
GetLinePaths returns a slice with all registered paths.
GetLines returns a slice with all registered lines.
GetLineSchedules returns a slice with all registered schedules.
GetLineWithExternalID returns the Line with the given external ID.
GetLobbies returns a slice with all registered lobbies.
GetLobbiesForStation returns a slice with the lobbies for the specified station.
GetLobby returns the lobby with the given ID.
GetLobbySchedules returns a slice with all registered schedules.
GetNetwork returns the Line with the given ID.
GetNetworks returns a slice with all registered networks.
GetNetworkSchedules returns a slice with all registered schedules.
GetOngoingDisturbances returns a slice with all ongoing disturbances.
GetPair returns the API pair with the given ID.
GetPairIfCorrect returns the pair and no errors if the given secret is correct for this API key, and the pair is ready to be used.
GetPOI returns the POI with the given ID.
GetPOIs returns a slice with all registered POIs.
GetPPAchievement returns the achievement with the given ID.
GetPPAchievements returns a slice with all registered transactions.
GetPPNotificationSetting returns the setting for the given parameters.
GetPPPair returns the pair with the given Discord ID.
GetPPPairForKey returns the pair with the given Discord ID.
GetPPPairs returns a slice with all registered pairs.
GetPPPlayer returns the player with the given Discord ID.
GetPPPlayerAchievement returns the achievement with the given ID.
GetPPPlayerAchievements returns a slice with all registered transactions.
GetPPPlayers returns a slice with all registered players.
GetPPXPTransaction returns the transaction with the given ID.
GetPPXPTransactions returns a slice with all registered transactions.
GetPPXPTransactionsBetween returns a slice with all transactions within the specified interval.
GetPPXPTransactionsTotal returns the total of XP in the system.
GetPPXPTransactionsWithType returns a slice with all transactions with the specified type.
GetScript returns the Script with the given ID.
GetScripts returns a slice with all registered Scripts.
GetScriptsWithType returns a slice with all registered Scripts with the given type.
GetSource returns the Source with the given ID.
GetSources returns a slice with all registered sources.
GetStation returns the Station with the given ID.
GetStations returns a slice with all registered stations.
GetStationTags returns a slice with all registered tags.
GetStationUses returns a slice with all registered stationUses.
GetStatus returns the Status with the given ID.
GetStatuses returns a slice with all registered statuses.
GetTransfer returns the Transfer with the given ID.
GetTransfers returns a slice with all registered transfers.
GetTrip returns the Trip with the given ID.
GetTripIDs returns a slice containing the IDs of all the trips in the database.
GetTripIDsBetween returns a slice containing the IDs of the trips in the specified interval.
GetTrips returns a slice with all registered trips.
GetTripsForSubmitter returns a slice with all trips submitted by the specified submitter.
GetTripsForSubmitterBetween returns a slice with trips submitted by the specified submitter made in the specified interval.
GetWiFiAP returns the WiFiAP with the given BSSID.
GetWiFiAPs returns a slice with all registered wiFiAPs.
NewAndroidPairRequest creates a new AndroidPairRequest and returns it Does NOT store the request in the DB.
NewLineDisturbanceReport creates a new LineDisturbanceReport.
NewLineDisturbanceReportDebug creates a test LineDisturbanceReport for debugging.
NewLineDisturbanceReportThroughAPI creates a new LineDisturbanceReport.
NewPair creates a new API access pair, stores it in the DB and returns it.
PosPlayLevelToXP computes the PosPlay XP necessary to reach the given level.
PosPlayPlayerLevel computes the PosPlay level and the % of progression to the next level given the XP total.
PPLeaderboardBetween returns the PosPlay leaderboard for the specified period.
RegisterPPAchievementStrategy makes this package aware of an available achievement strategy All PPAchievements that can be possibly found in the database must have a corresponding strategy.
SetPPNotificationSetting sets the setting for the given parameters.
UnregisterPPAchievementStrategy makes this package unaware of a PPAchievementStrategy.
VehicleIDLessFunc is a function for comparing vehicle ETAs when sorting by vehicle ID.
VehicleIDLessFuncString is a function for comparing vehicle IDs when sorting.

# Constants

Absolute is an ETA with a defined absolute time (e.g.
CommunityReportedCategory is attributed to disturbances reported by the community.
GoneThrough is a type of station use reserved for when an user simply goes through a station on his way to somewhere.
Interchange is a type of station use reserved for a line change in a trip.
MLClosedMessage corresponds to the format "Serviço encerrado".
MLCompositeMessage corresponds to the format: "[d|D]evido a $1$2$3" $1 may be one of: - "avaria na sinalização" (SIGNAL) - "avaria de comboio" (TRAIN) - "falha de energia" (POWER) - "causa alheia ao Metro" (3RDPARTY) - "incidente com passageiro" (PASSENGER) - "anomalia na estação" (STATION) $2 may be one of: - ", a circulação está interrompida desde as XX:XX." (SINCE) - " está interrompida a circulação." (HALTED) - " está interrompida a circulação na linha entre as estações YYY e ZZZ." (BETWEEN) - ", a circulação encontra-se com perturbações." (DELAYED) $3 may be one of: - " Não é possível prever a duração da interrupção, que poderá ser prolongada.
MLGenericMessage corresponds to the format "existem perturbações na circulação.
MLSolvedMessage corresponds to the format "Circulação normal".
MLSpecialServiceMessage corresponds to the format "Serviço especial$1" (only observed $1 so far is " de passagem de ano").
NetworkEntry is a type of station use reserved for the first station in a trip.
NetworkExit is a type of station use reserved for the last station in a trip.
PassengerIncidentCategory is attributed to disturbances involving incidents with passengers.
PowerOutageCategory is attributed to disturbances involving power outages.
RawMessage is an untranslatable message.
RelativeExact is a relative ETA that is exact and known (e.g.
RelativeMaximum is a relative ETA that has an upper bound only (e.g.
RelativeMinimum is a relative ETA that has a lower bound and no upper bound (e.g.
RelativeRange is a relative ETA that has a lower and upper bound (e.g.
ReportBeginMessage is the message for when users begin reporting disturbances.
ReportConfirmMessage is the message for when users confirm disturbance reports.
ReportReconfirmMessage is the message for when users confirm disturbance reports shortly after a disturbance ended.
ReportSolvedMessage is the message for when reports of disturbances are gone.
S2LSincorrectDetection is a type of feedback reserved for incorrect detection of stations by the client.
SignalFailureCategory is attributed to disturbances involving signal failures.
StationAnomalyCategory is attributed to disturbances involving station anomalies.
ThirdPartyFaultCategory is attributed to disturbances involving 3rd party causes.
TrainFailureCategory is attributed to disturbances involving train failures.
Visit is a type of station use reserved for trips with a single station use.

# Variables

No description provided by the author
ErrTimeParse is returned when time unmarshaling fails.
No description provided by the author
NewStatusNotification is a channel where a StatusNotification will be sent whenever a new status/disturbance notification should be issued.
No description provided by the author
No description provided by the author

# Structs

AndroidPairRequest contains info for a pair request issued by an Android app.
Announcement contains an announcement for a network.
APIPair contains API auth credentials.
BaseReport is the base for user report structs.
Connection connects two stations in a single direction.
Dataset is a dataset.
Disturbance represents a disturbance.
Exit is a Lobby exit.
Feedback is a piece of user feedback about the service, like a bug report.
Line is a Network line.
LineCondition represents the operational condition of a Line at a certain point in time.
LineDisturbanceReport is a Report of a disturbance in a line.
LinePath is a Line path.
LineSchedule is a Line schedule.
Lobby is a station lobby.
LobbySchedule is a Lobby schedule.
Network is a transportation network.
NetworkSchedule is a Network schedule.
POI is a Point of Interest.
PPAchievement is a PosPlay achievement.
PPAchievementContext contains the context necessary to process an achievement-producing event.
PPLeaderboardEntry represents a PosPlay leaderboard entry.
PPNotificationSetting is a PosPlay notification setting.
PPPair is a PosPlay pair.
PPPlayer is a PosPlay player.
PPPlayerAchievement contains data about a PosPlay achievement for one user.
PPXPTransaction is a PosPlay XP transaction.
Script contains dynamic behavior for the system to implement at run time.
Source represents a Status source.
Station is a Network station.
StationTags contains station tags.
StationUse represents the stationUse of a Line at a certain point in time.
Status represents the status of a Line at a certain point in time.
StatusNotification contains the information needed to issue a disturbance notification.
Transfer represents a crossing between two lines at a station.
Trip represents a user-submitted subway trip.
VehicleETA defines the estimated arrival time at Station for a vehicle going in Direction.
WiFiAP is a WiFi access point.

# Interfaces

AnnouncementStore manages announcements for one or more networks.
PairConnection represents a APIPair connection with an external service.
PPAchievementStrategy is a strategy/driver for handing a PosPlay achievement.
Report is a user report.

# Type aliases

DisturbanceCategory is a disturbance category.
Duration wraps a time.Duration with custom methods for serialization.
FeedbackType corresponds to a type of feedback.
Point represents bidimentional coordinates (such as GPS coordinates as used by Google Maps).
StationUseType corresponds to a type of station use (i.e.
StatusMessageType indicates the type of the status message (to help with e.g.
Time wraps a time.Time with custom methods for serialization.
VehicleETAType is a type of VehicleETA.