reference

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package reference contains constructors for public API reference types.

Index

Constants

View Source
const XTransiterHost = "X-Transiter-Host"

XTransiterHost is the key of the HTTP header whose value is used as the base URL in all link values.

TODO(APIv2): rename X-Transiter-BaseURL

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

Generator is used for generating reference messages.

func NewGenerator

func NewGenerator(ctx context.Context) Generator

func (Generator) AgenciesHref

func (h Generator) AgenciesHref(systemID string) *string

func (Generator) Agency

func (h Generator) Agency(id string, systemID string, name string) *api.Agency_Reference

func (Generator) Alert

func (h Generator) Alert(id, systemID, cause, effect string) *api.Alert_Reference

func (Generator) Feed

func (h Generator) Feed(id string, systemID string) *api.Feed_Reference

func (Generator) FeedUpdatesHref

func (h Generator) FeedUpdatesHref(systemID string, feedID string) *string

func (Generator) FeedsHref

func (h Generator) FeedsHref(systemID string) *string

func (Generator) Route

func (h Generator) Route(id string, systemID string, color string) *api.Route_Reference

func (Generator) RoutesHref

func (h Generator) RoutesHref(systemID string) *string

func (Generator) Shape added in v0.6.1

func (h Generator) Shape(id string, systemID string) *api.Shape_Reference

func (Generator) Stop

func (h Generator) Stop(id string, systemID string, name pgtype.Text) *api.Stop_Reference

func (Generator) StopsHref

func (h Generator) StopsHref(systemID string) *string

func (Generator) System

func (h Generator) System(id string) *api.System_Reference

func (Generator) SystemsHref

func (h Generator) SystemsHref() *string

func (Generator) TransfersHref

func (h Generator) TransfersHref(systemID string) *string

func (Generator) Trip

func (h Generator) Trip(id string, route *api.Route_Reference, destination *api.Stop_Reference, vehicle *api.Vehicle_Reference, directionID bool) *api.Trip_Reference

func (Generator) Vehicle

func (h Generator) Vehicle(id string, systemID string) *api.Vehicle_Reference

Jump to

Keyboard shortcuts

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