github.com/anycable/anycable-go@v1.5.1/node_mocks/AppNode.go (about)

     1  // Code generated by mockery v2.20.0. DO NOT EDIT.
     2  
     3  package node_mocks
     4  
     5  import (
     6  	common "github.com/anycable/anycable-go/common"
     7  	mock "github.com/stretchr/testify/mock"
     8  
     9  	node "github.com/anycable/anycable-go/node"
    10  )
    11  
    12  // AppNode is an autogenerated mock type for the AppNode type
    13  type AppNode struct {
    14  	mock.Mock
    15  }
    16  
    17  // Authenticate provides a mock function with given fields: s, opts
    18  func (_m *AppNode) Authenticate(s *node.Session, opts ...func(*node.AuthOptions)) (*common.ConnectResult, error) {
    19  	_va := make([]interface{}, len(opts))
    20  	for _i := range opts {
    21  		_va[_i] = opts[_i]
    22  	}
    23  	var _ca []interface{}
    24  	_ca = append(_ca, s)
    25  	_ca = append(_ca, _va...)
    26  	ret := _m.Called(_ca...)
    27  
    28  	var r0 *common.ConnectResult
    29  	var r1 error
    30  	if rf, ok := ret.Get(0).(func(*node.Session, ...func(*node.AuthOptions)) (*common.ConnectResult, error)); ok {
    31  		return rf(s, opts...)
    32  	}
    33  	if rf, ok := ret.Get(0).(func(*node.Session, ...func(*node.AuthOptions)) *common.ConnectResult); ok {
    34  		r0 = rf(s, opts...)
    35  	} else {
    36  		if ret.Get(0) != nil {
    37  			r0 = ret.Get(0).(*common.ConnectResult)
    38  		}
    39  	}
    40  
    41  	if rf, ok := ret.Get(1).(func(*node.Session, ...func(*node.AuthOptions)) error); ok {
    42  		r1 = rf(s, opts...)
    43  	} else {
    44  		r1 = ret.Error(1)
    45  	}
    46  
    47  	return r0, r1
    48  }
    49  
    50  // Authenticated provides a mock function with given fields: s, identifiers
    51  func (_m *AppNode) Authenticated(s *node.Session, identifiers string) {
    52  	_m.Called(s, identifiers)
    53  }
    54  
    55  // Disconnect provides a mock function with given fields: s
    56  func (_m *AppNode) Disconnect(s *node.Session) error {
    57  	ret := _m.Called(s)
    58  
    59  	var r0 error
    60  	if rf, ok := ret.Get(0).(func(*node.Session) error); ok {
    61  		r0 = rf(s)
    62  	} else {
    63  		r0 = ret.Error(0)
    64  	}
    65  
    66  	return r0
    67  }
    68  
    69  // HandlePubSub provides a mock function with given fields: msg
    70  func (_m *AppNode) HandlePubSub(msg []byte) {
    71  	_m.Called(msg)
    72  }
    73  
    74  // LookupSession provides a mock function with given fields: id
    75  func (_m *AppNode) LookupSession(id string) *node.Session {
    76  	ret := _m.Called(id)
    77  
    78  	var r0 *node.Session
    79  	if rf, ok := ret.Get(0).(func(string) *node.Session); ok {
    80  		r0 = rf(id)
    81  	} else {
    82  		if ret.Get(0) != nil {
    83  			r0 = ret.Get(0).(*node.Session)
    84  		}
    85  	}
    86  
    87  	return r0
    88  }
    89  
    90  // Perform provides a mock function with given fields: s, msg
    91  func (_m *AppNode) Perform(s *node.Session, msg *common.Message) (*common.CommandResult, error) {
    92  	ret := _m.Called(s, msg)
    93  
    94  	var r0 *common.CommandResult
    95  	var r1 error
    96  	if rf, ok := ret.Get(0).(func(*node.Session, *common.Message) (*common.CommandResult, error)); ok {
    97  		return rf(s, msg)
    98  	}
    99  	if rf, ok := ret.Get(0).(func(*node.Session, *common.Message) *common.CommandResult); ok {
   100  		r0 = rf(s, msg)
   101  	} else {
   102  		if ret.Get(0) != nil {
   103  			r0 = ret.Get(0).(*common.CommandResult)
   104  		}
   105  	}
   106  
   107  	if rf, ok := ret.Get(1).(func(*node.Session, *common.Message) error); ok {
   108  		r1 = rf(s, msg)
   109  	} else {
   110  		r1 = ret.Error(1)
   111  	}
   112  
   113  	return r0, r1
   114  }
   115  
   116  // Subscribe provides a mock function with given fields: s, msg
   117  func (_m *AppNode) Subscribe(s *node.Session, msg *common.Message) (*common.CommandResult, error) {
   118  	ret := _m.Called(s, msg)
   119  
   120  	var r0 *common.CommandResult
   121  	var r1 error
   122  	if rf, ok := ret.Get(0).(func(*node.Session, *common.Message) (*common.CommandResult, error)); ok {
   123  		return rf(s, msg)
   124  	}
   125  	if rf, ok := ret.Get(0).(func(*node.Session, *common.Message) *common.CommandResult); ok {
   126  		r0 = rf(s, msg)
   127  	} else {
   128  		if ret.Get(0) != nil {
   129  			r0 = ret.Get(0).(*common.CommandResult)
   130  		}
   131  	}
   132  
   133  	if rf, ok := ret.Get(1).(func(*node.Session, *common.Message) error); ok {
   134  		r1 = rf(s, msg)
   135  	} else {
   136  		r1 = ret.Error(1)
   137  	}
   138  
   139  	return r0, r1
   140  }
   141  
   142  // Unsubscribe provides a mock function with given fields: s, msg
   143  func (_m *AppNode) Unsubscribe(s *node.Session, msg *common.Message) (*common.CommandResult, error) {
   144  	ret := _m.Called(s, msg)
   145  
   146  	var r0 *common.CommandResult
   147  	var r1 error
   148  	if rf, ok := ret.Get(0).(func(*node.Session, *common.Message) (*common.CommandResult, error)); ok {
   149  		return rf(s, msg)
   150  	}
   151  	if rf, ok := ret.Get(0).(func(*node.Session, *common.Message) *common.CommandResult); ok {
   152  		r0 = rf(s, msg)
   153  	} else {
   154  		if ret.Get(0) != nil {
   155  			r0 = ret.Get(0).(*common.CommandResult)
   156  		}
   157  	}
   158  
   159  	if rf, ok := ret.Get(1).(func(*node.Session, *common.Message) error); ok {
   160  		r1 = rf(s, msg)
   161  	} else {
   162  		r1 = ret.Error(1)
   163  	}
   164  
   165  	return r0, r1
   166  }
   167  
   168  type mockConstructorTestingTNewAppNode interface {
   169  	mock.TestingT
   170  	Cleanup(func())
   171  }
   172  
   173  // NewAppNode creates a new instance of AppNode. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
   174  func NewAppNode(t mockConstructorTestingTNewAppNode) *AppNode {
   175  	mock := &AppNode{}
   176  	mock.Mock.Test(t)
   177  
   178  	t.Cleanup(func() { mock.AssertExpectations(t) })
   179  
   180  	return mock
   181  }