connect

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BUFFER_FULL_KILL bool = true

вызывать реконнет в случае переполнения буфера

View Source
var NOP_AFTER int = 50

отправлять C_NOP после заданного числа последовательных асинхронных команд

View Source
var QUORUM bool = false

включить кворум для чтения

Functions

func LoadNodeList

func LoadNodeList(filename string) []string

Types

type Conn

type Conn struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewConn

func NewConn(addr string) *Conn

func (*Conn) BitAnd

func (n *Conn) BitAnd(key, subkey []byte, value int64, sync bool) int64

func (*Conn) BitAndNot

func (n *Conn) BitAndNot(key, subkey []byte, value int64, sync bool) int64

func (*Conn) BitOr

func (n *Conn) BitOr(key, subkey []byte, value int64, sync bool) int64

func (*Conn) BitXor

func (n *Conn) BitXor(key, subkey []byte, value int64, sync bool) int64

func (*Conn) Dec

func (n *Conn) Dec(key, subkey []byte, val int64, sync bool) int64

func (*Conn) Del

func (n *Conn) Del(key, subkey []byte, sync bool) bool

func (*Conn) Do

func (n *Conn) Do(command pb.LCPROTO_Code, key, subkey, value []byte) *pb.LCPROTO

func (*Conn) Get

func (n *Conn) Get(key, subkey []byte) []byte

func (*Conn) GetInt

func (n *Conn) GetInt(key, subkey []byte) int64

func (*Conn) HAll

func (n *Conn) HAll(hash []byte) []Pair

func (*Conn) HKeys

func (n *Conn) HKeys(key []byte, limit, offset int64) [][]byte

func (*Conn) HKeysAll

func (n *Conn) HKeysAll(hash []byte) [][]byte

func (*Conn) HKeysRand

func (n *Conn) HKeysRand(key []byte, limit int64) [][]byte

func (*Conn) HKill

func (n *Conn) HKill(key []byte, sync bool)

func (*Conn) HSize

func (n *Conn) HSize(key []byte) int64

func (*Conn) Has

func (n *Conn) Has(key, subkey []byte) bool

func (*Conn) Inc

func (n *Conn) Inc(key, subkey []byte, val int64, sync bool) int64

func (*Conn) KeepAlive

func (n *Conn) KeepAlive() bool

func (*Conn) KeyTotal

func (n *Conn) KeyTotal() int64

func (*Conn) Log

func (n *Conn) Log(key, value []byte, counter int)

func (*Conn) Nop

func (n *Conn) Nop()

func (*Conn) Read

func (n *Conn) Read() *pb.LCPROTO

func (*Conn) Release

func (n *Conn) Release()

func (*Conn) Send

func (n *Conn) Send(command pb.LCPROTO_Code, key, subkey, value []byte)

func (*Conn) SeqAdd

func (n *Conn) SeqAdd(seq []byte, value interface{}, sync bool)

func (*Conn) SeqKill

func (n *Conn) SeqKill(seq []byte, sync bool)

func (*Conn) SeqRange

func (n *Conn) SeqRange(seq []byte, limit, offset int64) [][]byte

func (*Conn) SeqSize

func (n *Conn) SeqSize(seq []byte) int64

func (*Conn) Set

func (n *Conn) Set(key, subkey []byte, value interface{}, sync bool)

func (*Conn) SetIfMore

func (n *Conn) SetIfMore(key, subkey []byte, val int64, sync bool) int64

func (*Conn) SetNX

func (n *Conn) SetNX(key, subkey []byte, val interface{}, sync bool) bool

func (*Conn) ZKill

func (n *Conn) ZKill(key []byte, sync bool)

func (*Conn) ZRange

func (n *Conn) ZRange(key []byte, limit, offset, min, max int64) []ZRec

func (*Conn) ZRangeSize

func (n *Conn) ZRangeSize(key []byte, min, max int64) int64

type MultiProxy

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

func MultiProxyFromFile

func MultiProxyFromFile(filename string) *MultiProxy

func MultiProxyFromMap

