Skip to content

niclaszll/dvb-go

Repository files navigation

DVB Go Client

Go Reference Go Report Card GitHub release Release Workflow

Unofficial Go client for the Dresden Transport (DVB) API. This library provides easy access to real-time public transport information for Dresden, Germany.

Installation

go get github.com/niclaszll/dvb-go

Quick Start

package main

import (
    "context"
    "fmt"
    "time"

    "github.com/niclaszll/dvb-go"
)

func main() {
    client := dvb.NewClient(dvb.Config{})

    ctx := context.Background()

    // Monitor departures from Dresden Hauptbahnhof
    options := &dvb.MonitorStopParams{
        StopId: "33000028",
        Limit:  &[]int{10}[0],
    }

    response, err := client.MonitorStop(ctx, options)
    if err != nil {
        panic(err)
    }

    fmt.Printf("Stop: %s\n", response.Name)
    // ...
}

Available Endpoints

MonitorStop

Get real-time departures and arrivals for a specific stop.

GetRoute

Find routes between two locations with journey planning.

GetLines

Get all available transport lines serving a stop.

GetPoint

Search for stops and locations by name or query.

Examples

See the example/ directory for some basic usage examples.

About

Unofficial Go client for the Dresden Transport (DVB) Web-API.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages