Documentation
¶
Index ¶
- type RedisStorage
- func (s *RedisStorage) GetAll(ctx context.Context) ([]*model.Proxy, error)
- func (s *RedisStorage) GetRandom(ctx context.Context) (*model.Proxy, error)
- func (s *RedisStorage) GetRedisClient() *redis.Client
- func (s *RedisStorage) Remove(ctx context.Context, key string) error
- func (s *RedisStorage) Save(ctx context.Context, proxy *model.Proxy) error
- func (s *RedisStorage) UpdateScore(ctx context.Context, key string, score int) error
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RedisStorage ¶
type RedisStorage struct {
// contains filtered or unexported fields
}
func NewRedisStorage ¶
func NewRedisStorage(addr, password string, db int) *RedisStorage
func (*RedisStorage) GetRedisClient ¶
func (s *RedisStorage) GetRedisClient() *redis.Client
在 RedisStorage 结构体中添加获取客户端的方法
func (*RedisStorage) UpdateScore ¶
Click to show internal directories.
Click to hide internal directories.