Documentation ¶
Index ¶
- Constants
- func ValidateCreateDevice(req *pb.CreateDeviceRequest) error
- func ValidateDeleteDevice(req *pb.DeleteDeviceRequest) error
- type CampusServer
- func (s *CampusServer) CreateCanteenRating(ctx context.Context, input *pb.CreateCanteenRatingRequest) (*pb.CreateCanteenRatingReply, error)
- func (s *CampusServer) CreateDevice(_ context.Context, req *pb.CreateDeviceRequest) (*pb.CreateDeviceReply, error)
- func (s *CampusServer) CreateDishRating(ctx context.Context, input *pb.CreateDishRatingRequest) (*pb.CreateDishRatingReply, error)
- func (s *CampusServer) CreateFeedback(stream pb.Campus_CreateFeedbackServer) error
- func (s *CampusServer) DeleteDevice(_ context.Context, req *pb.DeleteDeviceRequest) (*pb.DeleteDeviceReply, error)
- func (s *CampusServer) GetAvailableCafeteriaTags(ctx context.Context, _ *pb.ListAvailableCanteenTagsRequest) (*pb.ListAvailableCanteenTagsReply, error)
- func (s *CampusServer) GetCafeterias(ctx context.Context, _ *pb.ListCanteensRequest) (*pb.ListCanteensReply, error)
- func (s *CampusServer) GetCanteenHeadCount(ctx context.Context, input *pb.GetCanteenHeadCountRequest) (*pb.GetCanteenHeadCountReply, error)
- func (s *CampusServer) GetDishRatings(ctx context.Context, input *pb.GetDishRatingsRequest) (*pb.GetDishRatingsReply, error)
- func (s *CampusServer) GetUpdateNote(ctx context.Context, req *pb.GetUpdateNoteRequest) (*pb.GetUpdateNoteReply, error)
- func (s *CampusServer) ListAvailableDishTags(ctx context.Context, _ *pb.ListAvailableDishTagsRequest) (*pb.ListAvailableDishTagsReply, error)
- func (s *CampusServer) ListCanteenRatings(ctx context.Context, input *pb.ListCanteenRatingsRequest) (*pb.ListCanteenRatingsReply, error)
- func (s *CampusServer) ListDishes(ctx context.Context, req *pb.ListDishesRequest) (*pb.ListDishesReply, error)
- func (s *CampusServer) ListMovies(ctx context.Context, req *pb.ListMoviesRequest) (*pb.ListMoviesReply, error)
- func (s *CampusServer) ListNameTags(ctx context.Context, _ *pb.ListNameTagsRequest) (*pb.ListNameTagsReply, error)
- func (s *CampusServer) ListNews(ctx context.Context, req *pb.ListNewsRequest) (*pb.ListNewsReply, error)
- func (s *CampusServer) ListNewsAlerts(ctx context.Context, req *pb.ListNewsAlertsRequest) (*pb.ListNewsAlertsReply, error)
- func (s *CampusServer) ListNewsSources(ctx context.Context, _ *pb.ListNewsSourcesRequest) (*pb.ListNewsSourcesReply, error)
- func (s *CampusServer) RunDeviceFlusher() error
- type ModelType
Constants ¶
const FlushingInterval = time.Minute
Variables ¶
This section is empty.
Functions ¶
func ValidateCreateDevice ¶
func ValidateCreateDevice(req *pb.CreateDeviceRequest) error
func ValidateDeleteDevice ¶
func ValidateDeleteDevice(req *pb.DeleteDeviceRequest) error
Types ¶
type CampusServer ¶
type CampusServer struct { pb.UnimplementedCampusServer // contains filtered or unexported fields }
func New ¶
func New(db *gorm.DB) *CampusServer
func (*CampusServer) CreateCanteenRating ¶
func (s *CampusServer) CreateCanteenRating(ctx context.Context, input *pb.CreateCanteenRatingRequest) (*pb.CreateCanteenRatingReply, error)
CreateCanteenRating RPC Endpoint Allows to store a new cafeteria Rating. If one of the parameters is invalid, an error will be returned. Otherwise, the rating will be saved. All rating tags which were given with the new rating are stored if they are valid tags, if at least one tag was invalid, an error is returned, all valid ratings tags will be stored nevertheless. Either the german or the english name can be returned to successfully store tags
func (*CampusServer) CreateDevice ¶
func (s *CampusServer) CreateDevice(_ context.Context, req *pb.CreateDeviceRequest) (*pb.CreateDeviceReply, error)
func (*CampusServer) CreateDishRating ¶
func (s *CampusServer) CreateDishRating(ctx context.Context, input *pb.CreateDishRatingRequest) (*pb.CreateDishRatingReply, error)
CreateDishRating RPC Endpoint Allows to store a new dish Rating. If one of the parameters is invalid, an error will be returned. Otherwise, the rating will be saved. The ratingNumber will be saved for each corresponding DishNameTag. All rating tags which were given with the new rating are stored if they are valid tags, if at least one tag was invalid, an error is returned, all valid ratings tags will be stored nevertheless. Either the german or the english name can be returned to successfully store tags
func (*CampusServer) CreateFeedback ¶
func (s *CampusServer) CreateFeedback(stream pb.Campus_CreateFeedbackServer) error
CreateFeedback accepts a stream of feedback messages from the client and stores them in the database/file system.
func (*CampusServer) DeleteDevice ¶
func (s *CampusServer) DeleteDevice(_ context.Context, req *pb.DeleteDeviceRequest) (*pb.DeleteDeviceReply, error)
func (*CampusServer) GetAvailableCafeteriaTags ¶
func (s *CampusServer) GetAvailableCafeteriaTags(ctx context.Context, _ *pb.ListAvailableCanteenTagsRequest) (*pb.ListAvailableCanteenTagsReply, error)
GetAvailableCafeteriaTags RPC Endpoint Returns all valid Tags to quickly rate dishes in english and german
func (*CampusServer) GetCafeterias ¶
func (s *CampusServer) GetCafeterias(ctx context.Context, _ *pb.ListCanteensRequest) (*pb.ListCanteensReply, error)
GetCafeterias RPC endpoint Returns all cafeterias with meta information which are available in the eat-api
func (*CampusServer) GetCanteenHeadCount ¶
func (s *CampusServer) GetCanteenHeadCount(ctx context.Context, input *pb.GetCanteenHeadCountRequest) (*pb.GetCanteenHeadCountReply, error)
GetCanteenHeadCount RPC Endpoint
func (*CampusServer) GetDishRatings ¶
func (s *CampusServer) GetDishRatings(ctx context.Context, input *pb.GetDishRatingsRequest) (*pb.GetDishRatingsReply, error)
func (*CampusServer) GetUpdateNote ¶
func (s *CampusServer) GetUpdateNote(ctx context.Context, req *pb.GetUpdateNoteRequest) (*pb.GetUpdateNoteReply, error)
func (*CampusServer) ListAvailableDishTags ¶
func (s *CampusServer) ListAvailableDishTags(ctx context.Context, _ *pb.ListAvailableDishTagsRequest) (*pb.ListAvailableDishTagsReply, error)
ListAvailableDishTags RPC Endpoint Returns all valid Tags to quickly rate dishes in english and german with the corresponding Id
func (*CampusServer) ListCanteenRatings ¶
func (s *CampusServer) ListCanteenRatings(ctx context.Context, input *pb.ListCanteenRatingsRequest) (*pb.ListCanteenRatingsReply, error)
ListCanteenRatings RPC Endpoint Allows to query ratings for a specific cafeteria. It returns the average rating, max/min rating as well as a number of actual ratings and the average ratings for all cafeteria rating tags which were used to rate this cafeteria. The parameter limit defines how many actual ratings should be returned. The optional parameters from and to can define an interval in which the queried ratings have been stored. If these aren't specified, the newest ratings will be returned as the default
func (*CampusServer) ListDishes ¶
func (s *CampusServer) ListDishes(ctx context.Context, req *pb.ListDishesRequest) (*pb.ListDishesReply, error)
func (*CampusServer) ListMovies ¶
func (s *CampusServer) ListMovies(ctx context.Context, req *pb.ListMoviesRequest) (*pb.ListMoviesReply, error)
func (*CampusServer) ListNameTags ¶
func (s *CampusServer) ListNameTags(ctx context.Context, _ *pb.ListNameTagsRequest) (*pb.ListNameTagsReply, error)
ListNameTags RPC Endpoint Returns all valid Tags to quickly rate dishes in english and german with the corresponding Id
func (*CampusServer) ListNews ¶
func (s *CampusServer) ListNews(ctx context.Context, req *pb.ListNewsRequest) (*pb.ListNewsReply, error)
func (*CampusServer) ListNewsAlerts ¶
func (s *CampusServer) ListNewsAlerts(ctx context.Context, req *pb.ListNewsAlertsRequest) (*pb.ListNewsAlertsReply, error)
func (*CampusServer) ListNewsSources ¶
func (s *CampusServer) ListNewsSources(ctx context.Context, _ *pb.ListNewsSourcesRequest) (*pb.ListNewsSourcesReply, error)
func (*CampusServer) RunDeviceFlusher ¶
func (s *CampusServer) RunDeviceFlusher() error
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package migration contains functions related to database changes and executes them
|
Package migration contains functions related to database changes and executes them |