Documentation ¶
Index ¶
- func AddTo(c *gin.Context, r *Recommender)
- func Shuffle[T any](ids []T, n int)
- type Recommender
- func (r *Recommender) Loop(ctx context.Context, ticker *time.Ticker)
- func (r *Recommender) RecommendFromFollowing(ctx context.Context, userID persist.DBID, follows []db.Follow) ([]persist.DBID, error)
- func (r *Recommender) RecommendFromFollowingShuffled(ctx context.Context, userID persist.DBID, follows []db.Follow) ([]persist.DBID, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddTo ¶
func AddTo(c *gin.Context, r *Recommender)
Types ¶
type Recommender ¶
type Recommender struct { RecommendFunc func(context.Context, persist.DBID, []db.Follow) ([]persist.DBID, error) LoadFunc func(context.Context) SaveResultFunc func(ctx context.Context, userID persist.DBID, recommendedIDs []persist.DBID) error BootstrapFunc func(ctx context.Context) ([]persist.DBID, error) // contains filtered or unexported fields }
func For ¶
func For(ctx context.Context) *Recommender
func NewRecommender ¶
func (*Recommender) Loop ¶
func (r *Recommender) Loop(ctx context.Context, ticker *time.Ticker)
Loop is the main event loop that manages access to the currently loaded graph
Click to show internal directories.
Click to hide internal directories.