Documentation
¶
Index ¶
- type Cache
- type RedisCache
- func (r *RedisCache) Delete(ctx context.Context, key string) error
- func (r *RedisCache) Exists(ctx context.Context, key string) (bool, error)
- func (r *RedisCache) Flush(ctx context.Context) error
- func (r *RedisCache) Get(ctx context.Context, key string) (string, error)
- func (r *RedisCache) Ping(ctx context.Context) error
- func (r *RedisCache) Set(ctx context.Context, key string, value interface{}, expiration time.Duration) error
- type SessionCache
- type UserCache
- func (uc *UserCache) GetUser(ctx context.Context, id int64) (*model.User, error)
- func (uc *UserCache) GetUsers(ctx context.Context) ([]model.User, error)
- func (uc *UserCache) GetVerificationCode(ctx context.Context, email string) (string, error)
- func (uc *UserCache) InvalidateUser(ctx context.Context, id int64) error
- func (uc *UserCache) InvalidateUsersList(ctx context.Context) error
- func (uc *UserCache) SaveVerificationCode(ctx context.Context, email string, code string) error
- func (uc *UserCache) SetUser(ctx context.Context, user *model.User) error
- func (uc *UserCache) SetUsers(ctx context.Context, users []model.User) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { Get(ctx context.Context, key string) (string, error) Set(ctx context.Context, key string, value interface{}, expiration time.Duration) error Delete(ctx context.Context, key string) error Exists(ctx context.Context, key string) (bool, error) Flush(ctx context.Context) error Ping(ctx context.Context) error }
type RedisCache ¶
type RedisCache struct {
// contains filtered or unexported fields
}
func NewRedisCache ¶
func NewRedisCache(addr, password string, db int) (*RedisCache, error)
type SessionCache ¶
type SessionCache struct {
// contains filtered or unexported fields
}
func NewSessionCache ¶
func NewSessionCache(cache Cache) *SessionCache
func (*SessionCache) GetSession ¶
func (*SessionCache) InvalidateSession ¶
func (sc *SessionCache) InvalidateSession(ctx context.Context, sessionID string) error
func (*SessionCache) SetSession ¶
type UserCache ¶
type UserCache struct {
// contains filtered or unexported fields
}
func NewUserCache ¶
func (*UserCache) GetVerificationCode ¶
func (*UserCache) InvalidateUser ¶
func (*UserCache) InvalidateUsersList ¶
func (*UserCache) SaveVerificationCode ¶
Click to show internal directories.
Click to hide internal directories.