Documentation ¶
Overview ¶
Copyright 2017 by GoSpider author. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- type MyRedis
- func (db *MyRedis) Blpop(timeout int, keys ...string) ([]string, error)
- func (db *MyRedis) Brpop(timeout int, keys ...string) ([]string, error)
- func (db *MyRedis) Brpoplpush(source, destination string, timeout int) (string, error)
- func (db *MyRedis) Get(key string) (string, error)
- func (db *MyRedis) Hexists(key, field string) (bool, error)
- func (db *MyRedis) Hget(key, field string) (string, error)
- func (db *MyRedis) Hlen(key string) (int64, error)
- func (db *MyRedis) Hset(key, field, value string) (bool, error)
- func (db *MyRedis) Llen(key string) (int64, error)
- func (db *MyRedis) Lpop(key string) (string, error)
- func (db *MyRedis) Lpush(key string, values ...interface{}) (int64, error)
- func (db *MyRedis) Lpushx(key string, values interface{}) (int64, error)
- func (db *MyRedis) Lrem(key string, count int64, value interface{}) (int64, error)
- func (db *MyRedis) Rpop(key string) (string, error)
- func (db *MyRedis) Rpoplpush(source, destination string) (string, error)
- func (db *MyRedis) Rpush(key string, values ...interface{}) (int64, error)
- func (db *MyRedis) Rpushx(key string, values interface{}) (int64, error)
- func (db *MyRedis) Set(key string, value string, expire time.Duration) error
- type RedisConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MyRedis ¶
type MyRedis struct { Config RedisConfig Client *redis.Client }
func NewRedisPool ¶
func NewRedisPool(config RedisConfig, size int) (*MyRedis, error)
func (*MyRedis) Blpop ¶
if timeout is zero will be block until... and if keys has many will return one such as []string{"pool","b"},pool is list,b is value
func (*MyRedis) Brpoplpush ¶
func (*MyRedis) Lrem ¶
return item rem number if count==0 all rem if count>0 from the list head to rem