Documentation
¶
Index ¶
- Variables
- type APICache
- type Cache
- type DoubleCache
- type LocalCache
- type NoteCache
- type RankingCache
- type RankingLocalCache
- type RankingRedisCache
- type RedisAPICache
- type RedisCache
- type RedisNoteCache
- func (r *RedisNoteCache) DelFirstPage(ctx context.Context, author int64) error
- func (r *RedisNoteCache) DelPub(ctx context.Context, id int64) error
- func (r *RedisNoteCache) Get(ctx context.Context, id int64) (domain.Note, error)
- func (r *RedisNoteCache) GetFirstPage(ctx context.Context, author int64) ([]domain.Note, error)
- func (r *RedisNoteCache) GetPub(ctx context.Context, id int64) (domain.Note, error)
- func (r *RedisNoteCache) Set(ctx context.Context, note domain.Note) error
- func (r *RedisNoteCache) SetFirstPage(ctx context.Context, author int64, notes []domain.Note) error
- func (r *RedisNoteCache) SetPub(ctx context.Context, note domain.Note) error
- type RedisTaskCache
- type RedisUserCache
- type TaskCache
- type UserCache
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrKeyNotExist = redisv9.Nil
Functions ¶
This section is empty.
Types ¶
type APICache ¶
type APICache interface { Set(ctx context.Context, api domain.API) error Get(ctx context.Context, id int64) (domain.API, error) Delete(ctx context.Context, id int64) error }
func NewAPICache ¶
type DoubleCache ¶
type DoubleCache struct { }
type LocalCache ¶
type LocalCache struct { }
type NoteCache ¶
type NoteCache interface { GetFirstPage(ctx context.Context, author int64) ([]domain.Note, error) SetFirstPage(ctx context.Context, author int64, notes []domain.Note) error DelFirstPage(ctx context.Context, author int64) error Set(ctx context.Context, note domain.Note) error Get(ctx context.Context, id int64) (domain.Note, error) // SetPub 正常来说,创作者和读者的 Redis 集群要分开,因为读者是一个核心中的核心 SetPub(ctx context.Context, note domain.Note) error DelPub(ctx context.Context, id int64) error GetPub(ctx context.Context, id int64) (domain.Note, error) }
func NewRedisNoteCache ¶
type RankingCache ¶
type RankingLocalCache ¶
type RankingLocalCache struct {
// contains filtered or unexported fields
}
func NewRankingLocalCache ¶
func NewRankingLocalCache() *RankingLocalCache
func (RankingLocalCache) Preload ¶
func (r RankingLocalCache) Preload(ctx context.Context)
type RankingRedisCache ¶
type RankingRedisCache struct {
// contains filtered or unexported fields
}
func NewRankingRedisCache ¶
func NewRankingRedisCache(client redisv9.Cmdable) *RankingRedisCache
type RedisAPICache ¶
type RedisAPICache struct {
// contains filtered or unexported fields
}
func (*RedisAPICache) Delete ¶
func (cache *RedisAPICache) Delete(ctx context.Context, id int64) error
type RedisCache ¶
type RedisCache struct { }
type RedisNoteCache ¶
type RedisNoteCache struct {
// contains filtered or unexported fields
}
func (*RedisNoteCache) DelFirstPage ¶
func (r *RedisNoteCache) DelFirstPage(ctx context.Context, author int64) error
func (*RedisNoteCache) DelPub ¶
func (r *RedisNoteCache) DelPub(ctx context.Context, id int64) error
func (*RedisNoteCache) GetFirstPage ¶
func (*RedisNoteCache) SetFirstPage ¶
type RedisTaskCache ¶
type RedisTaskCache struct {
// contains filtered or unexported fields
}
func (*RedisTaskCache) Delete ¶
func (cache *RedisTaskCache) Delete(ctx context.Context, id int64) error
type RedisUserCache ¶
type RedisUserCache struct {
// contains filtered or unexported fields
}
func (*RedisUserCache) Delete ¶
func (cache *RedisUserCache) Delete(ctx context.Context, id int64) error
Click to show internal directories.
Click to hide internal directories.