transporttest

package
v1.28.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTTLDelta = 100 * time.Millisecond

DefaultTTLDelta is the default TTLDelta used by RequestMatchers.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextMatcher

type ContextMatcher struct {
	TTLDelta time.Duration
	// contains filtered or unexported fields
}

ContextMatcher is a Matcher for verifying that a context's deadline is within expected bounds: the current time, plus a TTL, plus or minus some tolerance.

func NewContextMatcher

func NewContextMatcher(t *testing.T, options ...ContextMatcherOption) *ContextMatcher

NewContextMatcher creates a ContextMatcher to verify properties about a Context.

func (*ContextMatcher) Matches

func (c *ContextMatcher) Matches(got interface{}) bool

Matches a context against an expected context, returning true only if the given object is a context with a deadline that is now, plus the expected TTL, plus or minus some tolerance.

func (*ContextMatcher) String

func (c *ContextMatcher) String() string

type ContextMatcherOption

type ContextMatcherOption interface {
	// contains filtered or unexported methods
}

ContextMatcherOption customizes the behavior of a ContextMatcher.

type ContextTTL

type ContextTTL time.Duration

ContextTTL requires that a Context have the given TTL on it, with a tolerance of TTLDelta.

type EchoHandler added in v1.5.0

type EchoHandler struct{}

EchoHandler is a unary handler that echoes the request body on the response body for any inbound request.

func (EchoHandler) Handle added in v1.5.0

Handle handles an inbound request by copying the request body to the response body.

type EchoRouter added in v1.5.0

type EchoRouter struct{}

EchoRouter is a router that echoes all unary inbound requests, with no explicit procedures.

func (EchoRouter) Choose added in v1.5.0

Choose always returns a unary echo handler.

func (EchoRouter) Procedures added in v1.5.0

func (EchoRouter) Procedures() []transport.Procedure

Procedures returns no explicitly supported procedures.

type FakeResponseWriter

type FakeResponseWriter struct {
	IsApplicationError bool
	Headers            transport.Headers
	Body               bytes.Buffer
}

FakeResponseWriter is a ResponseWriter that records the headers and the body written to it.

func (*FakeResponseWriter) AddHeaders

func (fw *FakeResponseWriter) AddHeaders(h transport.Headers)

AddHeaders for FakeResponseWriter.

func (*FakeResponseWriter) SetApplicationError

func (fw *FakeResponseWriter) SetApplicationError()

SetApplicationError for FakeResponseWriter.

func (*FakeResponseWriter) Write

func (fw *FakeResponseWriter) Write(s []byte) (int, error)

Write for FakeResponseWriter.

type MockClientConfig

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

MockClientConfig is a mock of ClientConfig interface

func NewMockClientConfig

func NewMockClientConfig(ctrl *gomock.Controller) *MockClientConfig

NewMockClientConfig creates a new mock instance

func (*MockClientConfig) Caller

func (_m *MockClientConfig) Caller() string

Caller mocks base method

func (*MockClientConfig) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockClientConfig) GetOnewayOutbound

func (_m *MockClientConfig) GetOnewayOutbound() transport.OnewayOutbound

GetOnewayOutbound mocks base method

func (*MockClientConfig) GetUnaryOutbound

func (_m *MockClientConfig) GetUnaryOutbound() transport.UnaryOutbound

GetUnaryOutbound mocks base method

func (*MockClientConfig) Service

func (_m *MockClientConfig) Service() string

Service mocks base method

type MockClientConfigMockRecorder added in v1.10.0

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

MockClientConfigMockRecorder is the mock recorder for MockClientConfig

func (*MockClientConfigMockRecorder) Caller added in v1.10.0

func (_mr *MockClientConfigMockRecorder) Caller() *gomock.Call

Caller indicates an expected call of Caller

func (*MockClientConfigMockRecorder) GetOnewayOutbound added in v1.10.0

func (_mr *MockClientConfigMockRecorder) GetOnewayOutbound() *gomock.Call

GetOnewayOutbound indicates an expected call of GetOnewayOutbound

func (*MockClientConfigMockRecorder) GetUnaryOutbound added in v1.10.0

func (_mr *MockClientConfigMockRecorder) GetUnaryOutbound() *gomock.Call

GetUnaryOutbound indicates an expected call of GetUnaryOutbound

func (*MockClientConfigMockRecorder) Service added in v1.10.0

func (_mr *MockClientConfigMockRecorder) Service() *gomock.Call

Service indicates an expected call of Service

type MockClientConfigProvider

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

MockClientConfigProvider is a mock of ClientConfigProvider interface

func NewMockClientConfigProvider

func NewMockClientConfigProvider(ctrl *gomock.Controller) *MockClientConfigProvider

NewMockClientConfigProvider creates a new mock instance

func (*MockClientConfigProvider) ClientConfig

func (_m *MockClientConfigProvider) ClientConfig(_param0 string) transport.ClientConfig

ClientConfig mocks base method

func (*MockClientConfigProvider) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

type MockClientConfigProviderMockRecorder added in v1.10.0

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

MockClientConfigProviderMockRecorder is the mock recorder for MockClientConfigProvider

func (*MockClientConfigProviderMockRecorder) ClientConfig added in v1.10.0

func (_mr *MockClientConfigProviderMockRecorder) ClientConfig(arg0 interface{}) *gomock.Call

ClientConfig indicates an expected call of ClientConfig

type MockInbound

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

MockInbound is a mock of Inbound interface

func NewMockInbound

func NewMockInbound(ctrl *gomock.Controller) *MockInbound

NewMockInbound creates a new mock instance

func (*MockInbound) EXPECT

func (_m *MockInbound) EXPECT() *MockInboundMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

func (*MockInbound) IsRunning

func (_m *MockInbound) IsRunning() bool

IsRunning mocks base method

func (*MockInbound) SetRouter

func (_m *MockInbound) SetRouter(_param0 transport.Router)

SetRouter mocks base method

func (*MockInbound) Start

func (_m *MockInbound) Start() error

Start mocks base method

func (*MockInbound) Stop

func (_m *MockInbound) Stop() error

Stop mocks base method

func (*MockInbound) Transports

func (_m *MockInbound) Transports() []transport.Transport

Transports mocks base method

type MockInboundMockRecorder added in v1.10.0

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

MockInboundMockRecorder is the mock recorder for MockInbound

func (*MockInboundMockRecorder) IsRunning added in v1.10.0

func (_mr *MockInboundMockRecorder) IsRunning() *gomock.Call

IsRunning indicates an expected call of IsRunning

func (*MockInboundMockRecorder) SetRouter added in v1.10.0

func (_mr *MockInboundMockRecorder) SetRouter(arg0 interface{}) *gomock.Call

SetRouter indicates an expected call of SetRouter

func (*MockInboundMockRecorder) Start added in v1.10.0

func (_mr *MockInboundMockRecorder) Start() *gomock.Call

Start indicates an expected call of Start

func (*MockInboundMockRecorder) Stop added in v1.10.0

func (_mr *MockInboundMockRecorder) Stop() *gomock.Call

Stop indicates an expected call of Stop

func (*MockInboundMockRecorder) Transports added in v1.10.0

func (_mr *MockInboundMockRecorder) Transports() *gomock.Call

Transports indicates an expected call of Transports

type MockOnewayHandler

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

MockOnewayHandler is a mock of OnewayHandler interface

func NewMockOnewayHandler

func NewMockOnewayHandler(ctrl *gomock.Controller) *MockOnewayHandler

NewMockOnewayHandler creates a new mock instance

func (*MockOnewayHandler) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockOnewayHandler) HandleOneway

func (_m *MockOnewayHandler) HandleOneway(_param0 context.Context, _param1 *transport.Request) error

HandleOneway mocks base method

type MockOnewayHandlerMockRecorder added in v1.10.0

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

MockOnewayHandlerMockRecorder is the mock recorder for MockOnewayHandler

func (*MockOnewayHandlerMockRecorder) HandleOneway added in v1.10.0

func (_mr *MockOnewayHandlerMockRecorder) HandleOneway(arg0, arg1 interface{}) *gomock.Call

HandleOneway indicates an expected call of HandleOneway

type MockOnewayOutbound

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

MockOnewayOutbound is a mock of OnewayOutbound interface

func NewMockOnewayOutbound

func NewMockOnewayOutbound(ctrl *gomock.Controller) *MockOnewayOutbound

NewMockOnewayOutbound creates a new mock instance

func (*MockOnewayOutbound) CallOneway

func (_m *MockOnewayOutbound) CallOneway(_param0 context.Context, _param1 *transport.Request) (transport.Ack, error)

CallOneway mocks base method

func (*MockOnewayOutbound) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockOnewayOutbound) IsRunning

func (_m *MockOnewayOutbound) IsRunning() bool

IsRunning mocks base method

func (*MockOnewayOutbound) Start

func (_m *MockOnewayOutbound) Start() error

Start mocks base method

func (*MockOnewayOutbound) Stop

func (_m *MockOnewayOutbound) Stop() error

Stop mocks base method

func (*MockOnewayOutbound) Transports

func (_m *MockOnewayOutbound) Transports() []transport.Transport

Transports mocks base method

type MockOnewayOutboundMockRecorder added in v1.10.0

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

MockOnewayOutboundMockRecorder is the mock recorder for MockOnewayOutbound

func (*MockOnewayOutboundMockRecorder) CallOneway added in v1.10.0

func (_mr *MockOnewayOutboundMockRecorder) CallOneway(arg0, arg1 interface{}) *gomock.Call

CallOneway indicates an expected call of CallOneway

func (*MockOnewayOutboundMockRecorder) IsRunning added in v1.10.0

func (_mr *MockOnewayOutboundMockRecorder) IsRunning() *gomock.Call

IsRunning indicates an expected call of IsRunning

func (*MockOnewayOutboundMockRecorder) Start added in v1.10.0

Start indicates an expected call of Start

func (*MockOnewayOutboundMockRecorder) Stop added in v1.10.0

Stop indicates an expected call of Stop

func (*MockOnewayOutboundMockRecorder) Transports added in v1.10.0

func (_mr *MockOnewayOutboundMockRecorder) Transports() *gomock.Call

Transports indicates an expected call of Transports

type MockRouteTable

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

MockRouteTable is a mock of RouteTable interface

func NewMockRouteTable

func NewMockRouteTable(ctrl *gomock.Controller) *MockRouteTable

NewMockRouteTable creates a new mock instance

func (*MockRouteTable) Choose

func (_m *MockRouteTable) Choose(_param0 context.Context, _param1 *transport.Request) (transport.HandlerSpec, error)

Choose mocks base method

func (*MockRouteTable) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockRouteTable) Procedures

func (_m *MockRouteTable) Procedures() []transport.Procedure

Procedures mocks base method

func (*MockRouteTable) Register

func (_m *MockRouteTable) Register(_param0 []transport.Procedure)

Register mocks base method

type MockRouteTableMockRecorder added in v1.10.0

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

MockRouteTableMockRecorder is the mock recorder for MockRouteTable

func (*MockRouteTableMockRecorder) Choose added in v1.10.0

func (_mr *MockRouteTableMockRecorder) Choose(arg0, arg1 interface{}) *gomock.Call

Choose indicates an expected call of Choose

func (*MockRouteTableMockRecorder) Procedures added in v1.10.0

func (_mr *MockRouteTableMockRecorder) Procedures() *gomock.Call

Procedures indicates an expected call of Procedures

func (*MockRouteTableMockRecorder) Register added in v1.10.0

func (_mr *MockRouteTableMockRecorder) Register(arg0 interface{}) *gomock.Call

Register indicates an expected call of Register

type MockRouter

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

MockRouter is a mock of Router interface

func NewMockRouter

func NewMockRouter(ctrl *gomock.Controller) *MockRouter

NewMockRouter creates a new mock instance

func (*MockRouter) Choose

func (_m *MockRouter) Choose(_param0 context.Context, _param1 *transport.Request) (transport.HandlerSpec, error)

Choose mocks base method

func (*MockRouter) EXPECT

func (_m *MockRouter) EXPECT() *MockRouterMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

func (*MockRouter) Procedures

func (_m *MockRouter) Procedures() []transport.Procedure

Procedures mocks base method

type MockRouterMockRecorder added in v1.10.0

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

MockRouterMockRecorder is the mock recorder for MockRouter

func (*MockRouterMockRecorder) Choose added in v1.10.0

func (_mr *MockRouterMockRecorder) Choose(arg0, arg1 interface{}) *gomock.Call

Choose indicates an expected call of Choose

func (*MockRouterMockRecorder) Procedures added in v1.10.0

func (_mr *MockRouterMockRecorder) Procedures() *gomock.Call

Procedures indicates an expected call of Procedures

type MockStream added in v1.27.0

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

MockStream is a mock of Stream interface

func NewMockStream added in v1.27.0

func NewMockStream(ctrl *gomock.Controller) *MockStream

