vttest

package
v2.0.0-rc.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2016 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Overview

Package vttest provides the functionality to bring up a test cluster.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handle

type Handle struct {
	Data map[string]interface{}
	// contains filtered or unexported fields
}

Handle allows you to interact with the processes launched by vttest.

func LaunchVitess

func LaunchVitess(
	options ...VitessOption,
) (hdl *Handle, err error)

LaunchVitess launches a vitess test cluster.

func (*Handle) MySQLConnParams

func (hdl *Handle) MySQLConnParams() (sqldb.ConnParams, error)

MySQLConnParams builds the MySQL connection params. It's valid only if you used MySQLOnly option.

func (*Handle) TearDown

func (hdl *Handle) TearDown() error

TearDown tears down the launched processes.

type InitDataOptions

type InitDataOptions struct {
	// contains filtered or unexported fields
}

InitDataOptions contain the command line arguments that configure initialization of vttest with random data. See the documentation of the corresponding command line flags in py/vttest/run_local_database.py for the meaning of each field. If a field is nil, the flag will not be specified when running 'run_local_database.py' and the default value for the flag will be used.

type VitessOption

type VitessOption struct {
	// contains filtered or unexported fields
}

VitessOption is the type for generic options to be passed in to LaunchVitess.

func InitData

func InitData(i *InitDataOptions) VitessOption

InitData returns a VitessOption that sets the InitDataOptions parameters.

func MySQLOnly

func MySQLOnly(dbName string) VitessOption

MySQLOnly is used to launch only a mysqld instance, with the specified db name. Use it before Schema option. It cannot be used at the same as ProtoTopo.

func ProtoTopo

func ProtoTopo(topo *vttestpb.VTTestTopology) VitessOption

ProtoTopo is used to pass in the topology as a vttest proto definition. See vttest.proto for more information. It cannot be used at the same time as MySQLOnly.

func Schema

func Schema(schema string) VitessOption

Schema is used to specify SQL commands to run at startup. It conflicts with SchemaDirectory

func SchemaDirectory

func SchemaDirectory(dir string) VitessOption

SchemaDirectory is used to specify a directory to read schema from. It cannot be used at the same time as Schema.

func Verbose

func Verbose(verbose bool) VitessOption

Verbose makes the underlying local_cluster verbose.

Directories

Path Synopsis
Package fakesqldb provides a fake implementation of sqldb.Conn
Package fakesqldb provides a fake implementation of sqldb.Conn

Jump to

Keyboard shortcuts

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