Documentation ¶
Index ¶
- type TestContext
- func (tc *TestContext) AddCloseFunc(closer func())
- func (tc *TestContext) Close()
- func (tc *TestContext) Context() context.Context
- func (tc *TestContext) GetGRPCPort() int
- func (tc *TestContext) GetHTTPPort() int
- func (tc *TestContext) GetHostname() string
- func (tc *TestContext) MustGRPC() *grpc.ClientConn
- func (tc *TestContext) MustHTTP() (*http.Client, string)
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.