Versions in this module Expand all Collapse all v0 v0.4.6 Jun 16, 2022 Changes in this version + var RestAPIRequestSecondsVec = promauto.NewHistogramVec(prometheus.HistogramOpts{ ... }, []string{ ... }) + func BadRequest(response *restful.Response, err error) + func InternalServerError(response *restful.Response, err error) + func Ok(response *restful.Response, content interface{}) + func PageNotFound(response *restful.Response, err error) + func ParseDuration(request *restful.Request, name string) (time.Duration, error) + func ParseInt(request *restful.Request, name string, fallback int) (value int, err error) + func Text(response *restful.Response, content string) + type CacheModification struct + func NewCacheModification(client cache.Database, hiddenItemsManager *HiddenItemsManager) *CacheModification + func (cm *CacheModification) Exec() error + func (cm *CacheModification) HideItem(itemId string) *CacheModification + type Feedback struct + Comment string + Timestamp string + func (f Feedback) ToDataFeedback() (data.Feedback, error) + type FeedbackIterator struct + Cursor string + Feedback []data.Feedback + type HiddenItemsManager struct + func NewHiddenItemsManager(s *RestServer) *HiddenItemsManager + func (hc *HiddenItemsManager) IsHidden(members []string, category string) ([]bool, error) + func (hc *HiddenItemsManager) IsHiddenInCache(member string, category string) bool + type Item struct + Categories []string + Comment string + IsHidden bool + ItemId string + Labels []string + Timestamp string + type ItemIterator struct + Cursor string + Items []data.Item + type LocalCache struct + ServerName string + func LoadLocalCache(path string) (*LocalCache, error) + func (s *LocalCache) WriteLocalCache() error + type Measurement struct + Name string + Timestamp time.Time + Value float32 + func NewMeasurementFromScore(name string, score cache.Scored) (Measurement, error) + func (m Measurement) GetScore() cache.Scored + type PopularItemsCache struct + func NewPopularItemsCache(s *RestServer) *PopularItemsCache + func (sc *PopularItemsCache) GetSortedScore(member string) float64 + type Recommender func(ctx *recommendContext) error + type RestServer struct + DisableLog bool + HiddenItemsManager *HiddenItemsManager + HttpHost string + HttpPort int + IsDashboard bool + OneMode bool + PopularItemsCache *PopularItemsCache + WebService *restful.WebService + func (s *RestServer) AuthFilter(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) + func (s *RestServer) CreateWebService() + func (s *RestServer) FilterOutHiddenScores(response *restful.Response, items []cache.Scored, category string) []cache.Scored + func (s *RestServer) GetMeasurements(name string, n int) ([]Measurement, error) + func (s *RestServer) InsertFeedbackToCache(feedback []data.Feedback) error + func (s *RestServer) InsertMeasurement(measurements ...Measurement) error + func (s *RestServer) LogFilter(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) + func (s *RestServer) MetricsFilter(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) + func (s *RestServer) Recommend(response *restful.Response, userId, category string, n int, ...) ([]string, error) + func (s *RestServer) RecommendCollaborative(ctx *recommendContext) error + func (s *RestServer) RecommendItemBased(ctx *recommendContext) error + func (s *RestServer) RecommendLatest(ctx *recommendContext) error + func (s *RestServer) RecommendOffline(ctx *recommendContext) error + func (s *RestServer) RecommendPopular(ctx *recommendContext) error + func (s *RestServer) RecommendUserBased(ctx *recommendContext) error + func (s *RestServer) StartHttpServer(container *restful.Container) + type Server struct + func NewServer(masterHost string, masterPort int, serverHost string, serverPort int, ...) *Server + func (s *Server) Serve() + func (s *Server) SetOneMode(settings *config.Settings) + func (s *Server) Sync() + type Success struct + RowAffected int + type UserIterator struct + Cursor string + Users []data.User