testing

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestContext

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

TestContext provides methods to interact with the Open Match server.

func MustServe

func MustServe(t *testing.T, binder func(*rpc.ServerParams)) *TestContext

MustServe creates a test server and returns TestContext that can be used to create clients. This method pseudorandomly selects insecure and TLS mode to ensure both paths work.

func MustServeInsecure

func MustServeInsecure(t *testing.T, binder func(*rpc.ServerParams)) *TestContext

MustServeInsecure creates a test server without transport encryption and returns TestContext that can be used to create clients.

func MustServeTLS

func MustServeTLS(t *testing.T, binder func(*rpc.ServerParams)) *TestContext

MustServeTLS creates a test server with TLS and returns TestContext that can be used to create clients.

func (*TestContext) AddCloseFunc

func (tc *TestContext) AddCloseFunc(closer func())

AddCloseFunc adds a close function.

func (*TestContext) Close

func (tc *TestContext) Close()

Close shutsdown the server and frees the TCP port.

func (*TestContext) Context

func (tc *TestContext) Context() context.Context

Context returns a context appropriate for calling an RPC.

func (*TestContext) GetGRPCPort

func (tc *TestContext) GetGRPCPort() int

GetGRPCPort returns the grpc service port of current text context

func (*TestContext) GetHTTPPort

func (tc *TestContext) GetHTTPPort() int

GetHTTPPort returns the http proxy port of current text context

func (*TestContext) GetHostname

func (tc *TestContext) GetHostname() string

GetHostname returns the hostname of current text context

func (*TestContext) MustGRPC

func (tc *TestContext) MustGRPC() *grpc.ClientConn

MustGRPC returns a grpc client configured to connect to an endpoint.

func (*TestContext) MustHTTP

func (tc *TestContext) MustHTTP() (*http.Client, string)

MustHTTP returns a HTTP(S) client configured to connect to an endpoint.

Jump to

Keyboard shortcuts

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