client

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MaxRawKVScanLimit = 10240

Functions

func InitTiKVClient

func InitTiKVClient(pdAddrs []string, clientMode string) error

Types

type Client

type Client interface {
	GetClientMode() TiKV_MODE
	GetClusterID() string
	GetStores() ([]StoreInfo, error)
	GetPDs() ([]PDInfo, error)
	GetPDClient() pd.Client

	Put(ctx context.Context, kv KV) error
	BatchPut(ctx context.Context, kv []KV) error

	Get(ctx context.Context, k Key) (KV, error)
	Scan(ctx context.Context, prefix []byte) (KVS, int, error)

	Delete(ctx context.Context, k Key) error
	BatchDelete(ctx context.Context, kvs []KV) error
	DeletePrefix(ctx context.Context, prefix Key, limit int) (Key, int, error)
}

func GetTiKVClient

func GetTiKVClient() Client

type KV

type KV struct {
	K Key
	V Value
}

type KVS

type KVS []KV

func (KVS) Print

func (kvs KVS) Print()

type Key

type Key []byte

type PDInfo

type PDInfo struct {
	Name       string
	ClientURLs []string
}

func (PDInfo) Flatten

func (p PDInfo) Flatten() []string

func (PDInfo) String

func (p PDInfo) String() string

func (PDInfo) TableTitle

func (p PDInfo) TableTitle() []string

type StoreInfo

type StoreInfo struct {
	ID            string
	Version       string
	Addr          string
	State         string
	StatusAddress string
	Labels        string
}

func (StoreInfo) Flatten

func (s StoreInfo) Flatten() []string

func (StoreInfo) String

func (s StoreInfo) String() string

func (StoreInfo) TableTitle

func (StoreInfo) TableTitle() []string

type TiKV_MODE

type TiKV_MODE int
const (
	RAW_CLIENT TiKV_MODE = 0
	TXN_CLIENT TiKV_MODE = 1
)

func (TiKV_MODE) String

func (mode TiKV_MODE) String() string

type Value

type Value []byte

Jump to

Keyboard shortcuts

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