darwindb

package
Version: v0.0.0-...-9ac1095 Latest Latest
Warning

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

Go to latest
Published: May 20, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Coach

type Coach struct {
	Number     string
	Class      string
	ToiletType string
}

Used to aggregate the formation coaches

type DarwinDB

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

func (*DarwinDB) GetService

func (s *DarwinDB) GetService(rid string) (ServiceDetail, error)

func (*DarwinDB) GetServices

func (s *DarwinDB) GetServices(crs string, ts time.Time) (StationServices, error)

func (*DarwinDB) IndexSchedules

func (d *DarwinDB) IndexSchedules()

Invokes the indexing job

func (*DarwinDB) Init

func (d *DarwinDB) Init(cfg *bin.Config) error

func (*DarwinDB) ScheduleUpdated

func (d *DarwinDB) ScheduleUpdated(msg []byte)

Store schedule updates in the db

func (*DarwinDB) Stop

func (d *DarwinDB) Stop()

func (*DarwinDB) Subscribe

func (d *DarwinDB) Subscribe(mq *rabbitmq.RabbitMQ, prefix, queueName string, f func([]byte), eventTypes ...string) error

type Reason

type Reason struct {
	Id     int    `json:"id"`
	Cancel string `json:"cancel"`
	Late   string `json:"late"`
}

Reason text lookup as returned by the proc

type ServiceDetail

type ServiceDetail struct {
	Rid       int                   `json:"rid"`
	Schedule  darwind3.Schedule     `json:"schedule"`
	Tiploc    map[string]cif.Tiploc `json:"tiploc"`
	Formation []Coach               `json:"formation"`
}

The json structure returned by darwin.getservice()

type StationService

type StationService struct {
	Rid              int64                      `json:"rid"`
	Location         darwind3.Location          `json:"location"`
	Destination      string                     `json:"destination"`
	Cancelled        bool                       `json:"cancelled"`
	CancelReason     darwind3.DisruptionReason  `json:"cancelReason"`
	DelayReason      darwind3.DisruptionReason  `json:"delayReason"`
	Uid              string                     `json:"uid"`
	Status           string                     `json:"status"`
	Headcode         string                     `json:"trainId"`
	PassengerService bool                       `json:"passengerService"`
	CharterService   bool                       `json:"charterService"`
	Toc              string                     `json:"toc"`
	Association      []darwind3.Association     `json:"association"`
	Formation        darwind3.ScheduleFormation `json:"formation"`
	Delay            time.Duration              `json:"delay"`
}

type StationServices

type StationServices struct {
	Station  []string              `json:"station"`
	Services []StationService      `json:"services"`
	Reason   map[string]Reason     `json:"reason"`
	Tiploc   map[string]cif.Tiploc `json:"tiploc"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL