Documentation
¶
Index ¶
- Constants
- Variables
- type Clients
- func (c *Clients) AddSuggestion(shortName, name string, score float64) error
- func (c *Clients) ApplyScore(score float64, shortName string) error
- func (c *Clients) CompareStops(stops ttss.Stops) (newStops ttss.Stops, oldStops ttss.Stops, err error)
- func (c *Clients) FinishScoring() error
- func (c *Clients) GetStopToScore() (shortName string, err error)
- func (c *Clients) InitializeScoring() error
- func (c *Clients) RestartScoring() error
- func (c *Clients) ScoreStop(krk pb.KrkStopsClient, shortName string) (float64, error)
- func (c *Clients) UpdateSuggestionsAndRedis(newStops ttss.Stops, oldStops ttss.Stops) error
- type KrkStopsServer
- func (s *KrkStopsServer) FindNearestAirlyInstallation(ctx context.Context, location *pb.InstallationLocation) (*pb.Installation, error)
- func (s *KrkStopsServer) GetAirly(ctx context.Context, installation *pb.Installation) (*pb.Airly, error)
- func (s *KrkStopsServer) GetAirlyInstallation(ctx context.Context, installation *pb.Installation) (*pb.Installation, error)
- func (s *KrkStopsServer) GetDepartures(stop *pb.Stop, stream pb.KrkStops_GetDeparturesServer) error
- func (s *KrkStopsServer) SearchStops(search *pb.StopSearch, stream pb.KrkStops_SearchStopsServer) error
Constants ¶
View Source
const ( STOPS_TO_SCORE = "stops.toScore" STOPS = "stops" STOPS_NEW = "stops.new" STOPS_TMP = "stops.tmp" )
Variables ¶
View Source
var AirlyExpire = time.Minute * 10
View Source
var ENDPOINT = "krkstops.germanywestcentral.cloudapp.azure.com:8080"
View Source
var ScoringInitialized = errors.New("scoring is already initialized")
Functions ¶
This section is empty.
Types ¶
type Clients ¶ added in v0.3.0
type Clients struct { Redis *redis.Client RedisAutocompleter *redisearch.Autocompleter // contains filtered or unexported fields }
func (*Clients) AddSuggestion ¶ added in v0.3.0
func (*Clients) ApplyScore ¶ added in v0.3.0
func (*Clients) CompareStops ¶ added in v0.3.0
func (c *Clients) CompareStops(stops ttss.Stops) (newStops ttss.Stops, oldStops ttss.Stops, err error)
CompareStops and return new and old. New stops are stored in 'stops.tmp' set.
func (*Clients) FinishScoring ¶ added in v0.3.0
func (*Clients) GetStopToScore ¶ added in v0.3.0
func (*Clients) InitializeScoring ¶ added in v0.3.0
func (*Clients) RestartScoring ¶ added in v0.3.0
type KrkStopsServer ¶ added in v0.3.0
type KrkStopsServer struct { pb.UnimplementedKrkStopsServer C Clients Airly airly.Endpoint Ttss []ttss.Endpointer }
func (*KrkStopsServer) FindNearestAirlyInstallation ¶ added in v0.3.0
func (s *KrkStopsServer) FindNearestAirlyInstallation(ctx context.Context, location *pb.InstallationLocation) (*pb.Installation, error)
func (*KrkStopsServer) GetAirly ¶ added in v0.3.0
func (s *KrkStopsServer) GetAirly(ctx context.Context, installation *pb.Installation) (*pb.Airly, error)
func (*KrkStopsServer) GetAirlyInstallation ¶ added in v0.3.0
func (s *KrkStopsServer) GetAirlyInstallation(ctx context.Context, installation *pb.Installation) (*pb.Installation, error)
func (*KrkStopsServer) GetDepartures ¶ added in v0.3.0
func (s *KrkStopsServer) GetDepartures(stop *pb.Stop, stream pb.KrkStops_GetDeparturesServer) error
func (*KrkStopsServer) SearchStops ¶ added in v0.3.0
func (s *KrkStopsServer) SearchStops(search *pb.StopSearch, stream pb.KrkStops_SearchStopsServer) error
Click to show internal directories.
Click to hide internal directories.