krkstops

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2021 License: GPL-3.0 Imports: 15 Imported by: 0

README

Krkstops

Krkstops is golang backend for KrkStops web and mobile application. Enjoy!

Documentation

Index

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 (c *Clients) AddSuggestion(shortName, name string, score float64) error

func (*Clients) ApplyScore added in v0.3.0

func (c *Clients) ApplyScore(score float64, shortName string) error

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 (c *Clients) FinishScoring() error

func (*Clients) GetStopToScore added in v0.3.0

func (c *Clients) GetStopToScore() (shortName string, err error)

func (*Clients) InitializeScoring added in v0.3.0

func (c *Clients) InitializeScoring() error

func (*Clients) RestartScoring added in v0.3.0

func (c *Clients) RestartScoring() error

func (*Clients) ScoreStop added in v0.3.0

func (c *Clients) ScoreStop(krk pb.KrkStopsClient, shortName string) (float64, error)

func (*Clients) UpdateSuggestionsAndRedis added in v0.3.0

func (c *Clients) UpdateSuggestionsAndRedis(newStops ttss.Stops, oldStops ttss.Stops) error

UpdateSuggestionsAndRedis in Redisearch engine

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

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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