clientmock

package
v0.0.0-...-78da9c4 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: MIT Imports: 5 Imported by: 0

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

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

func (c Call) MaxTimes(max int)

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

func (Call) MinTimes

func (c Call) MinTimes(min int)

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

type ClientFixture

type ClientFixture struct {
	EchoEcho *EchoEchoScenarios
}

ClientFixture defines the client fixture type

type EchoEchoFixture

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 context.Context
	Ret1 *echo.Response
	Ret2 error
}

EchoEchoFixture defines the fixture type for EchoEcho

type EchoEchoMock

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

EchoEchoMock mocks the EchoEcho method

func (*EchoEchoMock) Success

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

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

func (m *MockClient) EchoEcho(arg0 context.Context, arg1 *echo.Request, arg2 ...yarpc.CallOption) (context.Context, *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

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

EchoEcho indicates an expected call of EchoEcho.

type MockClientWithFixture

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

MockClientWithFixture is a mock of Client interface with preset fixture

func New

New creates a new mock instance

func (*MockClientWithFixture) EXPECT

func (m *MockClientWithFixture) EXPECT()

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

func (*MockClientWithFixture) ExpectEchoEcho

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