redis

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Password       = "nlpteams"
	ConnectTimeout = "100ms"
	MaxIdle        = 10
	IdleTimeout    = "1m"

	DefaultReidsConf = ManagerConfig{
		Manager: []RedisConfig{
			{
				Name:    "graph",
				Network: "tcp",
				Host:    "nlp-catch.codis.yzpsg2.in.autohome.com.cn:19383",
				DialConfig: &DialConfig{
					Password:       &Password,
					ConnectTimeout: &ConnectTimeout,
					ReadTimeout:    &timeout,
					WriteTimeout:   &timeout,
				},
				PoolConfig: &PoolConfig{
					MaxIdle:     &MaxIdle,
					IdleTimeout: &IdleTimeout,
				},
			},
		},
	}
)
View Source
var Bool = _redis.Bool
View Source
var ByteSlices = _redis.ByteSlices
View Source
var Bytes = _redis.Bytes
View Source
var DialConnectTimeout = _redis.DialConnectTimeout
View Source
var DialDatabase = _redis.DialDatabase
View Source
var DialKeepAlive = _redis.DialKeepAlive
View Source
var DialNetDial = _redis.DialNetDial
View Source
var DialPassword = _redis.DialPassword
View Source
var DialReadTimeout = _redis.DialReadTimeout
View Source
var DialTLSConfig = _redis.DialTLSConfig
View Source
var DialTLSSkipVerify = _redis.DialTLSSkipVerify
View Source
var DialUseTLS = _redis.DialUseTLS
View Source
var DialWriteTimeout = _redis.DialWriteTimeout
View Source
var DoWithTimeout = _redis.DoWithTimeout
View Source
var Float64 = _redis.Float64
View Source
var Float64s = _redis.Float64s
View Source
var Int = _redis.Int
View Source
var Int64 = _redis.Int64
View Source
var Int64Map = _redis.Int64Map
View Source
var Int64s = _redis.Int64s
View Source
var IntMap = _redis.IntMap
View Source
var Ints = _redis.Ints
View Source
var MultiBulk = _redis.MultiBulk
View Source
var Positions = _redis.Positions
View Source
var ReceiveWithTimeout = _redis.ReceiveWithTimeout
View Source
var Scan = _redis.Scan
View Source
var ScanSlice = _redis.ScanSlice
View Source
var ScanStruct = _redis.ScanStruct
View Source
var String = _redis.String
View Source
var StringMap = _redis.StringMap
View Source
var Strings = _redis.Strings
View Source
var Uint64 = _redis.Uint64
View Source
var Values = _redis.Values

Functions

func RemovePool

func RemovePool(name string)

Types

type Args

type Args = _redis.Args

type Argument

type Argument = _redis.Argument

type Conn

type Conn = _redis.Conn

type ConnWithTimeout

type ConnWithTimeout = _redis.ConnWithTimeout

type DialConfig

type DialConfig struct {
	ConnectTimeout *string `yaml:"connect_timeout" toml:"connect_timeout"`
	Database       *int    `yaml:"database" toml:"database"`
	KeepAlive      *string `yaml:"keep_alive" toml:"keep_alive"`
	Password       *string `yaml:"password" toml:"password"`
	ReadTimeout    *string `yaml:"read_timeout" toml:"read_timeout"`
	//TLSConfig
	TLSSkipVerify *bool   `yaml:"tls_skip_verify" toml:"tls_skip_verify"`
	UseTLS        *bool   `yaml:"use_tls" toml:"use_tls"`
	WriteTimeout  *string `yaml:"write_timeout" toml:"write_timeout"`
}

func (*DialConfig) DialOptions

func (h *DialConfig) DialOptions() []DialOption

type DialOption

type DialOption = _redis.DialOption

export

type ManagerConfig

type ManagerConfig struct {
	Manager []RedisConfig `yaml:"manager" toml:"manager"`
}

type Message

type Message = _redis.Message

type Pong

type Pong = _redis.Pong

type Pool

type Pool struct {
	_redis.Pool
}

func CreatePool

func CreatePool(name string, network, host string, poolOptions []PoolOption, dialOptions []DialOption) (*Pool, error)

