github.com/masterhung0112/hk_server/v5@v5.0.0-20220302090640-ec71aef15e1c/store/storetest/mocks/SharedChannelStore.go (about)

     1  // Code generated by mockery v1.0.0. DO NOT EDIT.
     2  
     3  // 'Regenerate
     4  
     5  package mocks
     6  
     7  import (
     8  	model "github.com/masterhung0112/hk_server/v5/model"
     9  	mock "github.com/stretchr/testify/mock"
    10  )
    11  
    12  // SharedChannelStore is an autogenerated mock type for the SharedChannelStore type
    13  type SharedChannelStore struct {
    14  	mock.Mock
    15  }
    16  
    17  // Delete provides a mock function with given fields: channelId
    18  func (_m *SharedChannelStore) Delete(channelId string) (bool, error) {
    19  	ret := _m.Called(channelId)
    20  
    21  	var r0 bool
    22  	if rf, ok := ret.Get(0).(func(string) bool); ok {
    23  		r0 = rf(channelId)
    24  	} else {
    25  		r0 = ret.Get(0).(bool)
    26  	}
    27  
    28  	var r1 error
    29  	if rf, ok := ret.Get(1).(func(string) error); ok {
    30  		r1 = rf(channelId)
    31  	} else {
    32  		r1 = ret.Error(1)
    33  	}
    34  
    35  	return r0, r1
    36  }
    37  
    38  // DeleteRemote provides a mock function with given fields: remoteId
    39  func (_m *SharedChannelStore) DeleteRemote(remoteId string) (bool, error) {
    40  	ret := _m.Called(remoteId)
    41  
    42  	var r0 bool
    43  	if rf, ok := ret.Get(0).(func(string) bool); ok {
    44  		r0 = rf(remoteId)
    45  	} else {
    46  		r0 = ret.Get(0).(bool)
    47  	}
    48  
    49  	var r1 error
    50  	if rf, ok := ret.Get(1).(func(string) error); ok {
    51  		r1 = rf(remoteId)
    52  	} else {
    53  		r1 = ret.Error(1)
    54  	}
    55  
    56  	return r0, r1
    57  }
    58  
    59  // Get provides a mock function with given fields: channelId
    60  func (_m *SharedChannelStore) Get(channelId string) (*model.SharedChannel, error) {
    61  	ret := _m.Called(channelId)
    62  
    63  	var r0 *model.SharedChannel
    64  	if rf, ok := ret.Get(0).(func(string) *model.SharedChannel); ok {
    65  		r0 = rf(channelId)
    66  	} else {
    67  		if ret.Get(0) != nil {
    68  			r0 = ret.Get(0).(*model.SharedChannel)
    69  		}
    70  	}
    71  
    72  	var r1 error
    73  	if rf, ok := ret.Get(1).(func(string) error); ok {
    74  		r1 = rf(channelId)
    75  	} else {
    76  		r1 = ret.Error(1)
    77  	}
    78  
    79  	return r0, r1
    80  }
    81  
    82  // GetAll provides a mock function with given fields: offset, limit, opts
    83  func (_m *SharedChannelStore) GetAll(offset int, limit int, opts model.SharedChannelFilterOpts) ([]*model.SharedChannel, error) {
    84  	ret := _m.Called(offset, limit, opts)
    85  
    86  	var r0 []*model.SharedChannel
    87  	if rf, ok := ret.Get(0).(func(int, int, model.SharedChannelFilterOpts) []*model.SharedChannel); ok {
    88  		r0 = rf(offset, limit, opts)
    89  	} else {
    90  		if ret.Get(0) != nil {
    91  			r0 = ret.Get(0).([]*model.SharedChannel)
    92  		}
    93  	}
    94  
    95  	var r1 error
    96  	if rf, ok := ret.Get(1).(func(int, int, model.SharedChannelFilterOpts) error); ok {
    97  		r1 = rf(offset, limit, opts)
    98  	} else {
    99  		r1 = ret.Error(1)
   100  	}
   101  
   102  	return r0, r1
   103  }
   104  
   105  // GetAllCount provides a mock function with given fields: opts
   106  func (_m *SharedChannelStore) GetAllCount(opts model.SharedChannelFilterOpts) (int64, error) {
   107  	ret := _m.Called(opts)
   108  
   109  	var r0 int64
   110  	if rf, ok := ret.Get(0).(func(model.SharedChannelFilterOpts) int64); ok {
   111  		r0 = rf(opts)
   112  	} else {
   113  		r0 = ret.Get(0).(int64)
   114  	}
   115  
   116  	var r1 error
   117  	if rf, ok := ret.Get(1).(func(model.SharedChannelFilterOpts) error); ok {
   118  		r1 = rf(opts)
   119  	} else {
   120  		r1 = ret.Error(1)
   121  	}
   122  
   123  	return r0, r1
   124  }
   125  
   126  // GetAttachment provides a mock function with given fields: fileId, remoteId
   127  func (_m *SharedChannelStore) GetAttachment(fileId string, remoteId string) (*model.SharedChannelAttachment, error) {
   128  	ret := _m.Called(fileId, remoteId)
   129  
   130  	var r0 *model.SharedChannelAttachment
   131  	if rf, ok := ret.Get(0).(func(string, string) *model.SharedChannelAttachment); ok {
   132  		r0 = rf(fileId, remoteId)
   133  	} else {
   134  		if ret.Get(0) != nil {
   135  			r0 = ret.Get(0).(*model.SharedChannelAttachment)
   136  		}
   137  	}
   138  
   139  	var r1 error
   140  	if rf, ok := ret.Get(1).(func(string, string) error); ok {
   141  		r1 = rf(fileId, remoteId)
   142  	} else {
   143  		r1 = ret.Error(1)
   144  	}
   145  
   146  	return r0, r1
   147  }
   148  
   149  // GetRemote provides a mock function with given fields: id
   150  func (_m *SharedChannelStore) GetRemote(id string) (*model.SharedChannelRemote, error) {
   151  	ret := _m.Called(id)
   152  
   153  	var r0 *model.SharedChannelRemote
   154  	if rf, ok := ret.Get(0).(func(string) *model.SharedChannelRemote); ok {
   155  		r0 = rf(id)
   156  	} else {
   157  		if ret.Get(0) != nil {
   158  			r0 = ret.Get(0).(*model.SharedChannelRemote)
   159  		}
   160  	}
   161  
   162  	var r1 error
   163  	if rf, ok := ret.Get(1).(func(string) error); ok {
   164  		r1 = rf(id)
   165  	} else {
   166  		r1 = ret.Error(1)
   167  	}
   168  
   169  	return r0, r1
   170  }
   171  
   172  // GetRemoteByIds provides a mock function with given fields: channelId, remoteId
   173  func (_m *SharedChannelStore) GetRemoteByIds(channelId string, remoteId string) (*model.SharedChannelRemote, error) {
   174  	ret := _m.Called(channelId, remoteId)
   175  
   176  	var r0 *model.SharedChannelRemote
   177  	if rf, ok := ret.Get(0).(func(string, string) *model.SharedChannelRemote); ok {
   178  		r0 = rf(channelId, remoteId)
   179  	} else {
   180  		if ret.Get(0) != nil {
   181  			r0 = ret.Get(0).(*model.SharedChannelRemote)
   182  		}
   183  	}
   184  
   185  	var r1 error
   186  	if rf, ok := ret.Get(1).(func(string, string) error); ok {
   187  		r1 = rf(channelId, remoteId)
   188  	} else {
   189  		r1 = ret.Error(1)
   190  	}
   191  
   192  	return r0, r1
   193  }
   194  
   195  // GetRemoteForUser provides a mock function with given fields: remoteId, userId
   196  func (_m *SharedChannelStore) GetRemoteForUser(remoteId string, userId string) (*model.RemoteCluster, error) {
   197  	ret := _m.Called(remoteId, userId)
   198  
   199  	var r0 *model.RemoteCluster
   200  	if rf, ok := ret.Get(0).(func(string, string) *model.RemoteCluster); ok {
   201  		r0 = rf(remoteId, userId)
   202  	} else {
   203  		if ret.Get(0) != nil {
   204  			r0 = ret.Get(0).(*model.RemoteCluster)
   205  		}
   206  	}
   207  
   208  	var r1 error
   209  	if rf, ok := ret.Get(1).(func(string, string) error); ok {
   210  		r1 = rf(remoteId, userId)
   211  	} else {
   212  		r1 = ret.Error(1)
   213  	}
   214  
   215  	return r0, r1
   216  }
   217  
   218  // GetRemotes provides a mock function with given fields: opts
   219  func (_m *SharedChannelStore) GetRemotes(opts model.SharedChannelRemoteFilterOpts) ([]*model.SharedChannelRemote, error) {
   220  	ret := _m.Called(opts)
   221  
   222  	var r0 []*model.SharedChannelRemote
   223  	if rf, ok := ret.Get(0).(func(model.SharedChannelRemoteFilterOpts) []*model.SharedChannelRemote); ok {
   224  		r0 = rf(opts)
   225  	} else {
   226  		if ret.Get(0) != nil {
   227  			r0 = ret.Get(0).([]*model.SharedChannelRemote)
   228  		}
   229  	}
   230  
   231  	var r1 error
   232  	if rf, ok := ret.Get(1).(func(model.SharedChannelRemoteFilterOpts) error); ok {
   233  		r1 = rf(opts)
   234  	} else {
   235  		r1 = ret.Error(1)
   236  	}
   237  
   238  	return r0, r1
   239  }
   240  
   241  // GetRemotesStatus provides a mock function with given fields: channelId
   242  func (_m *SharedChannelStore) GetRemotesStatus(channelId string) ([]*model.SharedChannelRemoteStatus, error) {
   243  	ret := _m.Called(channelId)
   244  
   245  	var r0 []*model.SharedChannelRemoteStatus
   246  	if rf, ok := ret.Get(0).(func(string) []*model.SharedChannelRemoteStatus); ok {
   247  		r0 = rf(channelId)
   248  	} else {
   249  		if ret.Get(0) != nil {
   250  			r0 = ret.Get(0).([]*model.SharedChannelRemoteStatus)
   251  		}
   252  	}
   253  
   254  	var r1 error
   255  	if rf, ok := ret.Get(1).(func(string) error); ok {
   256  		r1 = rf(channelId)
   257  	} else {
   258  		r1 = ret.Error(1)
   259  	}
   260  
   261  	return r0, r1
   262  }
   263  
   264  // GetSingleUser provides a mock function with given fields: userID, channelID, remoteID
   265  func (_m *SharedChannelStore) GetSingleUser(userID string, channelID string, remoteID string) (*model.SharedChannelUser, error) {
   266  	ret := _m.Called(userID, channelID, remoteID)
   267  
   268  	var r0 *model.SharedChannelUser
   269  	if rf, ok := ret.Get(0).(func(string, string, string) *model.SharedChannelUser); ok {
   270  		r0 = rf(userID, channelID, remoteID)
   271  	} else {
   272  		if ret.Get(0) != nil {
   273  			r0 = ret.Get(0).(*model.SharedChannelUser)
   274  		}
   275  	}
   276  
   277  	var r1 error
   278  	if rf, ok := ret.Get(1).(func(string, string, string) error); ok {
   279  		r1 = rf(userID, channelID, remoteID)
   280  	} else {
   281  		r1 = ret.Error(1)
   282  	}
   283  
   284  	return r0, r1
   285  }
   286  
   287  // GetUsersForSync provides a mock function with given fields: filter
   288  func (_m *SharedChannelStore) GetUsersForSync(filter model.GetUsersForSyncFilter) ([]*model.User, error) {
   289  	ret := _m.Called(filter)
   290  
   291  	var r0 []*model.User
   292  	if rf, ok := ret.Get(0).(func(model.GetUsersForSyncFilter) []*model.User); ok {
   293  		r0 = rf(filter)
   294  	} else {
   295  		if ret.Get(0) != nil {
   296  			r0 = ret.Get(0).([]*model.User)
   297  		}
   298  	}
   299  
   300  	var r1 error
   301  	if rf, ok := ret.Get(1).(func(model.GetUsersForSyncFilter) error); ok {
   302  		r1 = rf(filter)
   303  	} else {
   304  		r1 = ret.Error(1)
   305  	}
   306  
   307  	return r0, r1
   308  }
   309  
   310  // GetUsersForUser provides a mock function with given fields: userID
   311  func (_m *SharedChannelStore) GetUsersForUser(userID string) ([]*model.SharedChannelUser, error) {
   312  	ret := _m.Called(userID)
   313  
   314  	var r0 []*model.SharedChannelUser
   315  	if rf, ok := ret.Get(0).(func(string) []*model.SharedChannelUser); ok {
   316  		r0 = rf(userID)
   317  	} else {
   318  		if ret.Get(0) != nil {
   319  			r0 = ret.Get(0).([]*model.SharedChannelUser)
   320  		}
   321  	}
   322  
   323  	var r1 error
   324  	if rf, ok := ret.Get(1).(func(string) error); ok {
   325  		r1 = rf(userID)
   326  	} else {
   327  		r1 = ret.Error(1)
   328  	}
   329  
   330  	return r0, r1
   331  }
   332  
   333  // HasChannel provides a mock function with given fields: channelID
   334  func (_m *SharedChannelStore) HasChannel(channelID string) (bool, error) {
   335  	ret := _m.Called(channelID)
   336  
   337  	var r0 bool
   338  	if rf, ok := ret.Get(0).(func(string) bool); ok {
   339  		r0 = rf(channelID)
   340  	} else {
   341  		r0 = ret.Get(0).(bool)
   342  	}
   343  
   344  	var r1 error
   345  	if rf, ok := ret.Get(1).(func(string) error); ok {
   346  		r1 = rf(channelID)
   347  	} else {
   348  		r1 = ret.Error(1)
   349  	}
   350  
   351  	return r0, r1
   352  }
   353  
   354  // HasRemote provides a mock function with given fields: channelID, remoteId
   355  func (_m *SharedChannelStore) HasRemote(channelID string, remoteId string) (bool, error) {
   356  	ret := _m.Called(channelID, remoteId)
   357  
   358  	var r0 bool
   359  	if rf, ok := ret.Get(0).(func(string, string) bool); ok {
   360  		r0 = rf(channelID, remoteId)
   361  	} else {
   362  		r0 = ret.Get(0).(bool)
   363  	}
   364  
   365  	var r1 error
   366  	if rf, ok := ret.Get(1).(func(string, string) error); ok {
   367  		r1 = rf(channelID, remoteId)
   368  	} else {
   369  		r1 = ret.Error(1)
   370  	}
   371  
   372  	return r0, r1
   373  }
   374  
   375  // Save provides a mock function with given fields: sc
   376  func (_m *SharedChannelStore) Save(sc *model.SharedChannel) (*model.SharedChannel, error) {
   377  	ret := _m.Called(sc)
   378  
   379  	var r0 *model.SharedChannel
   380  	if rf, ok := ret.Get(0).(func(*model.SharedChannel) *model.SharedChannel); ok {
   381  		r0 = rf(sc)
   382  	} else {
   383  		if ret.Get(0) != nil {
   384  			r0 = ret.Get(0).(*model.SharedChannel)
   385  		}
   386  	}
   387  
   388  	var r1 error
   389  	if rf, ok := ret.Get(1).(func(*model.SharedChannel) error); ok {
   390  		r1 = rf(sc)
   391  	} else {
   392  		r1 = ret.Error(1)
   393  	}
   394  
   395  	return r0, r1
   396  }
   397  
   398  // SaveAttachment provides a mock function with given fields: remote
   399  func (_m *SharedChannelStore) SaveAttachment(remote *model.SharedChannelAttachment) (*model.SharedChannelAttachment, error) {
   400  	ret := _m.Called(remote)
   401  
   402  	var r0 *model.SharedChannelAttachment
   403  	if rf, ok := ret.Get(0).(func(*model.SharedChannelAttachment) *model.SharedChannelAttachment); ok {
   404  		r0 = rf(remote)
   405  	} else {
   406  		if ret.Get(0) != nil {
   407  			r0 = ret.Get(0).(*model.SharedChannelAttachment)
   408  		}
   409  	}
   410  
   411  	var r1 error
   412  	if rf, ok := ret.Get(1).(func(*model.SharedChannelAttachment) error); ok {
   413  		r1 = rf(remote)
   414  	} else {
   415  		r1 = ret.Error(1)
   416  	}
   417  
   418  	return r0, r1
   419  }
   420  
   421  // SaveRemote provides a mock function with given fields: remote
   422  func (_m *SharedChannelStore) SaveRemote(remote *model.SharedChannelRemote) (*model.SharedChannelRemote, error) {
   423  	ret := _m.Called(remote)
   424  
   425  	var r0 *model.SharedChannelRemote
   426  	if rf, ok := ret.Get(0).(func(*model.SharedChannelRemote) *model.SharedChannelRemote); ok {
   427  		r0 = rf(remote)
   428  	} else {
   429  		if ret.Get(0) != nil {
   430  			r0 = ret.Get(0).(*model.SharedChannelRemote)
   431  		}
   432  	}
   433  
   434  	var r1 error
   435  	if rf, ok := ret.Get(1).(func(*model.SharedChannelRemote) error); ok {
   436  		r1 = rf(remote)
   437  	} else {
   438  		r1 = ret.Error(1)
   439  	}
   440  
   441  	return r0, r1
   442  }
   443  
   444  // SaveUser provides a mock function with given fields: remote
   445  func (_m *SharedChannelStore) SaveUser(remote *model.SharedChannelUser) (*model.SharedChannelUser, error) {
   446  	ret := _m.Called(remote)
   447  
   448  	var r0 *model.SharedChannelUser
   449  	if rf, ok := ret.Get(0).(func(*model.SharedChannelUser) *model.SharedChannelUser); ok {
   450  		r0 = rf(remote)
   451  	} else {
   452  		if ret.Get(0) != nil {
   453  			r0 = ret.Get(0).(*model.SharedChannelUser)
   454  		}
   455  	}
   456  
   457  	var r1 error
   458  	if rf, ok := ret.Get(1).(func(*model.SharedChannelUser) error); ok {
   459  		r1 = rf(remote)
   460  	} else {
   461  		r1 = ret.Error(1)
   462  	}
   463  
   464  	return r0, r1
   465  }
   466  
   467  // Update provides a mock function with given fields: sc
   468  func (_m *SharedChannelStore) Update(sc *model.SharedChannel) (*model.SharedChannel, error) {
   469  	ret := _m.Called(sc)
   470  
   471  	var r0 *model.SharedChannel
   472  	if rf, ok := ret.Get(0).(func(*model.SharedChannel) *model.SharedChannel); ok {
   473  		r0 = rf(sc)
   474  	} else {
   475  		if ret.Get(0) != nil {
   476  			r0 = ret.Get(0).(*model.SharedChannel)
   477  		}
   478  	}
   479  
   480  	var r1 error
   481  	if rf, ok := ret.Get(1).(func(*model.SharedChannel) error); ok {
   482  		r1 = rf(sc)
   483  	} else {
   484  		r1 = ret.Error(1)
   485  	}
   486  
   487  	return r0, r1
   488  }
   489  
   490  // UpdateAttachmentLastSyncAt provides a mock function with given fields: id, syncTime
   491  func (_m *SharedChannelStore) UpdateAttachmentLastSyncAt(id string, syncTime int64) error {
   492  	ret := _m.Called(id, syncTime)
   493  
   494  	var r0 error
   495  	if rf, ok := ret.Get(0).(func(string, int64) error); ok {
   496  		r0 = rf(id, syncTime)
   497  	} else {
   498  		r0 = ret.Error(0)
   499  	}
   500  
   501  	return r0
   502  }
   503  
   504  // UpdateRemote provides a mock function with given fields: remote
   505  func (_m *SharedChannelStore) UpdateRemote(remote *model.SharedChannelRemote) (*model.SharedChannelRemote, error) {
   506  	ret := _m.Called(remote)
   507  
   508  	var r0 *model.SharedChannelRemote
   509  	if rf, ok := ret.Get(0).(func(*model.SharedChannelRemote) *model.SharedChannelRemote); ok {
   510  		r0 = rf(remote)
   511  	} else {
   512  		if ret.Get(0) != nil {
   513  			r0 = ret.Get(0).(*model.SharedChannelRemote)
   514  		}
   515  	}
   516  
   517  	var r1 error
   518  	if rf, ok := ret.Get(1).(func(*model.SharedChannelRemote) error); ok {
   519  		r1 = rf(remote)
   520  	} else {
   521  		r1 = ret.Error(1)
   522  	}
   523  
   524  	return r0, r1
   525  }
   526  
   527  // UpdateRemoteCursor provides a mock function with given fields: id, cursor
   528  func (_m *SharedChannelStore) UpdateRemoteCursor(id string, cursor model.GetPostsSinceForSyncCursor) error {
   529  	ret := _m.Called(id, cursor)
   530  
   531  	var r0 error
   532  	if rf, ok := ret.Get(0).(func(string, model.GetPostsSinceForSyncCursor) error); ok {
   533  		r0 = rf(id, cursor)
   534  	} else {
   535  		r0 = ret.Error(0)
   536  	}
   537  
   538  	return r0
   539  }
   540  
   541  // UpdateUserLastSyncAt provides a mock function with given fields: userID, channelID, remoteID
   542  func (_m *SharedChannelStore) UpdateUserLastSyncAt(userID string, channelID string, remoteID string) error {
   543  	ret := _m.Called(userID, channelID, remoteID)
   544  
   545  	var r0 error
   546  	if rf, ok := ret.Get(0).(func(string, string, string) error); ok {
   547  		r0 = rf(userID, channelID, remoteID)
   548  	} else {
   549  		r0 = ret.Error(0)
   550  	}
   551  
   552  	return r0
   553  }
   554  
   555  // UpsertAttachment provides a mock function with given fields: remote
   556  func (_m *SharedChannelStore) UpsertAttachment(remote *model.SharedChannelAttachment) (string, error) {
   557  	ret := _m.Called(remote)
   558  
   559  	var r0 string
   560  	if rf, ok := ret.Get(0).(func(*model.SharedChannelAttachment) string); ok {
   561  		r0 = rf(remote)
   562  	} else {
   563  		r0 = ret.Get(0).(string)
   564  	}
   565  
   566  	var r1 error
   567  	if rf, ok := ret.Get(1).(func(*model.SharedChannelAttachment) error); ok {
   568  		r1 = rf(remote)
   569  	} else {
   570  		r1 = ret.Error(1)
   571  	}
   572  
   573  	return r0, r1
   574  }