NewMockStream creates a new mock instance

func (*MockStream) Context added in v1.27.0

func (_m *MockStream) Context() context.Context

Context mocks base method

func (*MockStream) EXPECT added in v1.27.0

func (_m *MockStream) EXPECT() *MockStreamMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

func (*MockStream) ReceiveMessage added in v1.27.0

func (_m *MockStream) ReceiveMessage(_param0 context.Context) (*transport.StreamMessage, error)

ReceiveMessage mocks base method

func (*MockStream) Request added in v1.27.0

func (_m *MockStream) Request() *transport.StreamRequest

Request mocks base method

func (*MockStream) SendMessage added in v1.27.0

func (_m *MockStream) SendMessage(_param0 context.Context, _param1 *transport.StreamMessage) error

SendMessage mocks base method

type MockStreamCloser added in v1.27.0

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

MockStreamCloser is a mock of StreamCloser interface

func NewMockStreamCloser added in v1.27.0

func NewMockStreamCloser(ctrl *gomock.Controller) *MockStreamCloser

NewMockStreamCloser creates a new mock instance

func (*MockStreamCloser) Close added in v1.27.0

func (_m *MockStreamCloser) Close(_param0 context.Context) error

Close mocks base method

func (*MockStreamCloser) Context added in v1.27.0

func (_m *MockStreamCloser) Context() context.Context

Context mocks base method

func (*MockStreamCloser) EXPECT added in v1.27.0

EXPECT returns an object that allows the caller to indicate expected use

func (*MockStreamCloser) ReceiveMessage added in v1.27.0

func (_m *MockStreamCloser) ReceiveMessage(_param0 context.Context) (*transport.StreamMessage, error)

ReceiveMessage mocks base method

func (*MockStreamCloser) Request added in v1.27.0

func (_m *MockStreamCloser) Request() *transport.StreamRequest

Request mocks base method

func (*MockStreamCloser) SendMessage added in v1.27.0

func (_m *MockStreamCloser) SendMessage(_param0 context.Context, _param1 *transport.StreamMessage) error

SendMessage mocks base method

type MockStreamCloserMockRecorder added in v1.27.0

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

MockStreamCloserMockRecorder is the mock recorder for MockStreamCloser

func (*MockStreamCloserMockRecorder) Close added in v1.27.0

func (_mr *MockStreamCloserMockRecorder) Close(arg0 interface{}) *gomock.Call

Close indicates an expected call of Close

func (*MockStreamCloserMockRecorder) Context added in v1.27.0

func (_mr *MockStreamCloserMockRecorder) Context() *gomock.Call

Context indicates an expected call of Context

func (*MockStreamCloserMockRecorder) ReceiveMessage added in v1.27.0

func (_mr *MockStreamCloserMockRecorder) ReceiveMessage(arg0 interface{}) *gomock.Call

ReceiveMessage indicates an expected call of ReceiveMessage

func (*MockStreamCloserMockRecorder) Request added in v1.27.0

func (_mr *MockStreamCloserMockRecorder) Request() *gomock.Call

Request indicates an expected call of Request

func (*MockStreamCloserMockRecorder) SendMessage added in v1.27.0

func (_mr *MockStreamCloserMockRecorder) SendMessage(arg0, arg1 interface{}) *gomock.Call

SendMessage indicates an expected call of SendMessage

type MockStreamHandler added in v1.27.0

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

MockStreamHandler is a mock of StreamHandler interface

func NewMockStreamHandler added in v1.27.0

func NewMockStreamHandler(ctrl *gomock.Controller) *MockStreamHandler

NewMockStreamHandler creates a new mock instance

func (*MockStreamHandler) EXPECT added in v1.27.0

EXPECT returns an object that allows the caller to indicate expected use

func (*MockStreamHandler) HandleStream added in v1.27.0

func (_m *MockStreamHandler) HandleStream(_param0 *transport.ServerStream) error

HandleStream mocks base method

type MockStreamHandlerMockRecorder added in v1.27.0

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

MockStreamHandlerMockRecorder is the mock recorder for MockStreamHandler

func (*MockStreamHandlerMockRecorder) HandleStream added in v1.27.0

func (_mr *MockStreamHandlerMockRecorder) HandleStream(arg0 interface{}) *gomock.Call

HandleStream indicates an expected call of HandleStream

type MockStreamMockRecorder added in v1.27.0

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

