myredis

package
v0.0.0-...-43f4138 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

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

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 NewRedis

func NewRedis(config RedisConfig) (*MyRedis, error)

return myredis

func NewRedisPool

func NewRedisPool(config RedisConfig, size int) (*MyRedis, error)

func (*MyRedis) Blpop

func (db *MyRedis) Blpop(timeout int, keys ...string) ([]string, error)

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) Brpop

func (db *MyRedis) Brpop(timeout int, keys ...string) ([]string, error)

func (*MyRedis) Brpoplpush

func (db *MyRedis) Brpoplpush(source, destination string, timeout int) (string, error)

func (*MyRedis) Get

func (db *MyRedis) Get(key string) (string, error)

get key

func (*MyRedis) Hexists

func (db *MyRedis) Hexists(key, field string) (bool, error)

func (*MyRedis) Hget

func (db *MyRedis) Hget(key, field string) (string, error)

func (*MyRedis) Hlen

func (db *MyRedis) Hlen(key string) (int64, error)

func (*MyRedis) Hset

func (db *MyRedis) Hset(key, field, value string) (bool, error)

func (*MyRedis) Llen

func (db *MyRedis) Llen(key string) (int64, error)

func (*MyRedis) Lpop

func (db *MyRedis) Lpop(key string) (string, error)

func (*MyRedis) Lpush

func (db *MyRedis) Lpush(key string, values ...interface{}) (int64, error)

func (*MyRedis) Lpushx

func (db *MyRedis) Lpushx(key string, values interface{}) (int64, error)

func (*MyRedis) Lrem

func (db *MyRedis) Lrem(key string, count int64, value interface{}) (int64, error)

return item rem number if count==0 all rem if count>0 from the list head to rem

func (*MyRedis) Rpop

func (db *MyRedis) Rpop(key string) (string, error)

func (*MyRedis) Rpoplpush

func (db *MyRedis) Rpoplpush(source, destination string) (string, error)

func (*MyRedis) Rpush

func (db *MyRedis) Rpush(key string, values ...interface{}) (int64, error)

func (*MyRedis) Rpushx

func (db *MyRedis) Rpushx(key string, values interface{}) (int64, error)

func (*MyRedis) Set

func (db *MyRedis) Set(key string, value string, expire time.Duration) error

set key

type RedisConfig

type RedisConfig struct {
	Host     string
	Password string
	DB       int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL