rtfinder

package
v0.0.0-...-3a55c04 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	AddFeedMessage(string, *pb.FeedMessage) error
	AddData(string, []byte) error
	GetSource(string) (*Source, bool)
	Close() error
}

Cache provides a method for looking up and listening for changed RT data

type Finder

type Finder struct {
	Clock clock.Clock
	// contains filtered or unexported fields
}

func NewFinder

func NewFinder(cache Cache, db sqlx.Ext) *Finder

func (*Finder) AddData

func (f *Finder) AddData(topic string, data []byte) error

func (*Finder) FindAlertsForAgency

func (f *Finder) FindAlertsForAgency(t *model.Agency, limit *int, active *bool) []*model.Alert

func (*Finder) FindAlertsForRoute

func (f *Finder) FindAlertsForRoute(t *model.Route, limit *int, active *bool) []*model.Alert

func (*Finder) FindAlertsForStop

func (f *Finder) FindAlertsForStop(t *model.Stop, limit *int, active *bool) []*model.Alert

func (*Finder) FindAlertsForTrip

func (f *Finder) FindAlertsForTrip(t *model.Trip, limit *int, active *bool) []*model.Alert

func (*Finder) FindStopTimeUpdate

func (f *Finder) FindStopTimeUpdate(t *model.Trip, st *model.StopTime) (*pb.TripUpdate_StopTimeUpdate, bool)

func (*Finder) FindTrip

func (f *Finder) FindTrip(t *model.Trip) *pb.TripUpdate

func (*Finder) GetAddedTripsForStop

func (f *Finder) GetAddedTripsForStop(t *model.Stop) []*pb.TripUpdate

TODO: put this method on consumer and wrap, as with GetTrip

func (*Finder) GetGtfsTripID

func (f *Finder) GetGtfsTripID(id int) (string, bool)

func (*Finder) MakeTrip

func (f *Finder) MakeTrip(obj *model.Trip) (*model.Trip, error)

func (*Finder) StopTimezone

func (f *Finder) StopTimezone(id int, known string) (*time.Location, bool)

type LocalCache

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

func NewLocalCache

func NewLocalCache() *LocalCache

func (*LocalCache) AddData

func (f *LocalCache) AddData(topic string, data []byte) error

func (*LocalCache) AddFeedMessage

func (f *LocalCache) AddFeedMessage(topic string, rtmsg *pb.FeedMessage) error

func (*LocalCache) Close

func (f *LocalCache) Close() error

func (*LocalCache) GetSource

func (f *LocalCache) GetSource(topic string) (*Source, bool)

type RedisCache

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

func NewRedisCache

func NewRedisCache(client *redis.Client) *RedisCache

func (*RedisCache) AddData

func (f *RedisCache) AddData(topic string, data []byte) error

func (*RedisCache) AddFeedMessage

func (f *RedisCache) AddFeedMessage(topic string, rtmsg *pb.FeedMessage) error

func (*RedisCache) Close

func (f *RedisCache) Close() error

func (*RedisCache) GetSource

func (f *RedisCache) GetSource(topic string) (*Source, bool)

type Source

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

func NewSource

func NewSource(feed string) (*Source, error)

func (*Source) GetTimestamp

func (f *Source) GetTimestamp() uint64

func (*Source) GetTrip

func (f *Source) GetTrip(tid string) (*pb.TripUpdate, bool)

Jump to

Keyboard shortcuts

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