Documentation ¶
Overview ¶
Package too provides a recommendation engine implementation built on top of Redis
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchRaterOp ¶
type Engine ¶
type Engine struct { Likes Rater Dislikes Rater Similars Similars Suggestions Suggestions // contains filtered or unexported fields }
Example ¶
package main import ( "fmt" "log" "github.com/hjr265/too" ) func main() { te, err := too.New("redis://localhost", "movies") if err != nil { log.Fatal(err) } te.Likes.Add("Sonic", "The Shawshank Redemption") te.Likes.Add("Sonic", "The Godfather") te.Likes.Add("Sonic", "The Dark Knight") te.Likes.Add("Sonic", "Pulp Fiction") te.Likes.Add("Mario", "The Godfather") te.Likes.Add("Mario", "The Dark Knight") te.Likes.Add("Mario", "The Shawshank Redemption") te.Likes.Add("Mario", "The Prestige") te.Likes.Add("Mario", "The Matrix") te.Likes.Add("Peach", "The Godfather") te.Likes.Add("Peach", "Inception") te.Likes.Add("Peach", "Fight Club") te.Likes.Add("Peach", "WALL·E") te.Likes.Add("Peach", "Princess Mononoke") te.Likes.Add("Luigi", "The Prestige") te.Likes.Add("Luigi", "The Dark Knight") items, _ := te.Suggestions.For("Luigi", 2) for _, item := range items { fmt.Println(item) } }
Output: The Shawshank Redemption The Matrix
func (*Engine) DisableAutoUpdateSimilarsAndSuggestions ¶
func (e *Engine) DisableAutoUpdateSimilarsAndSuggestions()
func (*Engine) EnableAutoUpdateSimilarsAndSuggestions ¶
func (e *Engine) EnableAutoUpdateSimilarsAndSuggestions()
type Rater ¶
type Rater struct {
// contains filtered or unexported fields
}
type Similars ¶
type Similars struct {
// contains filtered or unexported fields
}
type Suggestions ¶
type Suggestions struct {
// contains filtered or unexported fields
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.