• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

rm-hull / next-departures-api / 25151801903
28%

Build:
DEFAULT BRANCH: main
Ran 30 Apr 2026 06:55AM UTC
Jobs 1
Files 16
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

30 Apr 2026 06:54AM UTC coverage: 16.632% (-2.0%) from 18.662%
25151801903

push

github

web-flow
feat: add next departures endpoint via SIRI API (#7)

Adds a new endpoint `GET /v1/next-departures/:stopId` to fetch real-time
departure information using the **SIRI** (Service Interface for
Real-time
Information) standard.

The implementation includes:
*   A new `SiriClient` to communicate with **TransportAPI**.
*   XML request/response models for SIRI Stop Monitoring.
*   Mapping logic to convert SIRI XML responses into a concise JSON
    format for the API consumers.
*   Updated environment configuration for API credentials.

```mermaid
sequenceDiagram
    participant C as Client
    participant S as API Server
    participant L as SiriClient
    participant T as TransportAPI

    C->>S: GET /v1/next-departures/:stopId
    S->>L: GetStopMonitoring(stopId)
    L->>T: POST /nextbuses (XML Request)
    T-->>L: 200 OK (XML Response)
    L-->>S: Siri model + status
    S-->>C: 200 OK (JSON Departures)
```

Update the `SiriClient` to handle HTTP requests more robustly and
securely.

-   Move authentication from the URL to **HTTP Basic Auth** headers.
-   Introduce a `http.Client` with a **10-second timeout** to prevent
    hanging requests.
-   Internalize `previewInterval` and `maximumStopVisits` as struct
    fields for better configuration management.
-   Switch to `http.NewRequest` to allow custom header initialization.

```mermaid
sequenceDiagram
    participant App
    participant Client as SiriClient
    participant API as TransportAPI
    App->>Client: GetStopMonitoring(ref)
    Note over Client: Prepare XML body
    Client->>Client: Create Request
    Client->>Client: Set Basic Auth Header
    Client->>API: POST /nextbuses (10s timeout)
    API-->>Client: XML Response
    Client-->>App: Siri Data
```

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

0 of 104 new or added lines in 3 files covered. (0.0%)

159 of 956 relevant lines covered (16.63%)

0.18 hits per line

Uncovered Changes

Lines Coverage ∆ File
51
0.0
internal/siri_client.go
48
0.0
internal/routes/next_departures.go
5
0.0
0.0% cmd/api_server.go
Jobs
ID Job ID Ran Files Coverage
1 25151801903.1 30 Apr 2026 06:55AM UTC 16
16.63
GitHub Action Run
Source Files on build 25151801903
  • Tree
  • List 16
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 72c6f1a1 on github
  • Prev Build on main (#25128072786)
  • Next Build on main (#25230342317)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc