Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHTTPProxyHandler ¶
NewHTTPProxyHandler creates an http.Handler that serves as a TiKV client proxy.
Types ¶
type HandlerWithConfig ¶
func NewHTTPProxyHandlerWithConfig ¶
func NewHTTPProxyHandlerWithConfig() HandlerWithConfig
NewHTTPProxyHandlerWithConfig creates an http.Handler with the config pointer, users can set the config through it.
type RawRequest ¶
type RawRequest struct {
PDAddrs []string `json:"pd_addrs,omitempty"` // for new
Key []byte `json:"key,omitempty"` // for get, put, delete
Keys [][]byte `json:"keys,omitempty"` // for batchGet, batchPut, batchDelete
Value []byte `json:"value,omitempty"` // for put
Values [][]byte `json:"values,omitmepty"` // for batchPut
StartKey []byte `json:"start_key,omitempty"` // for scan, deleteRange
EndKey []byte `json:"end_key,omitempty"` // for scan, deleteRange
Limit int `json:"limit,omitempty"` // for scan
}
RawRequest is the structure of a rawkv request that the http proxy accepts.
type RawResponse ¶
type RawResponse struct {
ID string `json:"id,omitempty"` // for new
Value []byte `json:"value,omitempty"` // for get
Keys [][]byte `json:"keys,omitempty"` // for scan
Values [][]byte `json:"values,omitempty"` // for batchGet
}
RawResponse is the structure of a rawkv response that the http proxy sends.
type TxnRequest ¶
type TxnRequest struct {
PDAddrs []string `json:"pd_addrs,omitempty"` // for new
TS uint64 `json:"ts,omitempty"` // for beginWithTS
Key []byte `json:"key,omitempty"` // for get, set, delete, iter, iterReverse
Value []byte `json:"value,omitempty"` // for set
Keys [][]byte `json:"keys,omitempty"` // for batchGet, lockKeys
UpperBound []byte `json:"upper_bound,omitempty"` // for iter
}
TxnRequest is the structure of a txnkv request that the http proxy accepts.
type TxnResponse ¶
type TxnResponse struct {
ID string `json:"id,omitempty"` // for new, begin, beginWithTS, iter, iterReverse
TS uint64 `json:"ts,omitempty"` // for getTS
Key []byte `json:"key,omitempty"` // for iterKey
Value []byte `json:"value,omitempty"` // for get, iterValue
Keys [][]byte `json:"keys,omitempty"` // for batchGet
Values [][]byte `json:"values,omitempty"` // for batchGet
IsValid bool `json:"is_valid,omitempty"` // for valid, iterValid
IsReadOnly bool `json:"is_readonly,omitempty"` // for isReadOnly
Size int `json:"size,omitempty"` // for size
Length int `json:"length,omitempty"` // for length
}
TxnResponse is the structure of a txnkv response that the http proxy sends.
Click to show internal directories.
Click to hide internal directories.