clientmock

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2021 License: MIT Imports: 5 Imported by: 9

Documentation

Overview

Package clientmock is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Call added in v0.6.2

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

Call is a thin wrapper around gomock.Call for exposing the methods that do not mutate the fixture related information like Return().

func (Call) MaxTimes added in v0.6.2

func (c Call) MaxTimes(max int)

MaxTimes marks a fixture as callable up to a maximum number of times.

func (Call) MinTimes added in v0.6.2

func (c Call) MinTimes(min int)

MinTimes marks a fixture as must be called a minimum number of times.

type ClientFixture added in v0.6.2

type ClientFixture struct {
	EchoEcho *EchoEchoScenarios
}

ClientFixture defines the client fixture type

type EchoEchoFixture added in v0.6.2

type EchoEchoFixture struct {
	Arg0 context.Context
	Arg1 *echo.Request
	Arg2 []yarpc.CallOption

	// Arg{n}Any indicates the nth argument could be gomock.Any
	Arg0Any bool
	Arg1Any bool
	// Arg2Any indicates the variadic argument is a number of gomock.Any
	Arg2Any int

	Ret0 *echo.Response
	Ret1 error
}

EchoEchoFixture defines the fixture type for EchoEcho

type EchoEchoMock added in v0.6.2

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

EchoEchoMock mocks the EchoEcho method

func (*EchoEchoMock) Success added in v0.6.2

func (s *EchoEchoMock) Success() Call

Success sets the expected scenario as defined in the concrete fixture package github.com/uber/zanzibar/examples/selective-gateway/clients/echo/fixture

type EchoEchoScenarios added in v0.6.2

type EchoEchoScenarios struct {
	Success *EchoEchoFixture `scenario:"success"`
}

EchoEchoScenarios defines all fixture scenarios for EchoEcho

type MockClient

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

MockClient is a mock of Client interface.

func NewMockClient

func NewMockClient(ctrl *gomock.Controller) *MockClient

NewMockClient creates a new mock instance.

func (*MockClient) EXPECT

func (m *MockClient) EXPECT() *MockClientMockRecorder

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

func (*MockClient) EchoEcho added in v0.6.1

func (m *MockClient) EchoEcho(arg0 context.Context, arg1 *echo.Request, arg2 ...yarpc.CallOption) (*echo.Response, error)

EchoEcho mocks base method.

type MockClientMockRecorder

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

MockClientMockRecorder is the mock recorder for MockClient.

func (*MockClientMockRecorder) EchoEcho added in v0.6.1

func (mr *MockClientMockRecorder) EchoEcho(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

EchoEcho indicates an expected call of EchoEcho.

type MockClientWithFixture added in v0.6.2

type MockClientWithFixture struct {
	*MockClient
	// contains filtered or unexported fields
}

MockClientWithFixture is a mock of Client interface with preset fixture

func New added in v0.6.2

New creates a new mock instance

func (*MockClientWithFixture) EXPECT added in v0.6.2

func (m *MockClientWithFixture) EXPECT()

EXPECT shadows the EXPECT method on the underlying mock client. It should not be called directly.

func (*MockClientWithFixture) ExpectEchoEcho added in v0.6.2

func (m *MockClientWithFixture) ExpectEchoEcho() *EchoEchoMock

ExpectEchoEcho returns an object that allows the caller to choose expected scenario for EchoEcho

Jump to

Keyboard shortcuts

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