Documentation ¶
Index ¶
- type DatabaseCollections
- type DatabaseOperations
- func (ops *DatabaseOperations) AddIllusts(ctx context.Context, illusts []models.Illust) error
- func (ops *DatabaseOperations) AddRankIllusts(ctx context.Context, mode string, date string, content string, ...) error
- func (ops *DatabaseOperations) ClearUserIllusts(ctx context.Context, userId uint64) error
- func (ops *DatabaseOperations) DeleteIllust(ctx context.Context, illustId uint64) error
- func (ops *DatabaseOperations) DeleteUgoira(ctx context.Context, ugoiraId uint64) error
- func (ops *DatabaseOperations) DeleteUser(ctx context.Context, userId uint64) error
- func (ops *DatabaseOperations) GetSampleIllusts(ctx context.Context, quality int, limit int, resultbanned bool) ([]models.Illust, error)
- func (ops *DatabaseOperations) GetSampleUsers(ctx context.Context, limit int, resultbanned bool) ([]models.User, error)
- func (ops *DatabaseOperations) InsertIllust(ctx context.Context, illust *models.Illust) error
- func (ops *DatabaseOperations) InsertIllustSearch(ctx context.Context, illust *models.Illust) error
- func (ops *DatabaseOperations) InsertIllustTagNearDB(ctx context.Context, illust *models.Illust) error
- func (ops *DatabaseOperations) InsertIllusts(ctx context.Context, illusts []models.Illust) error
- func (ops *DatabaseOperations) InsertRank(ctx context.Context, mode string, date string, content string) (bool, error)
- func (ops *DatabaseOperations) InsertUgoira(ctx context.Context, ugoira *models.Ugoira) error
- func (ops *DatabaseOperations) InsertUser(ctx context.Context, user *models.User) error
- func (ops *DatabaseOperations) InsertUserSearch(ctx context.Context, 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(ctx context.Context, illustId uint64, resultbanned bool) (*models.Illust, error)
- func (ops *DatabaseOperations) QueryIllustByUser(ctx context.Context, userId uint64, resultbanned bool) ([]models.Illust, error)
- func (ops *DatabaseOperations) QueryIllustByUserWithPage(ctx context.Context, userId uint64, page int64, limit int64, resultbanned bool) ([]models.Illust, error)
- func (ops *DatabaseOperations) QueryIllusts(ctx context.Context, illustIds []uint64, resultbanned bool) ([]models.Illust, error)
- func (ops *DatabaseOperations) QueryIllustsByTags(ctx context.Context, musttags []string, shouldtags []string, page int64, ...) ([]models.Illust, error)
- func (ops *DatabaseOperations) QueryRankIllusts(ctx context.Context, mode string, date string, content string, page int, ...) ([]models.RankAggregateResult, error)
- func (ops *DatabaseOperations) QueryUgoira(ctx context.Context, ugoiraId uint64) (*models.Ugoira, error)
- func (ops *DatabaseOperations) QueryUser(ctx context.Context, userId uint64, resultbanned bool) (*models.User, error)
- func (ops *DatabaseOperations) QueryUsers(ctx context.Context, userIds []uint64, resultbanned bool) ([]models.User, error)
- func (ops *DatabaseOperations) RecommendIllustsByIllustId(ctx context.Context, illustId uint64, k int, drif float64, resultbanned bool) ([]models.Illust, error)
- func (ops *DatabaseOperations) SearchIllust(ctx context.Context, keyword string, page int, limit int, sortpopularity bool, ...) ([]models.Illust, int64, []float64, []*string, error)
- func (ops *DatabaseOperations) SearchIllustSuggest(ctx context.Context, keyword string) ([]string, error)
- func (ops *DatabaseOperations) SearchTagSuggest(ctx context.Context, keyword string) ([]models.IllustTag, error)
- func (ops *DatabaseOperations) SearchUser(ctx context.Context, keyword string, page int, limit int, resultbanned bool) ([]models.User, int64, []float64, []*string, error)
- func (ops *DatabaseOperations) SearchUserSuggest(ctx context.Context, keyword string) ([]string, error)
- func (ops *DatabaseOperations) SetIllustsCount(ctx context.Context, userId uint64, count uint) error
- func (ops *DatabaseOperations) UpdateUserIllustsTime(ctx context.Context, 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 { Flt models.Filter 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 (*DatabaseOperations) AddRankIllusts ¶
func (ops *DatabaseOperations) AddRankIllusts(ctx context.Context, mode string, date string, content string, illusts []models.RankIllust) error
func (*DatabaseOperations) ClearUserIllusts ¶
func (ops *DatabaseOperations) ClearUserIllusts(ctx context.Context, userId uint64) error
func (*DatabaseOperations) DeleteIllust ¶
func (ops *DatabaseOperations) DeleteIllust(ctx context.Context, illustId uint64) error
func (*DatabaseOperations) DeleteUgoira ¶
func (ops *DatabaseOperations) DeleteUgoira(ctx context.Context, ugoiraId uint64) error
func (*DatabaseOperations) DeleteUser ¶
func (ops *DatabaseOperations) DeleteUser(ctx context.Context, userId uint64) error
func (*DatabaseOperations) GetSampleIllusts ¶
func (*DatabaseOperations) GetSampleUsers ¶
func (*DatabaseOperations) InsertIllust ¶
func (*DatabaseOperations) InsertIllustSearch ¶
func (*DatabaseOperations) InsertIllustTagNearDB ¶
func (*DatabaseOperations) InsertIllusts ¶
func (*DatabaseOperations) InsertRank ¶
func (*DatabaseOperations) InsertUgoira ¶
func (*DatabaseOperations) InsertUser ¶
func (*DatabaseOperations) InsertUserSearch ¶
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 (*DatabaseOperations) QueryUgoira ¶
func (*DatabaseOperations) QueryUsers ¶
func (*DatabaseOperations) RecommendIllustsByIllustId ¶
func (*DatabaseOperations) SearchIllust ¶
func (*DatabaseOperations) SearchIllustSuggest ¶
func (*DatabaseOperations) SearchTagSuggest ¶
func (*DatabaseOperations) SearchUser ¶
func (*DatabaseOperations) SearchUserSuggest ¶
func (*DatabaseOperations) SetIllustsCount ¶
func (*DatabaseOperations) UpdateUserIllustsTime ¶
func (ops *DatabaseOperations) UpdateUserIllustsTime(ctx context.Context, userId uint64) error
type SearchOperations ¶
type SearchOperations struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.