Documentation ¶
Overview ¶
Package fakerpcvtgateconn provides a fake implementation of vtgateconn.Impl that doesn't do any RPC, but uses a local map to return results.
Index ¶
- type FakeVTGateConn
- func (conn *FakeVTGateConn) AddQuery(sql string, bindVariables map[string]*querypb.BindVariable, ...)
- func (conn *FakeVTGateConn) Close()
- func (conn *FakeVTGateConn) CloseSession(ctx context.Context, session *vtgatepb.Session) error
- func (conn *FakeVTGateConn) Execute(ctx context.Context, session *vtgatepb.Session, sql string, ...) (*vtgatepb.Session, *sqltypes.Result, error)
- func (conn *FakeVTGateConn) ExecuteBatch(ctx context.Context, session *vtgatepb.Session, sqlList []string, ...) (*vtgatepb.Session, []sqltypes.QueryResponse, error)
- func (conn *FakeVTGateConn) Prepare(ctx context.Context, session *vtgatepb.Session, sql string, ...) (*vtgatepb.Session, []*querypb.Field, error)
- func (conn *FakeVTGateConn) ResolveTransaction(ctx context.Context, dtid string) error
- func (conn *FakeVTGateConn) StreamExecute(ctx context.Context, session *vtgatepb.Session, sql string, ...) (sqltypes.ResultStream, error)
- func (conn *FakeVTGateConn) VStream(ctx context.Context, tabletType topodatapb.TabletType, ...) (vtgateconn.VStreamReader, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeVTGateConn ¶
type FakeVTGateConn struct {
// contains filtered or unexported fields
}
FakeVTGateConn provides a fake implementation of vtgateconn.Impl
func RegisterFakeVTGateConnDialer ¶
func RegisterFakeVTGateConnDialer() (*FakeVTGateConn, string)
RegisterFakeVTGateConnDialer registers the proper dialer for this fake, and returns the underlying instance that will be returned by the dialer, and the protocol to use to get this fake.
func (*FakeVTGateConn) AddQuery ¶
func (conn *FakeVTGateConn) AddQuery( sql string, bindVariables map[string]*querypb.BindVariable, session *vtgatepb.Session, expectedResult *sqltypes.Result)
AddQuery adds a query and expected result.
func (*FakeVTGateConn) Close ¶
func (conn *FakeVTGateConn) Close()
Close please see vtgateconn.Impl.Close
func (*FakeVTGateConn) CloseSession ¶ added in v0.11.0
CloseSession please see vtgateconn.Impl.CloseSession
func (*FakeVTGateConn) Execute ¶
func (conn *FakeVTGateConn) Execute(ctx context.Context, session *vtgatepb.Session, sql string, bindVars map[string]*querypb.BindVariable) (*vtgatepb.Session, *sqltypes.Result, error)
Execute please see vtgateconn.Impl.Execute
func (*FakeVTGateConn) ExecuteBatch ¶
func (conn *FakeVTGateConn) ExecuteBatch(ctx context.Context, session *vtgatepb.Session, sqlList []string, bindVarsList []map[string]*querypb.BindVariable) (*vtgatepb.Session, []sqltypes.QueryResponse, error)
ExecuteBatch please see vtgateconn.Impl.ExecuteBatch
func (*FakeVTGateConn) Prepare ¶ added in v0.11.0
func (conn *FakeVTGateConn) Prepare(ctx context.Context, session *vtgatepb.Session, sql string, bindVars map[string]*querypb.BindVariable) (*vtgatepb.Session, []*querypb.Field, error)
Prepare please see vtgateconn.Impl.Prepare
func (*FakeVTGateConn) ResolveTransaction ¶
func (conn *FakeVTGateConn) ResolveTransaction(ctx context.Context, dtid string) error
ResolveTransaction please see vtgateconn.Impl.ResolveTransaction
func (*FakeVTGateConn) StreamExecute ¶
func (conn *FakeVTGateConn) StreamExecute(ctx context.Context, session *vtgatepb.Session, sql string, bindVars map[string]*querypb.BindVariable) (sqltypes.ResultStream, error)
StreamExecute please see vtgateconn.Impl.StreamExecute
func (*FakeVTGateConn) VStream ¶
func (conn *FakeVTGateConn) VStream(ctx context.Context, tabletType topodatapb.TabletType, vgtid *binlogdatapb.VGtid, filter *binlogdatapb.Filter, flags *vtgatepb.VStreamFlags) (vtgateconn.VStreamReader, error)
VStream streams binlog events.