busnetwork

package
v0.0.0-...-951530c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2016 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package busnetwork contain types that can be used to describe a bus network.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	Routes Routes
	Stops  Stops
}

Data is a container for data about a bus network.

type Route

type Route struct {
	ID         int
	LongName   string
	ShortName  string
	StopRoutes StopRoutes
}

Route describes a route.

type Routes

type Routes []*Route

Routes is a collection of pointers to Route(s).

func (Routes) GetByID

func (routes Routes) GetByID(id int) *Route

GetByID returns the route with the given id within routes.

type Service

type Service struct {
	Delay     int
	StopRoute *StopRoute
	Time      time.Time
	Operated  bool
}

Service describes a service.

type Services

type Services []*Service

Services is a collection of pointers to Service(s).

type Stop

type Stop struct {
	ID         int
	Name       string
	Services   Services
	StopRoutes StopRoutes
}

Stop describes a stop.

type StopRoute

type StopRoute struct {
	Stop     *Stop
	Route    *Route
	Services Services
}

StopRoute describes a route passing through a stop. Services are associated with a stop and a route through this type. This allows direct retrieval of services along a specific route stopping at a specific stop.

type StopRoutes

type StopRoutes []*StopRoute

StopRoutes is a collection of pointers to StopRoute(s).

func (StopRoutes) GetByRouteID

func (stopRoutes StopRoutes) GetByRouteID(routeID int) *StopRoute

GetByRouteID returns the stopRoute with the given routeID within stopRoutes.

type Stops

type Stops []*Stop

Stops is a collection of pointers to Stop(s).

func (Stops) GetByID

func (stops Stops) GetByID(id int) *Stop

GetByID returns the stop with the given id within stops. Returns nil if the stop was not found.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL