testingshim

package
v0.0.0-...-872dfdc Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2016 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitTestServerFactory

func InitTestServerFactory(impl TestServerFactory)

InitTestServerFactory should be called once to provide the implementation of the service. It will be called from a xx_test package that can import the server package.

Types

type TestServerFactory

type TestServerFactory interface {
	// New instantiates a test server instance.
	New(ctx TestServerParams) TestServerInterface
}

TestServerFactory encompasses the actual implementation of the shim service.

type TestServerInterface

type TestServerInterface interface {
	Start() error
	Stop()

	// ServingAddr returns the server's address.
	ServingAddr() string

	// KVClient() returns a *client.DB instance for talking to this KV server,
	// as an interface{}.
	KVClient() interface{}

	// KVDB() returns the *kv.DB instance as an interface{}.
	KVDB() interface{}

	// RPCContext returns the rpc context used by the test server.
	RPCContext() *rpc.Context

	// LeaseManager() returns the *sql.LeaseManager as an interface{}.
	LeaseManager() interface{}

	// Clock returns the clock used by the TestServer.
	Clock() *hlc.Clock
}

TestServerInterface defines test server functionality that tests need; it is implemented by server.TestServer.

func NewTestServer

func NewTestServer(params TestServerParams) TestServerInterface

NewTestServer creates a new test server with the given parameters.

type TestServerParams

type TestServerParams struct {
	// Knobs for the test server.
	Knobs base.TestingKnobs

	// JoinAddr (if nonempty) is the address of a node we are joining.
	JoinAddr string
}

TestServerParams contains the parameters we can set when creating a test server.

Jump to

Keyboard shortcuts

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