github.com/goravel/framework@v1.13.9/contracts/grpc/mocks/Grpc.go (about) 1 // Code generated by mockery v2.14.0. DO NOT EDIT. 2 3 package mocks 4 5 import ( 6 context "context" 7 8 grpc "google.golang.org/grpc" 9 10 mock "github.com/stretchr/testify/mock" 11 ) 12 13 // Grpc is an autogenerated mock type for the Grpc type 14 type Grpc struct { 15 mock.Mock 16 } 17 18 // Client provides a mock function with given fields: ctx, name 19 func (_m *Grpc) Client(ctx context.Context, name string) (*grpc.ClientConn, error) { 20 ret := _m.Called(ctx, name) 21 22 var r0 *grpc.ClientConn 23 if rf, ok := ret.Get(0).(func(context.Context, string) *grpc.ClientConn); ok { 24 r0 = rf(ctx, name) 25 } else { 26 if ret.Get(0) != nil { 27 r0 = ret.Get(0).(*grpc.ClientConn) 28 } 29 } 30 31 var r1 error 32 if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { 33 r1 = rf(ctx, name) 34 } else { 35 r1 = ret.Error(1) 36 } 37 38 return r0, r1 39 } 40 41 // Run provides a mock function with given fields: host 42 func (_m *Grpc) Run(host ...string) error { 43 _va := make([]interface{}, len(host)) 44 for _i := range host { 45 _va[_i] = host[_i] 46 } 47 var _ca []interface{} 48 _ca = append(_ca, _va...) 49 ret := _m.Called(_ca...) 50 51 var r0 error 52 if rf, ok := ret.Get(0).(func(...string) error); ok { 53 r0 = rf(host...) 54 } else { 55 r0 = ret.Error(0) 56 } 57 58 return r0 59 } 60 61 // Server provides a mock function with given fields: 62 func (_m *Grpc) Server() *grpc.Server { 63 ret := _m.Called() 64 65 var r0 *grpc.Server 66 if rf, ok := ret.Get(0).(func() *grpc.Server); ok { 67 r0 = rf() 68 } else { 69 if ret.Get(0) != nil { 70 r0 = ret.Get(0).(*grpc.Server) 71 } 72 } 73 74 return r0 75 } 76 77 // UnaryClientInterceptorGroups provides a mock function with given fields: _a0 78 func (_m *Grpc) UnaryClientInterceptorGroups(_a0 map[string][]grpc.UnaryClientInterceptor) { 79 _m.Called(_a0) 80 } 81 82 // UnaryServerInterceptors provides a mock function with given fields: _a0 83 func (_m *Grpc) UnaryServerInterceptors(_a0 []grpc.UnaryServerInterceptor) { 84 _m.Called(_a0) 85 } 86 87 type mockConstructorTestingTNewGrpc interface { 88 mock.TestingT 89 Cleanup(func()) 90 } 91 92 // NewGrpc creates a new instance of Grpc. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 93 func NewGrpc(t mockConstructorTestingTNewGrpc) *Grpc { 94 mock := &Grpc{} 95 mock.Mock.Test(t) 96 97 t.Cleanup(func() { mock.AssertExpectations(t) }) 98 99 return mock 100 }