MockStreamMockRecorder is the mock recorder for MockStream

func (*MockStreamMockRecorder) Context added in v1.27.0

func (_mr *MockStreamMockRecorder) Context() *gomock.Call

Context indicates an expected call of Context

func (*MockStreamMockRecorder) ReceiveMessage added in v1.27.0

func (_mr *MockStreamMockRecorder) ReceiveMessage(arg0 interface{}) *gomock.Call

ReceiveMessage indicates an expected call of ReceiveMessage

func (*MockStreamMockRecorder) Request added in v1.27.0

func (_mr *MockStreamMockRecorder) Request() *gomock.Call

Request indicates an expected call of Request

func (*MockStreamMockRecorder) SendMessage added in v1.27.0

func (_mr *MockStreamMockRecorder) SendMessage(arg0, arg1 interface{}) *gomock.Call

SendMessage indicates an expected call of SendMessage

type MockStreamOutbound added in v1.27.0

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

MockStreamOutbound is a mock of StreamOutbound interface

func NewMockStreamOutbound added in v1.27.0

func NewMockStreamOutbound(ctrl *gomock.Controller) *MockStreamOutbound

NewMockStreamOutbound creates a new mock instance

func (*MockStreamOutbound) CallStream added in v1.27.0

func (_m *MockStreamOutbound) CallStream(_param0 context.Context, _param1 *transport.StreamRequest) (*transport.ClientStream, error)

CallStream mocks base method

func (*MockStreamOutbound) EXPECT added in v1.27.0

EXPECT returns an object that allows the caller to indicate expected use

func (*MockStreamOutbound) IsRunning added in v1.27.0

func (_m *MockStreamOutbound) IsRunning() bool

IsRunning mocks base method

func (*MockStreamOutbound) Start added in v1.27.0

func (_m *MockStreamOutbound) Start() error

Start mocks base method

func (*MockStreamOutbound) Stop added in v1.27.0

func (_m *MockStreamOutbound) Stop() error

Stop mocks base method

func (*MockStreamOutbound) Transports added in v1.27.0

func (_m *MockStreamOutbound) Transports() []transport.Transport

Transports mocks base method

type MockStreamOutboundMockRecorder added in v1.27.0

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

MockStreamOutboundMockRecorder is the mock recorder for MockStreamOutbound

func (*MockStreamOutboundMockRecorder) CallStream added in v1.27.0

func (_mr *MockStreamOutboundMockRecorder) CallStream(arg0, arg1 interface{}) *gomock.Call

CallStream indicates an expected call of CallStream

func (*MockStreamOutboundMockRecorder) IsRunning added in v1.27.0

func (_mr *MockStreamOutboundMockRecorder) IsRunning() *gomock.Call

IsRunning indicates an expected call of IsRunning

func (*MockStreamOutboundMockRecorder) Start added in v1.27.0

Start indicates an expected call of Start

func (*MockStreamOutboundMockRecorder) Stop added in v1.27.0

Stop indicates an expected call of Stop

func (*MockStreamOutboundMockRecorder) Transports added in v1.27.0

func (_mr *MockStreamOutboundMockRecorder) Transports() *gomock.Call

Transports indicates an expected call of Transports

type MockTransport added in v1.7.0

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

MockTransport is a mock of Transport interface

func NewMockTransport added in v1.7.0

func NewMockTransport(ctrl *gomock.Controller) *MockTransport

NewMockTransport creates a new mock instance

func (*MockTransport) EXPECT added in v1.7.0

EXPECT returns an object that allows the caller to indicate expected use

func (*MockTransport) IsRunning added in v1.7.0

func (_m *MockTransport) IsRunning() bool

IsRunning mocks base method

func (*MockTransport) Start added in v1.7.0

func (_m *MockTransport) Start() error

Start mocks base method

func (*MockTransport) Stop added in v1.7.0

func (_m *MockTransport) Stop() error

Stop mocks base method

type MockTransportMockRecorder added in v1.10.0

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

MockTransportMockRecorder is the mock recorder for MockTransport

func (*MockTransportMockRecorder) IsRunning added in v1.10.0

func (_mr *MockTransportMockRecorder) IsRunning() *gomock.Call

IsRunning indicates an expected call of IsRunning

func (*MockTransportMockRecorder) Start added in v1.10.0

func (_mr *MockTransportMockRecorder) Start() *gomock.Call

Start indicates an expected call of Start

