Documentation
¶
Index ¶
- Constants
- type AccountState
- type BankState
- type Client
- func (c *Client) DumpState(ctx context.Context) (interface{}, error)
- func (c *Client) Invoke(ctx context.Context, node cluster.ClientNode, r interface{}) core.UnknownResponse
- func (c *Client) NextRequest() interface{}
- func (c *Client) SetUp(ctx context.Context, _ []cluster.Node, clientNodes []cluster.ClientNode, ...) error
- func (c *Client) Start(ctx context.Context, cfg interface{}, clientNodes []cluster.ClientNode) error
- func (c *Client) TearDown(ctx context.Context, nodes []cluster.ClientNode, idx int) error
- type ClientCreator
- type Config
- type CreateResult
- type DeleteResult
- type Model
- type Parser
- type Response
- type TransferResult
- type VBReqType
Constants ¶
const ( PKTypeInt = "int" PKTypeDecimal = "decimal" PKTypeString = "string" )
primary key types
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BankState ¶
type BankState struct {
Accounts []AccountState
}
BankState is the state of the test case.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements the core.Client interface.
func (*Client) Invoke ¶
func (c *Client) Invoke(ctx context.Context, node cluster.ClientNode, r interface{}) core.UnknownResponse
Invoke implements the core.Client interface.
func (*Client) NextRequest ¶
func (c *Client) NextRequest() interface{}
NextRequest implements the core.Client interface.
func (*Client) SetUp ¶
func (c *Client) SetUp(ctx context.Context, _ []cluster.Node, clientNodes []cluster.ClientNode, idx int) error
SetUp implements the core.Client interface.
type ClientCreator ¶
type ClientCreator struct {
// contains filtered or unexported fields
}
ClientCreator creates a test client.
func NewClientCreator ¶
func NewClientCreator(cfg *Config) *ClientCreator
NewClientCreator creates a new ClientCreator.
func (*ClientCreator) Create ¶
func (cc *ClientCreator) Create(node cluster.ClientNode) core.Client
Create creates a Client.
type Config ¶
type Config struct {
// PKType
PKType string
// When Partition is set to true, we use multiple partition for multiple account instead of multiple table.
Partition bool
// When Range is set to true, we use range condition instead of equal condition which
// leads to coprocessor request instead of point get request.
Range bool
// When ReadCommitted is set to true, we use read-committed isolation level for pessimistic transaction.
ReadCommitted bool
// When UpdateInPlace is set to true, we update with `set balance = balance - @amount`, otherwise we select for update first,
// Then update by `set balance = @new_balance`.
UpdateInPlace bool
}
Config is the config of the test case.
type CreateResult ¶
CreateResult ...
func (*CreateResult) String ¶
func (cr *CreateResult) String() string
type DeleteResult ¶
DeleteResult ...
func (*DeleteResult) String ¶
func (dr *DeleteResult) String() string
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model implements the core.Model interface.
type Parser ¶
type Parser struct{}
Parser implements the core.Parser interface.
func (Parser) OnNoopResponse ¶
func (p Parser) OnNoopResponse() interface{}
OnNoopResponse implements the core.Parser interface.
func (Parser) OnRequest ¶
func (p Parser) OnRequest(data json.RawMessage) (interface{}, error)
OnRequest implements the core.Parser interface.
func (Parser) OnResponse ¶
func (p Parser) OnResponse(data json.RawMessage) (interface{}, error)
OnResponse implements the core.Parser interface.
type Response ¶
type Response struct {
ReqType VBReqType
TS uint64
ReadResult *BankState
CreateResult *CreateResult
DeleteResult *DeleteResult
TransferResult *TransferResult
OK bool
Err string
}
Response ...