handler

package
v0.0.0-...-a5c5f28 Latest Latest
Warning

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

Go to latest
Published: May 22, 2019 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxRetryCount int = 5
	//max key size
	MaxKeySize int = 1024 * 3
	//max value size
	MaxValueSize int = 1024 * 1024 * 5
)

Variables

View Source
var (
	ErrBegionTXN = errors.New("begin transaction error")
	ErrKeySize   = errors.New("invalid key size")
	ErrValueSize = errors.New("invalid value size")
	ErrValueNil  = errors.New("value is null")
	ErrAuthPwd   = errors.New("Invalid passwd")
)

Functions

func CallWithRetry

func CallWithRetry(context *RequestContext, fn func() (interface{}, error)) (interface{}, error)

func CheckKeySize

func CheckKeySize(key []byte) error

func CheckValueSize

func CheckValueSize(value []byte) error

Types

type RequestContext

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

type TxTikvHandler

type TxTikvHandler struct {
	Store     kv.Storage
	NameSpace []byte
	IgnoreTTL bool
}

func (*TxTikvHandler) AUTH

func (h *TxTikvHandler) AUTH(pwd string) error

func (*TxTikvHandler) CheckExpireAndDel

func (h *TxTikvHandler) CheckExpireAndDel(keys [][]byte) (bool, error)

func (*TxTikvHandler) DEL

func (h *TxTikvHandler) DEL(keys [][]byte) (int, error)

func (*TxTikvHandler) EXPIRE

func (h *TxTikvHandler) EXPIRE(key []byte, btime []byte) (int, error)

func (*TxTikvHandler) EXPIREAT

func (h *TxTikvHandler) EXPIREAT(key []byte, btime []byte) (int, error)

func (*TxTikvHandler) GET

func (h *TxTikvHandler) GET(key []byte) ([]byte, error)

func (*TxTikvHandler) HDEL

func (h *TxTikvHandler) HDEL(key []byte, args [][]byte) (int, error)

func (*TxTikvHandler) HGET

func (h *TxTikvHandler) HGET(key []byte, field []byte) ([]byte, error)

func (*TxTikvHandler) HGETALL

func (h *TxTikvHandler) HGETALL(key []byte) ([][]byte, error)

func (*TxTikvHandler) HINCRBY

func (h *TxTikvHandler) HINCRBY(key []byte, field []byte, step int) (int64, error)

func (*TxTikvHandler) HKEYS

func (h *TxTikvHandler) HKEYS(key []byte) ([][]byte, error)

func (*TxTikvHandler) HLEN

func (h *TxTikvHandler) HLEN(key []byte) (int, error)

func (*TxTikvHandler) HMGET

func (h *TxTikvHandler) HMGET(key []byte, fields [][]byte) ([][]byte, error)

func (*TxTikvHandler) HMSET

func (h *TxTikvHandler) HMSET(args [][]byte) ([]byte, error)

func (*TxTikvHandler) HSET

func (h *TxTikvHandler) HSET(key []byte, field []byte, value []byte) (int, error)

func (*TxTikvHandler) INCR

func (h *TxTikvHandler) INCR(key []byte) (int64, error)

func (*TxTikvHandler) INCRBY

func (h *TxTikvHandler) INCRBY(key []byte, step int) (int64, error)

func (*TxTikvHandler) INFO

func (h *TxTikvHandler) INFO() ([]byte, error)

func (*TxTikvHandler) MGET

func (h *TxTikvHandler) MGET(args [][]byte) ([][]byte, error)

func (*TxTikvHandler) MSET

func (h *TxTikvHandler) MSET(args [][]byte) ([]byte, error)

func (*TxTikvHandler) NOAUTH

func (h *TxTikvHandler) NOAUTH() error

func (*TxTikvHandler) PING

func (h *TxTikvHandler) PING() ([]byte, error)

func (*TxTikvHandler) QUIT

func (h *TxTikvHandler) QUIT() ([]byte, error)

func (*TxTikvHandler) SET

func (h *TxTikvHandler) SET(key []byte, value []byte) ([]byte, error)

func (*TxTikvHandler) SETWITHTTL

func (h *TxTikvHandler) SETWITHTTL(key []byte, value []byte, ttl []byte) ([]byte, error)

func (*TxTikvHandler) TTL

func (h *TxTikvHandler) TTL(key []byte) (int, error)

type TxTikvInterface

type TxTikvInterface interface {
	DEL(keys [][]byte) (int, error)
}

Jump to

Keyboard shortcuts

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