go.uber.org/yarpc@v1.72.1/encoding/thrift/thriftrw-plugin-yarpc/internal/tests/extends/footest/client.go (about)

     1  // Code generated by thriftrw-plugin-yarpc
     2  // @generated
     3  
     4  package footest
     5  
     6  import (
     7  	context "context"
     8  	gomock "github.com/golang/mock/gomock"
     9  	yarpc "go.uber.org/yarpc"
    10  	fooclient "go.uber.org/yarpc/encoding/thrift/thriftrw-plugin-yarpc/internal/tests/extends/fooclient"
    11  )
    12  
    13  // MockClient implements a gomock-compatible mock client for service
    14  // Foo.
    15  type MockClient struct {
    16  	ctrl     *gomock.Controller
    17  	recorder *_MockClientRecorder
    18  }
    19  
    20  var _ fooclient.Interface = (*MockClient)(nil)
    21  
    22  type _MockClientRecorder struct {
    23  	mock *MockClient
    24  }
    25  
    26  // Build a new mock client for service Foo.
    27  //
    28  //	mockCtrl := gomock.NewController(t)
    29  //	client := footest.NewMockClient(mockCtrl)
    30  //
    31  // Use EXPECT() to set expectations on the mock.
    32  func NewMockClient(ctrl *gomock.Controller) *MockClient {
    33  	mock := &MockClient{ctrl: ctrl}
    34  	mock.recorder = &_MockClientRecorder{mock}
    35  	return mock
    36  }
    37  
    38  // EXPECT returns an object that allows you to define an expectation on the
    39  // Foo mock client.
    40  func (m *MockClient) EXPECT() *_MockClientRecorder {
    41  	return m.recorder
    42  }
    43  
    44  // Name responds to a Name call based on the mock expectations. This
    45  // call will fail if the mock does not expect this call. Use EXPECT to expect
    46  // a call to this function.
    47  //
    48  //	client.EXPECT().Name(gomock.Any(), ...).Return(...)
    49  //	... := client.Name(...)
    50  func (m *MockClient) Name(
    51  	ctx context.Context,
    52  	opts ...yarpc.CallOption,
    53  ) (success string, err error) {
    54  
    55  	args := []interface{}{ctx}
    56  	for _, o := range opts {
    57  		args = append(args, o)
    58  	}
    59  	i := 0
    60  	ret := m.ctrl.Call(m, "Name", args...)
    61  	success, _ = ret[i].(string)
    62  	i++
    63  	err, _ = ret[i].(error)
    64  	return
    65  }
    66  
    67  func (mr *_MockClientRecorder) Name(
    68  	ctx interface{},
    69  	opts ...interface{},
    70  ) *gomock.Call {
    71  	args := append([]interface{}{ctx}, opts...)
    72  	return mr.mock.ctrl.RecordCall(mr.mock, "Name", args...)
    73  }