func (*MockTransportMockRecorder) Stop added in v1.10.0

func (_mr *MockTransportMockRecorder) Stop() *gomock.Call

Stop indicates an expected call of Stop

type MockUnaryHandler

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

MockUnaryHandler is a mock of UnaryHandler interface

func NewMockUnaryHandler

func NewMockUnaryHandler(ctrl *gomock.Controller) *MockUnaryHandler

NewMockUnaryHandler creates a new mock instance

func (*MockUnaryHandler) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockUnaryHandler) Handle

func (_m *MockUnaryHandler) Handle(_param0 context.Context, _param1 *transport.Request, _param2 transport.ResponseWriter) error

Handle mocks base method

type MockUnaryHandlerMockRecorder added in v1.10.0

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

MockUnaryHandlerMockRecorder is the mock recorder for MockUnaryHandler

func (*MockUnaryHandlerMockRecorder) Handle added in v1.10.0

func (_mr *MockUnaryHandlerMockRecorder) Handle(arg0, arg1, arg2 interface{}) *gomock.Call

Handle indicates an expected call of Handle

type MockUnaryOutbound

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

MockUnaryOutbound is a mock of UnaryOutbound interface

func NewMockUnaryOutbound

func NewMockUnaryOutbound(ctrl *gomock.Controller) *MockUnaryOutbound

NewMockUnaryOutbound creates a new mock instance

func (*MockUnaryOutbound) Call

func (_m *MockUnaryOutbound) Call(_param0 context.Context, _param1 *transport.Request) (*transport.Response, error)

Call mocks base method

func (*MockUnaryOutbound) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockUnaryOutbound) IsRunning

func (_m *MockUnaryOutbound) IsRunning() bool

IsRunning mocks base method

func (*MockUnaryOutbound) Start

func (_m *MockUnaryOutbound) Start() error

Start mocks base method

func (*MockUnaryOutbound) Stop

func (_m *MockUnaryOutbound) Stop() error

Stop mocks base method

func (*MockUnaryOutbound) Transports

func (_m *MockUnaryOutbound) Transports() []transport.Transport

Transports mocks base method

type MockUnaryOutboundMockRecorder added in v1.10.0

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

MockUnaryOutboundMockRecorder is the mock recorder for MockUnaryOutbound

func (*MockUnaryOutboundMockRecorder) Call added in v1.10.0

func (_mr *MockUnaryOutboundMockRecorder) Call(arg0, arg1 interface{}) *gomock.Call

Call indicates an expected call of Call

func (*MockUnaryOutboundMockRecorder) IsRunning added in v1.10.0

func (_mr *MockUnaryOutboundMockRecorder) IsRunning() *gomock.Call

IsRunning indicates an expected call of IsRunning

func (*MockUnaryOutboundMockRecorder) Start added in v1.10.0

Start indicates an expected call of Start

func (*MockUnaryOutboundMockRecorder) Stop added in v1.10.0

Stop indicates an expected call of Stop

func (*MockUnaryOutboundMockRecorder) Transports added in v1.10.0

func (_mr *MockUnaryOutboundMockRecorder) Transports() *gomock.Call

Transports indicates an expected call of Transports

type RequestMatcher

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

RequestMatcher may be used in gomock argument lists to assert that two requests match.

Requests are considered to be matching if: all their primitive parameters match, the headers of the received request include all the headers from the source request, and the contents of the request bodies are the same.

func NewRequestMatcher

func NewRequestMatcher(t *testing.T, r *transport.Request) RequestMatcher

NewRequestMatcher constructs a new RequestMatcher from the given testing.T and request.

The request's contents are read in their entirety and replaced with a bytes.Reader.

func (RequestMatcher) Matches

func (m RequestMatcher) Matches(got interface{}) bool

Matches checks if the given object matches the Request provided in NewRequestMatcher.

func (RequestMatcher) String

func (m RequestMatcher) String() string

type ResponseMatcher

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

ResponseMatcher is similar to RequestMatcher but for responses.

func NewResponseMatcher

func NewResponseMatcher(t *testing.T, r *transport.Response) ResponseMatcher

NewResponseMatcher builds a new ResponseMatcher that verifies that responses match the given Response.

func (ResponseMatcher) Matches

func (m ResponseMatcher) Matches(got interface{}) bool

Matches checks if the given object matches the Response provided in NewResponseMatcher.

Jump to

Keyboard shortcuts

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