github.com/yandex/pandora@v0.5.32/lib/netutil/mocks/dialer.go (about) 1 // Code generated by mockery v2.20.2. DO NOT EDIT. 2 3 package netmock 4 5 import ( 6 context "context" 7 net "net" 8 9 mock "github.com/stretchr/testify/mock" 10 ) 11 12 // Dialer is an autogenerated mock type for the Dialer type 13 type Dialer struct { 14 mock.Mock 15 } 16 17 // DialContext provides a mock function with given fields: ctx, _a1, addr 18 func (_m *Dialer) DialContext(ctx context.Context, _a1 string, addr string) (net.Conn, error) { 19 ret := _m.Called(ctx, _a1, addr) 20 21 var r0 net.Conn 22 var r1 error 23 if rf, ok := ret.Get(0).(func(context.Context, string, string) (net.Conn, error)); ok { 24 return rf(ctx, _a1, addr) 25 } 26 if rf, ok := ret.Get(0).(func(context.Context, string, string) net.Conn); ok { 27 r0 = rf(ctx, _a1, addr) 28 } else { 29 if ret.Get(0) != nil { 30 r0 = ret.Get(0).(net.Conn) 31 } 32 } 33 34 if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { 35 r1 = rf(ctx, _a1, addr) 36 } else { 37 r1 = ret.Error(1) 38 } 39 40 return r0, r1 41 } 42 43 type mockConstructorTestingTNewDialer interface { 44 mock.TestingT 45 Cleanup(func()) 46 } 47 48 // NewDialer creates a new instance of Dialer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 49 func NewDialer(t mockConstructorTestingTNewDialer) *Dialer { 50 mock := &Dialer{} 51 mock.Mock.Test(t) 52 53 t.Cleanup(func() { mock.AssertExpectations(t) }) 54 55 return mock 56 }