Versions in this module Expand all Collapse all v0 v0.4.6 Jun 16, 2022 Changes in this version + const CollaborativeRecommend + const DataImported + const GlobalMeta + const HiddenItemsV2 + const IgnoreItems + const ItemCategories + const ItemNeighborIndexRecall + const ItemNeighbors + const ItemNeighborsDigest + const LastFitMatchingModelTime + const LastFitRankingModelTime + const LastModifyItemTime + const LastModifyUserTime + const LastUpdateItemNeighborsTime + const LastUpdateLatestItemsTime + const LastUpdatePopularItemsTime + const LastUpdateUserNeighborsTime + const LastUpdateUserRecommendTime + const LatestItems + const MatchingIndexRecall + const Measurements + const NumItemLabels + const NumItems + const NumTotalPosFeedbacks + const NumUserLabels + const NumUsers + const NumValidNegFeedbacks + const NumValidPosFeedbacks + const OfflineRecommend + const OfflineRecommendDigest + const PopularItems + const UserNeighborIndexRecall + const UserNeighbors + const UserNeighborsDigest + var ErrNoDatabase = errors.NotAssignedf("database") + var ErrObjectNotExist = errors.NotFoundf("object") + func BatchKey(prefix string, keys ...string) []string + func GetScores(s []Scored) []float64 + func Key(keys ...string) string + func RemoveScores(items []Scored) []string + func SortScores(scores []Scored) + type Database interface + AddSet func(key string, members ...string) error + AddSorted func(sortedSets ...SortedSet) error + Close func() error + Delete func(name string) error + Get func(name string) *ReturnValue + GetSet func(key string) ([]string, error) + GetSorted func(key string, begin, end int) ([]Scored, error) + GetSortedByScore func(key string, begin, end float64) ([]Scored, error) + Init func() error + RemSet func(key string, members ...string) error + RemSorted func(members ...SetMember) error + RemSortedByScore func(key string, begin, end float64) error + Scan func(work func(string) error) error + Set func(values ...Value) error + SetSet func(key string, members ...string) error + SetSorted func(key string, scores []Scored) error + func Open(path string) (Database, error) + type MongoDB struct + func (m MongoDB) AddSet(name string, members ...string) error + func (m MongoDB) AddSorted(sortedSets ...SortedSet) error + func (m MongoDB) Close() error + func (m MongoDB) Delete(name string) error + func (m MongoDB) Get(name string) *ReturnValue + func (m MongoDB) GetSet(name string) ([]string, error) + func (m MongoDB) GetSorted(name string, begin, end int) ([]Scored, error) + func (m MongoDB) GetSortedByScore(name string, begin, end float64) ([]Scored, error) + func (m MongoDB) Init() error + func (m MongoDB) RemSet(name string, members ...string) error + func (m MongoDB) RemSorted(members ...SetMember) error + func (m MongoDB) RemSortedByScore(name string, begin, end float64) error + func (m MongoDB) Scan(work func(string) error) error + func (m MongoDB) Set(values ...Value) error + func (m MongoDB) SetSet(name string, members ...string) error + func (m MongoDB) SetSorted(name string, scores []Scored) error + type NoDatabase struct + func (NoDatabase) AddSet(_ string, _ ...string) error + func (NoDatabase) AddSorted(_ ...SortedSet) error + func (NoDatabase) Close() error + func (NoDatabase) Delete(_ string) error + func (NoDatabase) Get(_ string) *ReturnValue + func (NoDatabase) GetSet(_ string) ([]string, error) + func (NoDatabase) GetSorted(_ string, _, _ int) ([]Scored, error) + func (NoDatabase) GetSortedByScore(_ string, _, _ float64) ([]Scored, error) + func (NoDatabase) Init() error + func (NoDatabase) RemSet(_ string, _ ...string) error + func (NoDatabase) RemSorted(_ ...SetMember) error + func (NoDatabase) RemSortedByScore(_ string, _, _ float64) error + func (NoDatabase) Scan(_ func(string) error) error + func (NoDatabase) Set(_ ...Value) error + func (NoDatabase) SetSet(_ string, _ ...string) error + func (NoDatabase) SetSorted(_ string, _ []Scored) error + type Redis struct + func (r *Redis) AddSet(key string, members ...string) error + func (r *Redis) AddSorted(sortedSets ...SortedSet) error + func (r *Redis) Close() error + func (r *Redis) Delete(key string) error + func (r *Redis) Get(key string) *ReturnValue + func (r *Redis) GetSet(key string) ([]string, error) + func (r *Redis) GetSorted(key string, begin, end int) ([]Scored, error) + func (r *Redis) GetSortedByScore(key string, begin, end float64) ([]Scored, error) + func (r *Redis) Init() error + func (r *Redis) RemSet(key string, members ...string) error + func (r *Redis) RemSorted(members ...SetMember) error + func (r *Redis) RemSortedByScore(key string, begin, end float64) error + func (r *Redis) Scan(work func(string) error) error + func (r *Redis) Set(values ...Value) error + func (r *Redis) SetSet(key string, members ...string) error + func (r *Redis) SetSorted(key string, scores []Scored) error + type ReturnValue struct + func (r *ReturnValue) Integer() (int, error) + func (r *ReturnValue) String() (string, error) + func (r *ReturnValue) Time() (time.Time, error) + type SQLDatabase struct + func (db *SQLDatabase) AddSet(key string, members ...string) error + func (db *SQLDatabase) AddSorted(sortedSets ...SortedSet) error + func (db *SQLDatabase) Close() error + func (db *SQLDatabase) Delete(name string) error + func (db *SQLDatabase) Get(name string) *ReturnValue + func (db *SQLDatabase) GetSet(key string) ([]string, error) + func (db *SQLDatabase) GetSorted(key string, begin, end int) ([]Scored, error) + func (db *SQLDatabase) GetSortedByScore(key string, begin, end float64) ([]Scored, error) + func (db *SQLDatabase) Init() error + func (db *SQLDatabase) RemSet(key string, members ...string) error + func (db *SQLDatabase) RemSorted(members ...SetMember) error + func (db *SQLDatabase) RemSortedByScore(key string, begin, end float64) error + func (db *SQLDatabase) Scan(work func(string) error) error + func (db *SQLDatabase) Set(values ...Value) error + func (db *SQLDatabase) SetSet(key string, members ...string) error + func (db *SQLDatabase) SetSorted(key string, scores []Scored) error + type SQLDriver int + const MySQL + const Postgres + const SQLite + type SQLSet struct + Member string + Name string + func (*SQLSet) TableName() string + type SQLSortedSet struct + Member string + Name string + Score float64 + func (*SQLSortedSet) TableName() string + type SQLValue struct + Name string + Value string + func (*SQLValue) TableName() string + type Scored struct + Id string + Score float64 + func CreateScoredItems(itemIds []string, scores []T) []Scored + type SetMember struct + func Member(name, member string) SetMember + type SortedSet struct + func Sorted(name string, scores []Scored) SortedSet + type Value struct + func Integer(name string, value int) Value + func String(name, value string) Value + func Time(name string, value time.Time) Value