func GetPool

func GetPool(name string) (*Pool, bool)

func GetPoolByAddr

func GetPoolByAddr(addr string) (*Pool, bool)

func (*Pool) Do

func (h *Pool) Do(commandName string, args ...interface{}) *Result

func (*Pool) DoWithRetry

func (h *Pool) DoWithRetry(tryTimes int, timeout time.Duration, commandName string, args ...interface{}) *Result

func (*Pool) DoWithTimeout

func (h *Pool) DoWithTimeout(timeout time.Duration, commandName string, args ...interface{}) *Result

type PoolConfig

type PoolConfig struct {
	MaxIdle         *int    `yaml:"max_idle" toml:"max_idle"`
	MaxActive       *int    `yaml:"max_active" toml:"max_active"`
	IdleTimeout     *string `yaml:"idle_timeout" toml:"idle_timeout"`
	Wait            *bool   `yaml:"wait" toml:"wait"`
	MaxConnLifetime *string `yaml:"max_conn_lifetime" toml:"max_conn_lifetime"`
}

func (*PoolConfig) PoolOptions

func (h *PoolConfig) PoolOptions() []PoolOption

type PoolOption

type PoolOption struct {
	// contains filtered or unexported fields
}

func PoolIdleTimeout

func PoolIdleTimeout(v time.Duration) PoolOption

func PoolMaxActive

func PoolMaxActive(v int) PoolOption

func PoolMaxConnLifetime

func PoolMaxConnLifetime(v time.Duration) PoolOption

func PoolMaxIdle

func PoolMaxIdle(v int) PoolOption

func PoolWait

func PoolWait(v bool) PoolOption

type PoolStats

type PoolStats = _redis.PoolStats

type PubSubConn

type PubSubConn = _redis.PubSubConn

type RedisConfig

type RedisConfig struct {
	Name    string `yaml:"name" toml:"name"`
	Host    string `yaml:"host" toml:"host"`
	Network string `yaml:"network" toml:"network"`

	PoolConfig *PoolConfig `yaml:"pool" toml:"pool"`
	DialConfig *DialConfig `yaml:"dial" toml:"dial"`
}

type Result

type Result struct {
	// contains filtered or unexported fields
}

func (*Result) Bool

func (h *Result) Bool() (bool, error)

func (*Result) ByteSlices

func (h *Result) ByteSlices() ([][]byte, error)

func (*Result) Bytes

func (h *Result) Bytes() ([]byte, error)

func (*Result) Error

func (h *Result) Error() error

func (*Result) Float64

func (h *Result) Float64() (float64, error)

func (*Result) Float64s

func (h *Result) Float64s() ([]float64, error)

func (*Result) Int

func (h *Result) Int() (int, error)

func (*Result) Int64

func (h *Result) Int64() (int64, error)

func (*Result) Int64Map

func (h *Result) Int64Map() (map[string]int64, error)

func (*Result) Int64s

func (h *Result) Int64s() ([]int64, error)

func (*Result) IntMap

func (h *Result) IntMap() (map[string]int, error)

func (*Result) Interface

func (h *Result) Interface() (interface{}, error)

func (*Result) Ints

func (h *Result) Ints() ([]int, error)

func (*Result) IsNil

func (h *Result) IsNil() bool

func (*Result) MultiBulk

func (h *Result) MultiBulk() ([]interface{}, error)

func (*Result) Positions

func (h *Result) Positions() ([]*[2]float64, error)

func (*Result) Reply

func (h *Result) Reply() interface{}

func (*Result) String

func (h *Result) String() (string, error)

func (*Result) StringMap

func (h *Result) StringMap() (map[string]string, error)

func (*Result) Strings

func (h *Result) Strings() ([]string, error)

func (*Result) Uint64

func (h *Result) Uint64() (uint64, error)

func (*Result) Values

func (h *Result) Values() ([]interface{}, error)

type Scanner

type Scanner = _redis.Scanner

type Script

type Script = _redis.Script

type Subscription

type Subscription = _redis.Subscription

Jump to

Keyboard shortcuts

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