func MultiProxyFromMap(conf map[string][]string) *MultiProxy

func (*MultiProxy) Get

func (mp *MultiProxy) Get(name string) *Proxy

type Pair

type Pair struct {
	Key   []byte
	Value []byte
}

type Pool

type Pool struct {
	Addr string

	sync.Mutex
	// contains filtered or unexported fields
}

func NewPool

func NewPool(addr string, limit int) *Pool

func (*Pool) Get

func (p *Pool) Get() (c *Conn)

func (*Pool) Put

func (p *Pool) Put(c *Conn)

type Proxy

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

func NewProxy

func NewProxy(addrs []string) *Proxy

func (*Proxy) BitAnd

func (p *Proxy) BitAnd(key, subkey []byte, value int64, sync bool) int64

func (*Proxy) BitAndNot

func (p *Proxy) BitAndNot(key, subkey []byte, value int64, sync bool) int64

func (*Proxy) BitOr

func (p *Proxy) BitOr(key, subkey []byte, value int64, sync bool) int64

func (*Proxy) BitXor

func (p *Proxy) BitXor(key, subkey []byte, value int64, sync bool) int64

func (*Proxy) Dec

func (p *Proxy) Dec(key, subkey []byte, val int64, sync bool) int64

func (*Proxy) Del

func (p *Proxy) Del(key, subkey []byte, sync bool) bool

func (*Proxy) Get

func (p *Proxy) Get(key, subkey []byte) []byte

func (*Proxy) GetInt

func (p *Proxy) GetInt(key, subkey []byte) int64

func (*Proxy) HAll

func (p *Proxy) HAll(key []byte) []Pair

func (*Proxy) HKeys

func (p *Proxy) HKeys(key []byte, limit, offset int64) [][]byte

func (*Proxy) HKeysAll

func (p *Proxy) HKeysAll(key []byte) [][]byte

func (*Proxy) HKeysRand

func (p *Proxy) HKeysRand(key []byte, limit int64) [][]byte

func (*Proxy) HKill

func (p *Proxy) HKill(key []byte, sync bool)

func (*Proxy) HSize

func (p *Proxy) HSize(key []byte) int64

func (*Proxy) Has

func (p *Proxy) Has(key, subkey []byte) bool

func (*Proxy) Inc

func (p *Proxy) Inc(key, subkey []byte, val int64, sync bool) int64

func (*Proxy) KeyTotal

func (p *Proxy) KeyTotal(n int) int64

func (*Proxy) ProtoDo

func (p *Proxy) ProtoDo(msg *pb.LCPROTO) *pb.LCPROTO

func (*Proxy) ProtoSend

func (p *Proxy) ProtoSend(msg *pb.LCPROTO)

func (*Proxy) SeqAdd

func (p *Proxy) SeqAdd(seq []byte, value interface{}, sync bool)

func (*Proxy) SeqKill

func (p *Proxy) SeqKill(seq []byte, sync bool)

func (*Proxy) SeqRange

func (p *Proxy) SeqRange(seq []byte, limit, offset int64) [][]byte

func (*Proxy) SeqSize

func (p *Proxy) SeqSize(seq []byte) int64

func (*Proxy) Set

func (p *Proxy) Set(key, subkey []byte, value interface{}, sync bool)

func (*Proxy) SetIfMore

func (p *Proxy) SetIfMore(key, subkey []byte, value int64, sync bool) int64

func (*Proxy) SetNX

func (p *Proxy) SetNX(key, subkey []byte, value interface{}, sync bool) bool

func (*Proxy) Status

func (p *Proxy) Status() bool

func (*Proxy) ZKill

func (p *Proxy) ZKill(key []byte, sync bool)

func (*Proxy) ZRange

func (p *Proxy) ZRange(key []byte, limit, offset, min, max int64) []ZRec

func (*Proxy) ZRangeSize

func (p *Proxy) ZRangeSize(key []byte, min, max int64) int64

type ZRec

type ZRec struct {
	Key   []byte
	Value int64
}

Jump to

Keyboard shortcuts

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