Documentation ¶
Index ¶
- type DatabaseCollections
- type DatabaseOperations
- func (ops *DatabaseOperations) AddIllusts(illusts []models.Illust) error
- func (ops *DatabaseOperations) AddRankIllusts(mode string, date string, content string, illusts []models.RankIllust) error
- func (ops *DatabaseOperations) ClearUserIllusts(userId uint64) error
- func (ops *DatabaseOperations) DeleteIllust(illustId uint64) error
- func (ops *DatabaseOperations) DeleteUgoira(ugoiraId uint64) error
- func (ops *DatabaseOperations) DeleteUser(userId uint64) error
- func (ops *DatabaseOperations) GetSampleIllusts(quality int, limit int, resultbanned bool) ([]models.Illust, error)
- func (ops *DatabaseOperations) GetSampleUsers(limit int, resultbanned bool) ([]models.User, error)
- func (ops *DatabaseOperations) InsertIllust(illust *models.Illust) error
- func (ops *DatabaseOperations) InsertIllustSearch(illust *models.Illust) error
- func (ops *DatabaseOperations) InsertIllustTagNearDB(illust *models.Illust) error
- func (ops *DatabaseOperations) InsertIllusts(illusts []models.Illust) error
- func (ops *DatabaseOperations) InsertRank(mode string, date string, content string) (bool, error)
- func (ops *DatabaseOperations) InsertUgoira(ugoira *models.Ugoira) error
- func (ops *DatabaseOperations) InsertUser(user *models.User) error
- func (ops *DatabaseOperations) InsertUserSearch(user *models.User) error
- func (ops *DatabaseOperations) IsIllustExist(illustId uint64) (bool, error)
- func (ops *DatabaseOperations) IsUgoiraExist(ugoiraId uint64) (bool, error)
- func (ops *DatabaseOperations) IsUserExist(userId uint64) (bool, error)
- func (ops *DatabaseOperations) QueryIllust(illustId uint64, resultbanned bool) (*models.Illust, error)
- func (ops *DatabaseOperations) QueryIllustByUser(userId uint64, resultbanned bool) ([]models.Illust, error)
- func (ops *DatabaseOperations) QueryIllustByUserWithPage(userId uint64, page int64, limit int64, resultbanned bool) ([]models.Illust, error)
- func (ops *DatabaseOperations) QueryIllusts(illustIds []uint64, resultbanned bool) ([]models.Illust, error)
- func (ops *DatabaseOperations) QueryIllustsByTags(musttags []string, shouldtags []string, page int64, limit int64, ...) ([]models.Illust, error)
- func (ops *DatabaseOperations) QueryRankIllusts(mode string, date string, content string, page int, limit int) ([]models.RankAggregateResult, error)
- func (ops *DatabaseOperations) QueryUgoira(ugoiraId uint64) (*models.Ugoira, error)
- func (ops *DatabaseOperations) QueryUser(userId uint64, resultbanned bool) (*models.User, error)
- func (ops *DatabaseOperations) QueryUsers(userIds []uint64, resultbanned bool) ([]models.User, error)
- func (ops *DatabaseOperations) RecommendIllustsByIllustId(illustId uint64, k int, drif float64, resultbanned bool) ([]models.Illust, error)
- func (ops *DatabaseOperations) SearchIllust(keyword string, page int, limit int, sortpopularity bool, sortdate bool, ...) ([]models.Illust, int64, []float64, []*string, error)
- func (ops *DatabaseOperations) SearchIllustSuggest(keyword string) ([]string, error)
- func (ops *DatabaseOperations) SearchTagSuggest(keyword string) ([]models.IllustTag, error)
- func (ops *DatabaseOperations) SearchUser(keyword string, page int, limit int, resultbanned bool) ([]models.User, int64, []float64, []*string, error)
- func (ops *DatabaseOperations) SearchUserSuggest(keyword string) ([]string, error)
- func (ops *DatabaseOperations) SetIllustsCount(userId uint64, count uint) error
- func (ops *DatabaseOperations) UpdateUserIllustsTime(userId uint64) error
- type SearchOperations
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DatabaseCollections ¶
type DatabaseCollections struct { Illust *mongo.Collection User *mongo.Collection Rank *mongo.Collection Ugoira *mongo.Collection }
type DatabaseOperations ¶
type DatabaseOperations struct { Ctx context.Context Flt models.Filter Session mongo.Session Cols *DatabaseCollections Sc *SearchOperations }
func NewDatabaseOperations ¶
func NewDatabaseOperations(ctx context.Context, db *drivers.MongoDatabase, filter models.Filter, es *drivers.ElasticSearch, ndb *drivers.NearDB) *DatabaseOperations
func (*DatabaseOperations) AddIllusts ¶
func (ops *DatabaseOperations) AddIllusts(illusts []models.Illust) error
func (*DatabaseOperations) AddRankIllusts ¶
func (ops *DatabaseOperations) AddRankIllusts(mode string, date string, content string, illusts []models.RankIllust) error
func (*DatabaseOperations) ClearUserIllusts ¶
func (ops *DatabaseOperations) ClearUserIllusts(userId uint64) error
func (*DatabaseOperations) DeleteIllust ¶
func (ops *DatabaseOperations) DeleteIllust(illustId uint64) error
func (*DatabaseOperations) DeleteUgoira ¶
func (ops *DatabaseOperations) DeleteUgoira(ugoiraId uint64) error
func (*DatabaseOperations) DeleteUser ¶
func (ops *DatabaseOperations) DeleteUser(userId uint64) error
func (*DatabaseOperations) GetSampleIllusts ¶
func (*DatabaseOperations) GetSampleUsers ¶
func (*DatabaseOperations) InsertIllust ¶
func (ops *DatabaseOperations) InsertIllust(illust *models.Illust) error
func (*DatabaseOperations) InsertIllustSearch ¶
func (ops *DatabaseOperations) InsertIllustSearch(illust *models.Illust) error
func (*DatabaseOperations) InsertIllustTagNearDB ¶
func (ops *DatabaseOperations) InsertIllustTagNearDB(illust *models.Illust) error
func (*DatabaseOperations) InsertIllusts ¶
func (ops *DatabaseOperations) InsertIllusts(illusts []models.Illust) error
func (*DatabaseOperations) InsertRank ¶
func (*DatabaseOperations) InsertUgoira ¶
func (ops *DatabaseOperations) InsertUgoira(ugoira *models.Ugoira) error
func (*DatabaseOperations) InsertUser ¶
func (ops *DatabaseOperations) InsertUser(user *models.User) error
func (*DatabaseOperations) InsertUserSearch ¶
func (ops *DatabaseOperations) InsertUserSearch(user *models.User) error
func (*DatabaseOperations) IsIllustExist ¶
func (ops *DatabaseOperations) IsIllustExist(illustId uint64) (bool, error)
func (*DatabaseOperations) IsUgoiraExist ¶
func (ops *DatabaseOperations) IsUgoiraExist(ugoiraId uint64) (bool, error)
func (*DatabaseOperations) IsUserExist ¶
func (ops *DatabaseOperations) IsUserExist(userId uint64) (bool, error)
func (*DatabaseOperations) QueryIllust ¶
func (*DatabaseOperations) QueryIllustByUser ¶
func (*DatabaseOperations) QueryIllustByUserWithPage ¶
func (*DatabaseOperations) QueryIllusts ¶
func (*DatabaseOperations) QueryIllustsByTags ¶
func (*DatabaseOperations) QueryRankIllusts ¶
func (ops *DatabaseOperations) QueryRankIllusts(mode string, date string, content string, page int, limit int) ([]models.RankAggregateResult, error)
func (*DatabaseOperations) QueryUgoira ¶
func (ops *DatabaseOperations) QueryUgoira(ugoiraId uint64) (*models.Ugoira, error)
func (*DatabaseOperations) QueryUsers ¶
func (*DatabaseOperations) RecommendIllustsByIllustId ¶
func (*DatabaseOperations) SearchIllust ¶
func (*DatabaseOperations) SearchIllustSuggest ¶
func (ops *DatabaseOperations) SearchIllustSuggest(keyword string) ([]string, error)
func (*DatabaseOperations) SearchTagSuggest ¶
func (ops *DatabaseOperations) SearchTagSuggest(keyword string) ([]models.IllustTag, error)
func (*DatabaseOperations) SearchUser ¶
func (*DatabaseOperations) SearchUserSuggest ¶
func (ops *DatabaseOperations) SearchUserSuggest(keyword string) ([]string, error)
func (*DatabaseOperations) SetIllustsCount ¶
func (ops *DatabaseOperations) SetIllustsCount(userId uint64, count uint) error
func (*DatabaseOperations) UpdateUserIllustsTime ¶
func (ops *DatabaseOperations) UpdateUserIllustsTime(userId uint64) error
type SearchOperations ¶
type SearchOperations struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.