Documentation ¶
Overview ¶
faketopo contains utitlities for tests that have to interact with a Vitess topology.
Index ¶
Constants ¶
View Source
const ( TestShard = "-80" TestKeyspace = "test_keyspace" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fixture ¶
type Fixture struct { *testing.T Topo topo.Server Wrangler *wrangler.Wrangler // contains filtered or unexported fields }
Fixture is a fixture that provides a fresh topology, to which you can add tablets that react to events and have fake MySQL daemons. It uses an in memory fake ZooKeeper to store its data. When you are done with the fixture you have to call its TearDown method.
func (*Fixture) AddTablet ¶
func (fix *Fixture) AddTablet(uid int, cell string, tabletType topo.TabletType, master *topo.Tablet) *topo.Tablet
AddTablet adds a new tablet to the topology and starts its event loop.
func (*Fixture) GetTablet ¶
func (fix *Fixture) GetTablet(uid int) *topo.TabletInfo
GetTablet returns a fresh copy of the tablet identified by uid.
func (*Fixture) MakeMySQLMaster ¶
MakeMySQLMaster makes the (fake) MySQL used by tablet identified by uid the master.
Click to show internal directories.
Click to hide internal directories.