Documentation ¶
Index ¶
- type Dao
- func (d *Dao) AddAllRelationCache(c context.Context, m *favmdl.Favorite) (err error)
- func (d *Dao) AddAllRelationsCache(c context.Context, mid, fid int64, fs []*favmdl.Favorite) (err error)
- func (d *Dao) AddRelation(c context.Context, fr *favmdl.Favorite) (rows int64, err error)
- func (d *Dao) AddRelationCache(c context.Context, m *favmdl.Favorite) (err error)
- func (d *Dao) AddRelationOidCache(c context.Context, tp int8, mid, oid int64) (err error)
- func (d *Dao) AddRelationsCache(c context.Context, tp int8, mid, fid int64, fs []*favmdl.Favorite) (err error)
- func (d *Dao) AddUser(c context.Context, u *favmdl.User) (rows int64, err error)
- func (d *Dao) AllRelations(c context.Context, mid, fid int64, mtime xtime.Time, limit int) (fr []*favmdl.Favorite, err error)
- func (d *Dao) BatchUpdateSeq(c context.Context, mid int64, favs []*favmdl.Favorite) (int64, error)
- func (d *Dao) BeginTran(c context.Context) (*sql.Tx, error)
- func (d *Dao) Close() (err error)
- func (d *Dao) DefaultFolderCache(c context.Context, tp int8, mid int64) (folder *favmdl.Folder, err error)
- func (d *Dao) DelAllRelationCache(c context.Context, mid, fid, oid int64, typ int8) (err error)
- func (d *Dao) DelAllRelationsCache(c context.Context, mid, fid int64) (err error)
- func (d *Dao) DelBatchOidsMc(c context.Context, typ int8, mid int64) (err error)
- func (d *Dao) DelNewCoverCache(c context.Context, mid, fid int64) (err error)
- func (d *Dao) DelOldRelationsCache(c context.Context, typ int8, mid, fid int64) (err error)
- func (d *Dao) DelRecentOidsMc(c context.Context, typ int8, mid int64) (err error)
- func (d *Dao) DelRecentResMc(c context.Context, typ int8, mid int64) (err error)
- func (d *Dao) DelRelation(c context.Context, tp int8, mid, fid, oid int64, now xtime.Time) (rows int64, err error)
- func (d *Dao) DelRelationCache(c context.Context, mid, fid, oid int64) (err error)
- func (d *Dao) DelRelationFidsMc(c context.Context, typ int8, mid, oid int64) (err error)
- func (d *Dao) DelRelationOidsCache(c context.Context, typ int8, mid int64) (err error)
- func (d *Dao) DelRelationsByOids(c context.Context, typ int8, mid, fid int64, oids []int64, now xtime.Time) (rows int64, err error)
- func (d *Dao) DelRelationsCache(c context.Context, mid, fid int64) (err error)
- func (d *Dao) DelUser(c context.Context, u *favmdl.User) (rows int64, err error)
- func (d *Dao) ExpireAllRelations(c context.Context, mid, fid int64) (ok bool, err error)
- func (d *Dao) ExpireRelationOids(c context.Context, tp int8, mid int64) (ok bool, err error)
- func (d *Dao) ExpireRelations(c context.Context, mid, fid int64) (ok bool, err error)
- func (d *Dao) Folder(c context.Context, tp int8, mid, fid int64) (f *favmdl.Folder, err error)
- func (d *Dao) FolderCache(c context.Context, tp int8, mid, fid int64) (folder *favmdl.Folder, err error)
- func (d *Dao) FolderMc(c context.Context, typ int8, mid, fid int64) (f *favmdl.Folder, err error)
- func (d *Dao) MaxRelation(c context.Context, mid, fid int64) (m *favmdl.Favorite, err error)
- func (d *Dao) MaxScore(c context.Context, m *favmdl.Favorite) (score int64, err error)
- func (d *Dao) OidsByFid(c context.Context, typ int8, mid, fid int64, offset, limit int) (oids []int64, err error)
- func (d *Dao) Ping(c context.Context) (err error)
- func (d *Dao) RecentRes(c context.Context, mid, fid int64) (res []*favmdl.Resource, err error)
- func (d *Dao) RelaitonFidsMc(c context.Context, typ int8, mid, oid int64) (fids []int64, err error)
- func (d *Dao) Relation(c context.Context, tp int8, mid, fid, oid int64) (m *favmdl.Favorite, err error)
- func (d *Dao) RelationCnt(c context.Context, mid, fid int64) (cnt int, err error)
- func (d *Dao) RelationCntCache(c context.Context, mid, fid int64) (cnt int, err error)
- func (d *Dao) RelationFids(c context.Context, tp int8, mid int64) (rfids map[int64][]int64, err error)
- func (d *Dao) RelationFidsByOid(c context.Context, tp int8, mid, oid int64) (fids []int64, err error)
- func (d *Dao) Relations(c context.Context, typ int8, mid, fid int64, mtime xtime.Time, limit int) (fr []*favmdl.Favorite, err error)
- func (d *Dao) RelationsByOids(c context.Context, typ int8, mid, fid int64, oids []int64) (fr []*favmdl.Favorite, err error)
- func (d *Dao) RemRelationOidCache(c context.Context, tp int8, mid, oid int64) (err error)
- func (d *Dao) SetCleanedCache(c context.Context, typ int8, mid, fid, ftime, expire int64) (err error)
- func (d *Dao) SetFavedBit(c context.Context, tp int8, mid int64) (err error)
- func (d *Dao) SetFoldersMc(c context.Context, vs ...*favmdl.Folder) (err error)
- func (d *Dao) SetOidCountMc(c context.Context, typ int8, oid, count int64) (err error)
- func (d *Dao) SetRelaitonFidsMc(c context.Context, typ int8, mid, oid int64, fids []int64) (err error)
- func (d *Dao) SetRelationOidsCache(c context.Context, tp int8, mid int64, oids []int64) (err error)
- func (d *Dao) SetUnFavedBit(c context.Context, tp int8, mid int64) (err error)
- func (d *Dao) StatCnt(c context.Context, tp int8, oid int64) (cnt int, err error)
- func (d *Dao) TxUpdateFavSequence(tx *xsql.Tx, mid int64, fid, oid int64, typ int8, sequence uint64, ...) (rows int64, err error)
- func (d *Dao) UpFolderCnt(c context.Context, mid, fid int64, cnt int, now xtime.Time) (rows int64, err error)
- func (d *Dao) UpStatCnt(c context.Context, tp int8, oid int64, incr int, now xtime.Time) (rows int64, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dao ¶
type Dao struct {
// contains filtered or unexported fields
}
Dao favorite dao.
func (*Dao) AddAllRelationCache ¶
AddAllRelationCache add a relation to redis.
func (*Dao) AddAllRelationsCache ¶
func (d *Dao) AddAllRelationsCache(c context.Context, mid, fid int64, fs []*favmdl.Favorite) (err error)
AddAllRelationsCache add a relation to redis.
func (*Dao) AddRelation ¶
AddRelation add a favorite relation to mysql.
func (*Dao) AddRelationCache ¶
AddRelationCache add a relation to redis.
func (*Dao) AddRelationOidCache ¶
AddRelationOidCache add favoured oid.
func (*Dao) AddRelationsCache ¶
func (d *Dao) AddRelationsCache(c context.Context, tp int8, mid, fid int64, fs []*favmdl.Favorite) (err error)
AddRelationsCache add a relation to redis.
func (*Dao) AllRelations ¶
func (d *Dao) AllRelations(c context.Context, mid, fid int64, mtime xtime.Time, limit int) (fr []*favmdl.Favorite, err error)
AllRelations get favorite relations from mysql.
func (*Dao) BatchUpdateSeq ¶
func (*Dao) DefaultFolderCache ¶
func (d *Dao) DefaultFolderCache(c context.Context, tp int8, mid int64) (folder *favmdl.Folder, err error)
DefaultFolderCache return default favorite folder from redis.
func (*Dao) DelAllRelationCache ¶
DelAllRelationCache delete one relation cache.
func (*Dao) DelAllRelationsCache ¶
DelAllRelationsCache delete the folder relation cache.
func (*Dao) DelBatchOidsMc ¶
DelBatchOidsMc delete oids mc cache.
func (*Dao) DelNewCoverCache ¶
DelNewCoverCache delete cover picture cache.
func (*Dao) DelOldRelationsCache ¶
DelOldRelationsCache delete the folder relation cache. TODO:del at 2018.06.08
func (*Dao) DelRecentOidsMc ¶
DelRecentOidsMc delete recent oids mc cache.
func (*Dao) DelRecentResMc ¶
DelRecentResMc delete recent oids mc cache.
func (*Dao) DelRelation ¶
func (d *Dao) DelRelation(c context.Context, tp int8, mid, fid, oid int64, now xtime.Time) (rows int64, err error)
DelRelation delete a favorite relation to mysql.
func (*Dao) DelRelationCache ¶
DelRelationCache delete one relation cache.
func (*Dao) DelRelationFidsMc ¶
DelRelationFidsMc delete oid's fid mc cache.
func (*Dao) DelRelationOidsCache ¶
DelRelationOidsCache .
func (*Dao) DelRelationsByOids ¶
func (d *Dao) DelRelationsByOids(c context.Context, typ int8, mid, fid int64, oids []int64, now xtime.Time) (rows int64, err error)
DelRelationsByOids update del state by fid and oids.
func (*Dao) DelRelationsCache ¶
DelRelationsCache delete the folder relation cache.
func (*Dao) ExpireAllRelations ¶
ExpireAllRelations expire folder relations cache.
func (*Dao) ExpireRelationOids ¶
ExpireRelationOids set expire for faved oids.
func (*Dao) ExpireRelations ¶
ExpireRelations expire folder relations cache.
func (*Dao) FolderCache ¶
func (d *Dao) FolderCache(c context.Context, tp int8, mid, fid int64) (folder *favmdl.Folder, err error)
FolderCache return a favorite folder from redis.
func (*Dao) MaxRelation ¶
MaxRelation get a max sequence relation from mysql.
func (*Dao) OidsByFid ¶
func (d *Dao) OidsByFid(c context.Context, typ int8, mid, fid int64, offset, limit int) (oids []int64, err error)
OidsByFid get oids by fid
func (*Dao) RelaitonFidsMc ¶
RelaitonFidsMc return fids from mc.
func (*Dao) Relation ¶
func (d *Dao) Relation(c context.Context, tp int8, mid, fid, oid int64) (m *favmdl.Favorite, err error)
Relation get a relation from mysql.
func (*Dao) RelationCnt ¶
RelationCnt get favoried folders count in relation from mysql.
func (*Dao) RelationCntCache ¶
RelationCntCache return the folder all relation count from redis.
func (*Dao) RelationFids ¶
func (d *Dao) RelationFids(c context.Context, tp int8, mid int64) (rfids map[int64][]int64, err error)
RelationFids get the map [oid -> "fid,fid"] for user.
func (*Dao) RelationFidsByOid ¶
func (d *Dao) RelationFidsByOid(c context.Context, tp int8, mid, oid int64) (fids []int64, err error)
RelationFidsByOid get favortied folders in relations by oid from mysql.
func (*Dao) Relations ¶
func (d *Dao) Relations(c context.Context, typ int8, mid, fid int64, mtime xtime.Time, limit int) (fr []*favmdl.Favorite, err error)
Relations get favorite relations from mysql.
func (*Dao) RelationsByOids ¶
func (*Dao) RemRelationOidCache ¶
RemRelationOidCache del favoured oid.
func (*Dao) SetCleanedCache ¶
func (d *Dao) SetCleanedCache(c context.Context, typ int8, mid, fid, ftime, expire int64) (err error)
SetCleanedCache .
func (*Dao) SetFavedBit ¶
SetFavedBit set unfaved user bit to 0
func (*Dao) SetFoldersMc ¶
SetFoldersMc add folders mc cache.
func (*Dao) SetOidCountMc ¶
SetOidCountMc return oid count from mc.
func (*Dao) SetRelaitonFidsMc ¶
func (d *Dao) SetRelaitonFidsMc(c context.Context, typ int8, mid, oid int64, fids []int64) (err error)
SetRelaitonFidsMc set fids binary data to mc.
func (*Dao) SetRelationOidsCache ¶
SetRelationOidsCache set favoured oids .
func (*Dao) SetUnFavedBit ¶
SetUnFavedBit set unfaved user bit to 1