mocks_test.go 157 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589
  1. // Code generated by go-mockgen 1.3.7; DO NOT EDIT.
  2. //
  3. // This file was generated by running `go-mockgen` at the root of this repository.
  4. // To add additional mocks to this or another package, add a new entry to the
  5. // mockgen.yaml file in the root of this repository.
  6. package lfs
  7. import (
  8. "context"
  9. "sync"
  10. database "gogs.io/gogs/internal/database"
  11. lfsutil "gogs.io/gogs/internal/lfsutil"
  12. )
  13. // MockUsersStore is a mock implementation of the UsersStore interface (from
  14. // the package gogs.io/gogs/internal/database) used for unit testing.
  15. type MockUsersStore struct {
  16. // AddEmailFunc is an instance of a mock function object controlling the
  17. // behavior of the method AddEmail.
  18. AddEmailFunc *UsersStoreAddEmailFunc
  19. // AuthenticateFunc is an instance of a mock function object controlling
  20. // the behavior of the method Authenticate.
  21. AuthenticateFunc *UsersStoreAuthenticateFunc
  22. // ChangeUsernameFunc is an instance of a mock function object
  23. // controlling the behavior of the method ChangeUsername.
  24. ChangeUsernameFunc *UsersStoreChangeUsernameFunc
  25. // CountFunc is an instance of a mock function object controlling the
  26. // behavior of the method Count.
  27. CountFunc *UsersStoreCountFunc
  28. // CreateFunc is an instance of a mock function object controlling the
  29. // behavior of the method Create.
  30. CreateFunc *UsersStoreCreateFunc
  31. // DeleteByIDFunc is an instance of a mock function object controlling
  32. // the behavior of the method DeleteByID.
  33. DeleteByIDFunc *UsersStoreDeleteByIDFunc
  34. // DeleteCustomAvatarFunc is an instance of a mock function object
  35. // controlling the behavior of the method DeleteCustomAvatar.
  36. DeleteCustomAvatarFunc *UsersStoreDeleteCustomAvatarFunc
  37. // DeleteEmailFunc is an instance of a mock function object controlling
  38. // the behavior of the method DeleteEmail.
  39. DeleteEmailFunc *UsersStoreDeleteEmailFunc
  40. // DeleteInactivatedFunc is an instance of a mock function object
  41. // controlling the behavior of the method DeleteInactivated.
  42. DeleteInactivatedFunc *UsersStoreDeleteInactivatedFunc
  43. // FollowFunc is an instance of a mock function object controlling the
  44. // behavior of the method Follow.
  45. FollowFunc *UsersStoreFollowFunc
  46. // GetByEmailFunc is an instance of a mock function object controlling
  47. // the behavior of the method GetByEmail.
  48. GetByEmailFunc *UsersStoreGetByEmailFunc
  49. // GetByIDFunc is an instance of a mock function object controlling the
  50. // behavior of the method GetByID.
  51. GetByIDFunc *UsersStoreGetByIDFunc
  52. // GetByKeyIDFunc is an instance of a mock function object controlling
  53. // the behavior of the method GetByKeyID.
  54. GetByKeyIDFunc *UsersStoreGetByKeyIDFunc
  55. // GetByUsernameFunc is an instance of a mock function object
  56. // controlling the behavior of the method GetByUsername.
  57. GetByUsernameFunc *UsersStoreGetByUsernameFunc
  58. // GetEmailFunc is an instance of a mock function object controlling the
  59. // behavior of the method GetEmail.
  60. GetEmailFunc *UsersStoreGetEmailFunc
  61. // GetMailableEmailsByUsernamesFunc is an instance of a mock function
  62. // object controlling the behavior of the method
  63. // GetMailableEmailsByUsernames.
  64. GetMailableEmailsByUsernamesFunc *UsersStoreGetMailableEmailsByUsernamesFunc
  65. // IsFollowingFunc is an instance of a mock function object controlling
  66. // the behavior of the method IsFollowing.
  67. IsFollowingFunc *UsersStoreIsFollowingFunc
  68. // IsUsernameUsedFunc is an instance of a mock function object
  69. // controlling the behavior of the method IsUsernameUsed.
  70. IsUsernameUsedFunc *UsersStoreIsUsernameUsedFunc
  71. // ListFunc is an instance of a mock function object controlling the
  72. // behavior of the method List.
  73. ListFunc *UsersStoreListFunc
  74. // ListEmailsFunc is an instance of a mock function object controlling
  75. // the behavior of the method ListEmails.
  76. ListEmailsFunc *UsersStoreListEmailsFunc
  77. // ListFollowersFunc is an instance of a mock function object
  78. // controlling the behavior of the method ListFollowers.
  79. ListFollowersFunc *UsersStoreListFollowersFunc
  80. // ListFollowingsFunc is an instance of a mock function object
  81. // controlling the behavior of the method ListFollowings.
  82. ListFollowingsFunc *UsersStoreListFollowingsFunc
  83. // MarkEmailActivatedFunc is an instance of a mock function object
  84. // controlling the behavior of the method MarkEmailActivated.
  85. MarkEmailActivatedFunc *UsersStoreMarkEmailActivatedFunc
  86. // MarkEmailPrimaryFunc is an instance of a mock function object
  87. // controlling the behavior of the method MarkEmailPrimary.
  88. MarkEmailPrimaryFunc *UsersStoreMarkEmailPrimaryFunc
  89. // SearchByNameFunc is an instance of a mock function object controlling
  90. // the behavior of the method SearchByName.
  91. SearchByNameFunc *UsersStoreSearchByNameFunc
  92. // UnfollowFunc is an instance of a mock function object controlling the
  93. // behavior of the method Unfollow.
  94. UnfollowFunc *UsersStoreUnfollowFunc
  95. // UpdateFunc is an instance of a mock function object controlling the
  96. // behavior of the method Update.
  97. UpdateFunc *UsersStoreUpdateFunc
  98. // UseCustomAvatarFunc is an instance of a mock function object
  99. // controlling the behavior of the method UseCustomAvatar.
  100. UseCustomAvatarFunc *UsersStoreUseCustomAvatarFunc
  101. }
  102. // NewMockUsersStore creates a new mock of the UsersStore interface. All
  103. // methods return zero values for all results, unless overwritten.
  104. func NewMockUsersStore() *MockUsersStore {
  105. return &MockUsersStore{
  106. AddEmailFunc: &UsersStoreAddEmailFunc{
  107. defaultHook: func(context.Context, int64, string, bool) (r0 error) {
  108. return
  109. },
  110. },
  111. AuthenticateFunc: &UsersStoreAuthenticateFunc{
  112. defaultHook: func(context.Context, string, string, int64) (r0 *database.User, r1 error) {
  113. return
  114. },
  115. },
  116. ChangeUsernameFunc: &UsersStoreChangeUsernameFunc{
  117. defaultHook: func(context.Context, int64, string) (r0 error) {
  118. return
  119. },
  120. },
  121. CountFunc: &UsersStoreCountFunc{
  122. defaultHook: func(context.Context) (r0 int64) {
  123. return
  124. },
  125. },
  126. CreateFunc: &UsersStoreCreateFunc{
  127. defaultHook: func(context.Context, string, string, database.CreateUserOptions) (r0 *database.User, r1 error) {
  128. return
  129. },
  130. },
  131. DeleteByIDFunc: &UsersStoreDeleteByIDFunc{
  132. defaultHook: func(context.Context, int64, bool) (r0 error) {
  133. return
  134. },
  135. },
  136. DeleteCustomAvatarFunc: &UsersStoreDeleteCustomAvatarFunc{
  137. defaultHook: func(context.Context, int64) (r0 error) {
  138. return
  139. },
  140. },
  141. DeleteEmailFunc: &UsersStoreDeleteEmailFunc{
  142. defaultHook: func(context.Context, int64, string) (r0 error) {
  143. return
  144. },
  145. },
  146. DeleteInactivatedFunc: &UsersStoreDeleteInactivatedFunc{
  147. defaultHook: func() (r0 error) {
  148. return
  149. },
  150. },
  151. FollowFunc: &UsersStoreFollowFunc{
  152. defaultHook: func(context.Context, int64, int64) (r0 error) {
  153. return
  154. },
  155. },
  156. GetByEmailFunc: &UsersStoreGetByEmailFunc{
  157. defaultHook: func(context.Context, string) (r0 *database.User, r1 error) {
  158. return
  159. },
  160. },
  161. GetByIDFunc: &UsersStoreGetByIDFunc{
  162. defaultHook: func(context.Context, int64) (r0 *database.User, r1 error) {
  163. return
  164. },
  165. },
  166. GetByKeyIDFunc: &UsersStoreGetByKeyIDFunc{
  167. defaultHook: func(context.Context, int64) (r0 *database.User, r1 error) {
  168. return
  169. },
  170. },
  171. GetByUsernameFunc: &UsersStoreGetByUsernameFunc{
  172. defaultHook: func(context.Context, string) (r0 *database.User, r1 error) {
  173. return
  174. },
  175. },
  176. GetEmailFunc: &UsersStoreGetEmailFunc{
  177. defaultHook: func(context.Context, int64, string, bool) (r0 *database.EmailAddress, r1 error) {
  178. return
  179. },
  180. },
  181. GetMailableEmailsByUsernamesFunc: &UsersStoreGetMailableEmailsByUsernamesFunc{
  182. defaultHook: func(context.Context, []string) (r0 []string, r1 error) {
  183. return
  184. },
  185. },
  186. IsFollowingFunc: &UsersStoreIsFollowingFunc{
  187. defaultHook: func(context.Context, int64, int64) (r0 bool) {
  188. return
  189. },
  190. },
  191. IsUsernameUsedFunc: &UsersStoreIsUsernameUsedFunc{
  192. defaultHook: func(context.Context, string, int64) (r0 bool) {
  193. return
  194. },
  195. },
  196. ListFunc: &UsersStoreListFunc{
  197. defaultHook: func(context.Context, int, int) (r0 []*database.User, r1 error) {
  198. return
  199. },
  200. },
  201. ListEmailsFunc: &UsersStoreListEmailsFunc{
  202. defaultHook: func(context.Context, int64) (r0 []*database.EmailAddress, r1 error) {
  203. return
  204. },
  205. },
  206. ListFollowersFunc: &UsersStoreListFollowersFunc{
  207. defaultHook: func(context.Context, int64, int, int) (r0 []*database.User, r1 error) {
  208. return
  209. },
  210. },
  211. ListFollowingsFunc: &UsersStoreListFollowingsFunc{
  212. defaultHook: func(context.Context, int64, int, int) (r0 []*database.User, r1 error) {
  213. return
  214. },
  215. },
  216. MarkEmailActivatedFunc: &UsersStoreMarkEmailActivatedFunc{
  217. defaultHook: func(context.Context, int64, string) (r0 error) {
  218. return
  219. },
  220. },
  221. MarkEmailPrimaryFunc: &UsersStoreMarkEmailPrimaryFunc{
  222. defaultHook: func(context.Context, int64, string) (r0 error) {
  223. return
  224. },
  225. },
  226. SearchByNameFunc: &UsersStoreSearchByNameFunc{
  227. defaultHook: func(context.Context, string, int, int, string) (r0 []*database.User, r1 int64, r2 error) {
  228. return
  229. },
  230. },
  231. UnfollowFunc: &UsersStoreUnfollowFunc{
  232. defaultHook: func(context.Context, int64, int64) (r0 error) {
  233. return
  234. },
  235. },
  236. UpdateFunc: &UsersStoreUpdateFunc{
  237. defaultHook: func(context.Context, int64, database.UpdateUserOptions) (r0 error) {
  238. return
  239. },
  240. },
  241. UseCustomAvatarFunc: &UsersStoreUseCustomAvatarFunc{
  242. defaultHook: func(context.Context, int64, []byte) (r0 error) {
  243. return
  244. },
  245. },
  246. }
  247. }
  248. // NewStrictMockUsersStore creates a new mock of the UsersStore interface.
  249. // All methods panic on invocation, unless overwritten.
  250. func NewStrictMockUsersStore() *MockUsersStore {
  251. return &MockUsersStore{
  252. AddEmailFunc: &UsersStoreAddEmailFunc{
  253. defaultHook: func(context.Context, int64, string, bool) error {
  254. panic("unexpected invocation of MockUsersStore.AddEmail")
  255. },
  256. },
  257. AuthenticateFunc: &UsersStoreAuthenticateFunc{
  258. defaultHook: func(context.Context, string, string, int64) (*database.User, error) {
  259. panic("unexpected invocation of MockUsersStore.Authenticate")
  260. },
  261. },
  262. ChangeUsernameFunc: &UsersStoreChangeUsernameFunc{
  263. defaultHook: func(context.Context, int64, string) error {
  264. panic("unexpected invocation of MockUsersStore.ChangeUsername")
  265. },
  266. },
  267. CountFunc: &UsersStoreCountFunc{
  268. defaultHook: func(context.Context) int64 {
  269. panic("unexpected invocation of MockUsersStore.Count")
  270. },
  271. },
  272. CreateFunc: &UsersStoreCreateFunc{
  273. defaultHook: func(context.Context, string, string, database.CreateUserOptions) (*database.User, error) {
  274. panic("unexpected invocation of MockUsersStore.Create")
  275. },
  276. },
  277. DeleteByIDFunc: &UsersStoreDeleteByIDFunc{
  278. defaultHook: func(context.Context, int64, bool) error {
  279. panic("unexpected invocation of MockUsersStore.DeleteByID")
  280. },
  281. },
  282. DeleteCustomAvatarFunc: &UsersStoreDeleteCustomAvatarFunc{
  283. defaultHook: func(context.Context, int64) error {
  284. panic("unexpected invocation of MockUsersStore.DeleteCustomAvatar")
  285. },
  286. },
  287. DeleteEmailFunc: &UsersStoreDeleteEmailFunc{
  288. defaultHook: func(context.Context, int64, string) error {
  289. panic("unexpected invocation of MockUsersStore.DeleteEmail")
  290. },
  291. },
  292. DeleteInactivatedFunc: &UsersStoreDeleteInactivatedFunc{
  293. defaultHook: func() error {
  294. panic("unexpected invocation of MockUsersStore.DeleteInactivated")
  295. },
  296. },
  297. FollowFunc: &UsersStoreFollowFunc{
  298. defaultHook: func(context.Context, int64, int64) error {
  299. panic("unexpected invocation of MockUsersStore.Follow")
  300. },
  301. },
  302. GetByEmailFunc: &UsersStoreGetByEmailFunc{
  303. defaultHook: func(context.Context, string) (*database.User, error) {
  304. panic("unexpected invocation of MockUsersStore.GetByEmail")
  305. },
  306. },
  307. GetByIDFunc: &UsersStoreGetByIDFunc{
  308. defaultHook: func(context.Context, int64) (*database.User, error) {
  309. panic("unexpected invocation of MockUsersStore.GetByID")
  310. },
  311. },
  312. GetByKeyIDFunc: &UsersStoreGetByKeyIDFunc{
  313. defaultHook: func(context.Context, int64) (*database.User, error) {
  314. panic("unexpected invocation of MockUsersStore.GetByKeyID")
  315. },
  316. },
  317. GetByUsernameFunc: &UsersStoreGetByUsernameFunc{
  318. defaultHook: func(context.Context, string) (*database.User, error) {
  319. panic("unexpected invocation of MockUsersStore.GetByUsername")
  320. },
  321. },
  322. GetEmailFunc: &UsersStoreGetEmailFunc{
  323. defaultHook: func(context.Context, int64, string, bool) (*database.EmailAddress, error) {
  324. panic("unexpected invocation of MockUsersStore.GetEmail")
  325. },
  326. },
  327. GetMailableEmailsByUsernamesFunc: &UsersStoreGetMailableEmailsByUsernamesFunc{
  328. defaultHook: func(context.Context, []string) ([]string, error) {
  329. panic("unexpected invocation of MockUsersStore.GetMailableEmailsByUsernames")
  330. },
  331. },
  332. IsFollowingFunc: &UsersStoreIsFollowingFunc{
  333. defaultHook: func(context.Context, int64, int64) bool {
  334. panic("unexpected invocation of MockUsersStore.IsFollowing")
  335. },
  336. },
  337. IsUsernameUsedFunc: &UsersStoreIsUsernameUsedFunc{
  338. defaultHook: func(context.Context, string, int64) bool {
  339. panic("unexpected invocation of MockUsersStore.IsUsernameUsed")
  340. },
  341. },
  342. ListFunc: &UsersStoreListFunc{
  343. defaultHook: func(context.Context, int, int) ([]*database.User, error) {
  344. panic("unexpected invocation of MockUsersStore.List")
  345. },
  346. },
  347. ListEmailsFunc: &UsersStoreListEmailsFunc{
  348. defaultHook: func(context.Context, int64) ([]*database.EmailAddress, error) {
  349. panic("unexpected invocation of MockUsersStore.ListEmails")
  350. },
  351. },
  352. ListFollowersFunc: &UsersStoreListFollowersFunc{
  353. defaultHook: func(context.Context, int64, int, int) ([]*database.User, error) {
  354. panic("unexpected invocation of MockUsersStore.ListFollowers")
  355. },
  356. },
  357. ListFollowingsFunc: &UsersStoreListFollowingsFunc{
  358. defaultHook: func(context.Context, int64, int, int) ([]*database.User, error) {
  359. panic("unexpected invocation of MockUsersStore.ListFollowings")
  360. },
  361. },
  362. MarkEmailActivatedFunc: &UsersStoreMarkEmailActivatedFunc{
  363. defaultHook: func(context.Context, int64, string) error {
  364. panic("unexpected invocation of MockUsersStore.MarkEmailActivated")
  365. },
  366. },
  367. MarkEmailPrimaryFunc: &UsersStoreMarkEmailPrimaryFunc{
  368. defaultHook: func(context.Context, int64, string) error {
  369. panic("unexpected invocation of MockUsersStore.MarkEmailPrimary")
  370. },
  371. },
  372. SearchByNameFunc: &UsersStoreSearchByNameFunc{
  373. defaultHook: func(context.Context, string, int, int, string) ([]*database.User, int64, error) {
  374. panic("unexpected invocation of MockUsersStore.SearchByName")
  375. },
  376. },
  377. UnfollowFunc: &UsersStoreUnfollowFunc{
  378. defaultHook: func(context.Context, int64, int64) error {
  379. panic("unexpected invocation of MockUsersStore.Unfollow")
  380. },
  381. },
  382. UpdateFunc: &UsersStoreUpdateFunc{
  383. defaultHook: func(context.Context, int64, database.UpdateUserOptions) error {
  384. panic("unexpected invocation of MockUsersStore.Update")
  385. },
  386. },
  387. UseCustomAvatarFunc: &UsersStoreUseCustomAvatarFunc{
  388. defaultHook: func(context.Context, int64, []byte) error {
  389. panic("unexpected invocation of MockUsersStore.UseCustomAvatar")
  390. },
  391. },
  392. }
  393. }
  394. // NewMockUsersStoreFrom creates a new mock of the MockUsersStore interface.
  395. // All methods delegate to the given implementation, unless overwritten.
  396. func NewMockUsersStoreFrom(i database.UsersStore) *MockUsersStore {
  397. return &MockUsersStore{
  398. AddEmailFunc: &UsersStoreAddEmailFunc{
  399. defaultHook: i.AddEmail,
  400. },
  401. AuthenticateFunc: &UsersStoreAuthenticateFunc{
  402. defaultHook: i.Authenticate,
  403. },
  404. ChangeUsernameFunc: &UsersStoreChangeUsernameFunc{
  405. defaultHook: i.ChangeUsername,
  406. },
  407. CountFunc: &UsersStoreCountFunc{
  408. defaultHook: i.Count,
  409. },
  410. CreateFunc: &UsersStoreCreateFunc{
  411. defaultHook: i.Create,
  412. },
  413. DeleteByIDFunc: &UsersStoreDeleteByIDFunc{
  414. defaultHook: i.DeleteByID,
  415. },
  416. DeleteCustomAvatarFunc: &UsersStoreDeleteCustomAvatarFunc{
  417. defaultHook: i.DeleteCustomAvatar,
  418. },
  419. DeleteEmailFunc: &UsersStoreDeleteEmailFunc{
  420. defaultHook: i.DeleteEmail,
  421. },
  422. DeleteInactivatedFunc: &UsersStoreDeleteInactivatedFunc{
  423. defaultHook: i.DeleteInactivated,
  424. },
  425. FollowFunc: &UsersStoreFollowFunc{
  426. defaultHook: i.Follow,
  427. },
  428. GetByEmailFunc: &UsersStoreGetByEmailFunc{
  429. defaultHook: i.GetByEmail,
  430. },
  431. GetByIDFunc: &UsersStoreGetByIDFunc{
  432. defaultHook: i.GetByID,
  433. },
  434. GetByKeyIDFunc: &UsersStoreGetByKeyIDFunc{
  435. defaultHook: i.GetByKeyID,
  436. },
  437. GetByUsernameFunc: &UsersStoreGetByUsernameFunc{
  438. defaultHook: i.GetByUsername,
  439. },
  440. GetEmailFunc: &UsersStoreGetEmailFunc{
  441. defaultHook: i.GetEmail,
  442. },
  443. GetMailableEmailsByUsernamesFunc: &UsersStoreGetMailableEmailsByUsernamesFunc{
  444. defaultHook: i.GetMailableEmailsByUsernames,
  445. },
  446. IsFollowingFunc: &UsersStoreIsFollowingFunc{
  447. defaultHook: i.IsFollowing,
  448. },
  449. IsUsernameUsedFunc: &UsersStoreIsUsernameUsedFunc{
  450. defaultHook: i.IsUsernameUsed,
  451. },
  452. ListFunc: &UsersStoreListFunc{
  453. defaultHook: i.List,
  454. },
  455. ListEmailsFunc: &UsersStoreListEmailsFunc{
  456. defaultHook: i.ListEmails,
  457. },
  458. ListFollowersFunc: &UsersStoreListFollowersFunc{
  459. defaultHook: i.ListFollowers,
  460. },
  461. ListFollowingsFunc: &UsersStoreListFollowingsFunc{
  462. defaultHook: i.ListFollowings,
  463. },
  464. MarkEmailActivatedFunc: &UsersStoreMarkEmailActivatedFunc{
  465. defaultHook: i.MarkEmailActivated,
  466. },
  467. MarkEmailPrimaryFunc: &UsersStoreMarkEmailPrimaryFunc{
  468. defaultHook: i.MarkEmailPrimary,
  469. },
  470. SearchByNameFunc: &UsersStoreSearchByNameFunc{
  471. defaultHook: i.SearchByName,
  472. },
  473. UnfollowFunc: &UsersStoreUnfollowFunc{
  474. defaultHook: i.Unfollow,
  475. },
  476. UpdateFunc: &UsersStoreUpdateFunc{
  477. defaultHook: i.Update,
  478. },
  479. UseCustomAvatarFunc: &UsersStoreUseCustomAvatarFunc{
  480. defaultHook: i.UseCustomAvatar,
  481. },
  482. }
  483. }
  484. // UsersStoreAddEmailFunc describes the behavior when the AddEmail method of
  485. // the parent MockUsersStore instance is invoked.
  486. type UsersStoreAddEmailFunc struct {
  487. defaultHook func(context.Context, int64, string, bool) error
  488. hooks []func(context.Context, int64, string, bool) error
  489. history []UsersStoreAddEmailFuncCall
  490. mutex sync.Mutex
  491. }
  492. // AddEmail delegates to the next hook function in the queue and stores the
  493. // parameter and result values of this invocation.
  494. func (m *MockUsersStore) AddEmail(v0 context.Context, v1 int64, v2 string, v3 bool) error {
  495. r0 := m.AddEmailFunc.nextHook()(v0, v1, v2, v3)
  496. m.AddEmailFunc.appendCall(UsersStoreAddEmailFuncCall{v0, v1, v2, v3, r0})
  497. return r0
  498. }
  499. // SetDefaultHook sets function that is called when the AddEmail method of
  500. // the parent MockUsersStore instance is invoked and the hook queue is
  501. // empty.
  502. func (f *UsersStoreAddEmailFunc) SetDefaultHook(hook func(context.Context, int64, string, bool) error) {
  503. f.defaultHook = hook
  504. }
  505. // PushHook adds a function to the end of hook queue. Each invocation of the
  506. // AddEmail method of the parent MockUsersStore instance invokes the hook at
  507. // the front of the queue and discards it. After the queue is empty, the
  508. // default hook function is invoked for any future action.
  509. func (f *UsersStoreAddEmailFunc) PushHook(hook func(context.Context, int64, string, bool) error) {
  510. f.mutex.Lock()
  511. f.hooks = append(f.hooks, hook)
  512. f.mutex.Unlock()
  513. }
  514. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  515. // given values.
  516. func (f *UsersStoreAddEmailFunc) SetDefaultReturn(r0 error) {
  517. f.SetDefaultHook(func(context.Context, int64, string, bool) error {
  518. return r0
  519. })
  520. }
  521. // PushReturn calls PushHook with a function that returns the given values.
  522. func (f *UsersStoreAddEmailFunc) PushReturn(r0 error) {
  523. f.PushHook(func(context.Context, int64, string, bool) error {
  524. return r0
  525. })
  526. }
  527. func (f *UsersStoreAddEmailFunc) nextHook() func(context.Context, int64, string, bool) error {
  528. f.mutex.Lock()
  529. defer f.mutex.Unlock()
  530. if len(f.hooks) == 0 {
  531. return f.defaultHook
  532. }
  533. hook := f.hooks[0]
  534. f.hooks = f.hooks[1:]
  535. return hook
  536. }
  537. func (f *UsersStoreAddEmailFunc) appendCall(r0 UsersStoreAddEmailFuncCall) {
  538. f.mutex.Lock()
  539. f.history = append(f.history, r0)
  540. f.mutex.Unlock()
  541. }
  542. // History returns a sequence of UsersStoreAddEmailFuncCall objects
  543. // describing the invocations of this function.
  544. func (f *UsersStoreAddEmailFunc) History() []UsersStoreAddEmailFuncCall {
  545. f.mutex.Lock()
  546. history := make([]UsersStoreAddEmailFuncCall, len(f.history))
  547. copy(history, f.history)
  548. f.mutex.Unlock()
  549. return history
  550. }
  551. // UsersStoreAddEmailFuncCall is an object that describes an invocation of
  552. // method AddEmail on an instance of MockUsersStore.
  553. type UsersStoreAddEmailFuncCall struct {
  554. // Arg0 is the value of the 1st argument passed to this method
  555. // invocation.
  556. Arg0 context.Context
  557. // Arg1 is the value of the 2nd argument passed to this method
  558. // invocation.
  559. Arg1 int64
  560. // Arg2 is the value of the 3rd argument passed to this method
  561. // invocation.
  562. Arg2 string
  563. // Arg3 is the value of the 4th argument passed to this method
  564. // invocation.
  565. Arg3 bool
  566. // Result0 is the value of the 1st result returned from this method
  567. // invocation.
  568. Result0 error
  569. }
  570. // Args returns an interface slice containing the arguments of this
  571. // invocation.
  572. func (c UsersStoreAddEmailFuncCall) Args() []interface{} {
  573. return []interface{}{c.Arg0, c.Arg1, c.Arg2, c.Arg3}
  574. }
  575. // Results returns an interface slice containing the results of this
  576. // invocation.
  577. func (c UsersStoreAddEmailFuncCall) Results() []interface{} {
  578. return []interface{}{c.Result0}
  579. }
  580. // UsersStoreAuthenticateFunc describes the behavior when the Authenticate
  581. // method of the parent MockUsersStore instance is invoked.
  582. type UsersStoreAuthenticateFunc struct {
  583. defaultHook func(context.Context, string, string, int64) (*database.User, error)
  584. hooks []func(context.Context, string, string, int64) (*database.User, error)
  585. history []UsersStoreAuthenticateFuncCall
  586. mutex sync.Mutex
  587. }
  588. // Authenticate delegates to the next hook function in the queue and stores
  589. // the parameter and result values of this invocation.
  590. func (m *MockUsersStore) Authenticate(v0 context.Context, v1 string, v2 string, v3 int64) (*database.User, error) {
  591. r0, r1 := m.AuthenticateFunc.nextHook()(v0, v1, v2, v3)
  592. m.AuthenticateFunc.appendCall(UsersStoreAuthenticateFuncCall{v0, v1, v2, v3, r0, r1})
  593. return r0, r1
  594. }
  595. // SetDefaultHook sets function that is called when the Authenticate method
  596. // of the parent MockUsersStore instance is invoked and the hook queue is
  597. // empty.
  598. func (f *UsersStoreAuthenticateFunc) SetDefaultHook(hook func(context.Context, string, string, int64) (*database.User, error)) {
  599. f.defaultHook = hook
  600. }
  601. // PushHook adds a function to the end of hook queue. Each invocation of the
  602. // Authenticate method of the parent MockUsersStore instance invokes the
  603. // hook at the front of the queue and discards it. After the queue is empty,
  604. // the default hook function is invoked for any future action.
  605. func (f *UsersStoreAuthenticateFunc) PushHook(hook func(context.Context, string, string, int64) (*database.User, error)) {
  606. f.mutex.Lock()
  607. f.hooks = append(f.hooks, hook)
  608. f.mutex.Unlock()
  609. }
  610. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  611. // given values.
  612. func (f *UsersStoreAuthenticateFunc) SetDefaultReturn(r0 *database.User, r1 error) {
  613. f.SetDefaultHook(func(context.Context, string, string, int64) (*database.User, error) {
  614. return r0, r1
  615. })
  616. }
  617. // PushReturn calls PushHook with a function that returns the given values.
  618. func (f *UsersStoreAuthenticateFunc) PushReturn(r0 *database.User, r1 error) {
  619. f.PushHook(func(context.Context, string, string, int64) (*database.User, error) {
  620. return r0, r1
  621. })
  622. }
  623. func (f *UsersStoreAuthenticateFunc) nextHook() func(context.Context, string, string, int64) (*database.User, error) {
  624. f.mutex.Lock()
  625. defer f.mutex.Unlock()
  626. if len(f.hooks) == 0 {
  627. return f.defaultHook
  628. }
  629. hook := f.hooks[0]
  630. f.hooks = f.hooks[1:]
  631. return hook
  632. }
  633. func (f *UsersStoreAuthenticateFunc) appendCall(r0 UsersStoreAuthenticateFuncCall) {
  634. f.mutex.Lock()
  635. f.history = append(f.history, r0)
  636. f.mutex.Unlock()
  637. }
  638. // History returns a sequence of UsersStoreAuthenticateFuncCall objects
  639. // describing the invocations of this function.
  640. func (f *UsersStoreAuthenticateFunc) History() []UsersStoreAuthenticateFuncCall {
  641. f.mutex.Lock()
  642. history := make([]UsersStoreAuthenticateFuncCall, len(f.history))
  643. copy(history, f.history)
  644. f.mutex.Unlock()
  645. return history
  646. }
  647. // UsersStoreAuthenticateFuncCall is an object that describes an invocation
  648. // of method Authenticate on an instance of MockUsersStore.
  649. type UsersStoreAuthenticateFuncCall struct {
  650. // Arg0 is the value of the 1st argument passed to this method
  651. // invocation.
  652. Arg0 context.Context
  653. // Arg1 is the value of the 2nd argument passed to this method
  654. // invocation.
  655. Arg1 string
  656. // Arg2 is the value of the 3rd argument passed to this method
  657. // invocation.
  658. Arg2 string
  659. // Arg3 is the value of the 4th argument passed to this method
  660. // invocation.
  661. Arg3 int64
  662. // Result0 is the value of the 1st result returned from this method
  663. // invocation.
  664. Result0 *database.User
  665. // Result1 is the value of the 2nd result returned from this method
  666. // invocation.
  667. Result1 error
  668. }
  669. // Args returns an interface slice containing the arguments of this
  670. // invocation.
  671. func (c UsersStoreAuthenticateFuncCall) Args() []interface{} {
  672. return []interface{}{c.Arg0, c.Arg1, c.Arg2, c.Arg3}
  673. }
  674. // Results returns an interface slice containing the results of this
  675. // invocation.
  676. func (c UsersStoreAuthenticateFuncCall) Results() []interface{} {
  677. return []interface{}{c.Result0, c.Result1}
  678. }
  679. // UsersStoreChangeUsernameFunc describes the behavior when the
  680. // ChangeUsername method of the parent MockUsersStore instance is invoked.
  681. type UsersStoreChangeUsernameFunc struct {
  682. defaultHook func(context.Context, int64, string) error
  683. hooks []func(context.Context, int64, string) error
  684. history []UsersStoreChangeUsernameFuncCall
  685. mutex sync.Mutex
  686. }
  687. // ChangeUsername delegates to the next hook function in the queue and
  688. // stores the parameter and result values of this invocation.
  689. func (m *MockUsersStore) ChangeUsername(v0 context.Context, v1 int64, v2 string) error {
  690. r0 := m.ChangeUsernameFunc.nextHook()(v0, v1, v2)
  691. m.ChangeUsernameFunc.appendCall(UsersStoreChangeUsernameFuncCall{v0, v1, v2, r0})
  692. return r0
  693. }
  694. // SetDefaultHook sets function that is called when the ChangeUsername
  695. // method of the parent MockUsersStore instance is invoked and the hook
  696. // queue is empty.
  697. func (f *UsersStoreChangeUsernameFunc) SetDefaultHook(hook func(context.Context, int64, string) error) {
  698. f.defaultHook = hook
  699. }
  700. // PushHook adds a function to the end of hook queue. Each invocation of the
  701. // ChangeUsername method of the parent MockUsersStore instance invokes the
  702. // hook at the front of the queue and discards it. After the queue is empty,
  703. // the default hook function is invoked for any future action.
  704. func (f *UsersStoreChangeUsernameFunc) PushHook(hook func(context.Context, int64, string) error) {
  705. f.mutex.Lock()
  706. f.hooks = append(f.hooks, hook)
  707. f.mutex.Unlock()
  708. }
  709. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  710. // given values.
  711. func (f *UsersStoreChangeUsernameFunc) SetDefaultReturn(r0 error) {
  712. f.SetDefaultHook(func(context.Context, int64, string) error {
  713. return r0
  714. })
  715. }
  716. // PushReturn calls PushHook with a function that returns the given values.
  717. func (f *UsersStoreChangeUsernameFunc) PushReturn(r0 error) {
  718. f.PushHook(func(context.Context, int64, string) error {
  719. return r0
  720. })
  721. }
  722. func (f *UsersStoreChangeUsernameFunc) nextHook() func(context.Context, int64, string) error {
  723. f.mutex.Lock()
  724. defer f.mutex.Unlock()
  725. if len(f.hooks) == 0 {
  726. return f.defaultHook
  727. }
  728. hook := f.hooks[0]
  729. f.hooks = f.hooks[1:]
  730. return hook
  731. }
  732. func (f *UsersStoreChangeUsernameFunc) appendCall(r0 UsersStoreChangeUsernameFuncCall) {
  733. f.mutex.Lock()
  734. f.history = append(f.history, r0)
  735. f.mutex.Unlock()
  736. }
  737. // History returns a sequence of UsersStoreChangeUsernameFuncCall objects
  738. // describing the invocations of this function.
  739. func (f *UsersStoreChangeUsernameFunc) History() []UsersStoreChangeUsernameFuncCall {
  740. f.mutex.Lock()
  741. history := make([]UsersStoreChangeUsernameFuncCall, len(f.history))
  742. copy(history, f.history)
  743. f.mutex.Unlock()
  744. return history
  745. }
  746. // UsersStoreChangeUsernameFuncCall is an object that describes an
  747. // invocation of method ChangeUsername on an instance of MockUsersStore.
  748. type UsersStoreChangeUsernameFuncCall struct {
  749. // Arg0 is the value of the 1st argument passed to this method
  750. // invocation.
  751. Arg0 context.Context
  752. // Arg1 is the value of the 2nd argument passed to this method
  753. // invocation.
  754. Arg1 int64
  755. // Arg2 is the value of the 3rd argument passed to this method
  756. // invocation.
  757. Arg2 string
  758. // Result0 is the value of the 1st result returned from this method
  759. // invocation.
  760. Result0 error
  761. }
  762. // Args returns an interface slice containing the arguments of this
  763. // invocation.
  764. func (c UsersStoreChangeUsernameFuncCall) Args() []interface{} {
  765. return []interface{}{c.Arg0, c.Arg1, c.Arg2}
  766. }
  767. // Results returns an interface slice containing the results of this
  768. // invocation.
  769. func (c UsersStoreChangeUsernameFuncCall) Results() []interface{} {
  770. return []interface{}{c.Result0}
  771. }
  772. // UsersStoreCountFunc describes the behavior when the Count method of the
  773. // parent MockUsersStore instance is invoked.
  774. type UsersStoreCountFunc struct {
  775. defaultHook func(context.Context) int64
  776. hooks []func(context.Context) int64
  777. history []UsersStoreCountFuncCall
  778. mutex sync.Mutex
  779. }
  780. // Count delegates to the next hook function in the queue and stores the
  781. // parameter and result values of this invocation.
  782. func (m *MockUsersStore) Count(v0 context.Context) int64 {
  783. r0 := m.CountFunc.nextHook()(v0)
  784. m.CountFunc.appendCall(UsersStoreCountFuncCall{v0, r0})
  785. return r0
  786. }
  787. // SetDefaultHook sets function that is called when the Count method of the
  788. // parent MockUsersStore instance is invoked and the hook queue is empty.
  789. func (f *UsersStoreCountFunc) SetDefaultHook(hook func(context.Context) int64) {
  790. f.defaultHook = hook
  791. }
  792. // PushHook adds a function to the end of hook queue. Each invocation of the
  793. // Count method of the parent MockUsersStore instance invokes the hook at
  794. // the front of the queue and discards it. After the queue is empty, the
  795. // default hook function is invoked for any future action.
  796. func (f *UsersStoreCountFunc) PushHook(hook func(context.Context) int64) {
  797. f.mutex.Lock()
  798. f.hooks = append(f.hooks, hook)
  799. f.mutex.Unlock()
  800. }
  801. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  802. // given values.
  803. func (f *UsersStoreCountFunc) SetDefaultReturn(r0 int64) {
  804. f.SetDefaultHook(func(context.Context) int64 {
  805. return r0
  806. })
  807. }
  808. // PushReturn calls PushHook with a function that returns the given values.
  809. func (f *UsersStoreCountFunc) PushReturn(r0 int64) {
  810. f.PushHook(func(context.Context) int64 {
  811. return r0
  812. })
  813. }
  814. func (f *UsersStoreCountFunc) nextHook() func(context.Context) int64 {
  815. f.mutex.Lock()
  816. defer f.mutex.Unlock()
  817. if len(f.hooks) == 0 {
  818. return f.defaultHook
  819. }
  820. hook := f.hooks[0]
  821. f.hooks = f.hooks[1:]
  822. return hook
  823. }
  824. func (f *UsersStoreCountFunc) appendCall(r0 UsersStoreCountFuncCall) {
  825. f.mutex.Lock()
  826. f.history = append(f.history, r0)
  827. f.mutex.Unlock()
  828. }
  829. // History returns a sequence of UsersStoreCountFuncCall objects describing
  830. // the invocations of this function.
  831. func (f *UsersStoreCountFunc) History() []UsersStoreCountFuncCall {
  832. f.mutex.Lock()
  833. history := make([]UsersStoreCountFuncCall, len(f.history))
  834. copy(history, f.history)
  835. f.mutex.Unlock()
  836. return history
  837. }
  838. // UsersStoreCountFuncCall is an object that describes an invocation of
  839. // method Count on an instance of MockUsersStore.
  840. type UsersStoreCountFuncCall struct {
  841. // Arg0 is the value of the 1st argument passed to this method
  842. // invocation.
  843. Arg0 context.Context
  844. // Result0 is the value of the 1st result returned from this method
  845. // invocation.
  846. Result0 int64
  847. }
  848. // Args returns an interface slice containing the arguments of this
  849. // invocation.
  850. func (c UsersStoreCountFuncCall) Args() []interface{} {
  851. return []interface{}{c.Arg0}
  852. }
  853. // Results returns an interface slice containing the results of this
  854. // invocation.
  855. func (c UsersStoreCountFuncCall) Results() []interface{} {
  856. return []interface{}{c.Result0}
  857. }
  858. // UsersStoreCreateFunc describes the behavior when the Create method of the
  859. // parent MockUsersStore instance is invoked.
  860. type UsersStoreCreateFunc struct {
  861. defaultHook func(context.Context, string, string, database.CreateUserOptions) (*database.User, error)
  862. hooks []func(context.Context, string, string, database.CreateUserOptions) (*database.User, error)
  863. history []UsersStoreCreateFuncCall
  864. mutex sync.Mutex
  865. }
  866. // Create delegates to the next hook function in the queue and stores the
  867. // parameter and result values of this invocation.
  868. func (m *MockUsersStore) Create(v0 context.Context, v1 string, v2 string, v3 database.CreateUserOptions) (*database.User, error) {
  869. r0, r1 := m.CreateFunc.nextHook()(v0, v1, v2, v3)
  870. m.CreateFunc.appendCall(UsersStoreCreateFuncCall{v0, v1, v2, v3, r0, r1})
  871. return r0, r1
  872. }
  873. // SetDefaultHook sets function that is called when the Create method of the
  874. // parent MockUsersStore instance is invoked and the hook queue is empty.
  875. func (f *UsersStoreCreateFunc) SetDefaultHook(hook func(context.Context, string, string, database.CreateUserOptions) (*database.User, error)) {
  876. f.defaultHook = hook
  877. }
  878. // PushHook adds a function to the end of hook queue. Each invocation of the
  879. // Create method of the parent MockUsersStore instance invokes the hook at
  880. // the front of the queue and discards it. After the queue is empty, the
  881. // default hook function is invoked for any future action.
  882. func (f *UsersStoreCreateFunc) PushHook(hook func(context.Context, string, string, database.CreateUserOptions) (*database.User, error)) {
  883. f.mutex.Lock()
  884. f.hooks = append(f.hooks, hook)
  885. f.mutex.Unlock()
  886. }
  887. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  888. // given values.
  889. func (f *UsersStoreCreateFunc) SetDefaultReturn(r0 *database.User, r1 error) {
  890. f.SetDefaultHook(func(context.Context, string, string, database.CreateUserOptions) (*database.User, error) {
  891. return r0, r1
  892. })
  893. }
  894. // PushReturn calls PushHook with a function that returns the given values.
  895. func (f *UsersStoreCreateFunc) PushReturn(r0 *database.User, r1 error) {
  896. f.PushHook(func(context.Context, string, string, database.CreateUserOptions) (*database.User, error) {
  897. return r0, r1
  898. })
  899. }
  900. func (f *UsersStoreCreateFunc) nextHook() func(context.Context, string, string, database.CreateUserOptions) (*database.User, error) {
  901. f.mutex.Lock()
  902. defer f.mutex.Unlock()
  903. if len(f.hooks) == 0 {
  904. return f.defaultHook
  905. }
  906. hook := f.hooks[0]
  907. f.hooks = f.hooks[1:]
  908. return hook
  909. }
  910. func (f *UsersStoreCreateFunc) appendCall(r0 UsersStoreCreateFuncCall) {
  911. f.mutex.Lock()
  912. f.history = append(f.history, r0)
  913. f.mutex.Unlock()
  914. }
  915. // History returns a sequence of UsersStoreCreateFuncCall objects describing
  916. // the invocations of this function.
  917. func (f *UsersStoreCreateFunc) History() []UsersStoreCreateFuncCall {
  918. f.mutex.Lock()
  919. history := make([]UsersStoreCreateFuncCall, len(f.history))
  920. copy(history, f.history)
  921. f.mutex.Unlock()
  922. return history
  923. }
  924. // UsersStoreCreateFuncCall is an object that describes an invocation of
  925. // method Create on an instance of MockUsersStore.
  926. type UsersStoreCreateFuncCall struct {
  927. // Arg0 is the value of the 1st argument passed to this method
  928. // invocation.
  929. Arg0 context.Context
  930. // Arg1 is the value of the 2nd argument passed to this method
  931. // invocation.
  932. Arg1 string
  933. // Arg2 is the value of the 3rd argument passed to this method
  934. // invocation.
  935. Arg2 string
  936. // Arg3 is the value of the 4th argument passed to this method
  937. // invocation.
  938. Arg3 database.CreateUserOptions
  939. // Result0 is the value of the 1st result returned from this method
  940. // invocation.
  941. Result0 *database.User
  942. // Result1 is the value of the 2nd result returned from this method
  943. // invocation.
  944. Result1 error
  945. }
  946. // Args returns an interface slice containing the arguments of this
  947. // invocation.
  948. func (c UsersStoreCreateFuncCall) Args() []interface{} {
  949. return []interface{}{c.Arg0, c.Arg1, c.Arg2, c.Arg3}
  950. }
  951. // Results returns an interface slice containing the results of this
  952. // invocation.
  953. func (c UsersStoreCreateFuncCall) Results() []interface{} {
  954. return []interface{}{c.Result0, c.Result1}
  955. }
  956. // UsersStoreDeleteByIDFunc describes the behavior when the DeleteByID
  957. // method of the parent MockUsersStore instance is invoked.
  958. type UsersStoreDeleteByIDFunc struct {
  959. defaultHook func(context.Context, int64, bool) error
  960. hooks []func(context.Context, int64, bool) error
  961. history []UsersStoreDeleteByIDFuncCall
  962. mutex sync.Mutex
  963. }
  964. // DeleteByID delegates to the next hook function in the queue and stores
  965. // the parameter and result values of this invocation.
  966. func (m *MockUsersStore) DeleteByID(v0 context.Context, v1 int64, v2 bool) error {
  967. r0 := m.DeleteByIDFunc.nextHook()(v0, v1, v2)
  968. m.DeleteByIDFunc.appendCall(UsersStoreDeleteByIDFuncCall{v0, v1, v2, r0})
  969. return r0
  970. }
  971. // SetDefaultHook sets function that is called when the DeleteByID method of
  972. // the parent MockUsersStore instance is invoked and the hook queue is
  973. // empty.
  974. func (f *UsersStoreDeleteByIDFunc) SetDefaultHook(hook func(context.Context, int64, bool) error) {
  975. f.defaultHook = hook
  976. }
  977. // PushHook adds a function to the end of hook queue. Each invocation of the
  978. // DeleteByID method of the parent MockUsersStore instance invokes the hook
  979. // at the front of the queue and discards it. After the queue is empty, the
  980. // default hook function is invoked for any future action.
  981. func (f *UsersStoreDeleteByIDFunc) PushHook(hook func(context.Context, int64, bool) error) {
  982. f.mutex.Lock()
  983. f.hooks = append(f.hooks, hook)
  984. f.mutex.Unlock()
  985. }
  986. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  987. // given values.
  988. func (f *UsersStoreDeleteByIDFunc) SetDefaultReturn(r0 error) {
  989. f.SetDefaultHook(func(context.Context, int64, bool) error {
  990. return r0
  991. })
  992. }
  993. // PushReturn calls PushHook with a function that returns the given values.
  994. func (f *UsersStoreDeleteByIDFunc) PushReturn(r0 error) {
  995. f.PushHook(func(context.Context, int64, bool) error {
  996. return r0
  997. })
  998. }
  999. func (f *UsersStoreDeleteByIDFunc) nextHook() func(context.Context, int64, bool) error {
  1000. f.mutex.Lock()
  1001. defer f.mutex.Unlock()
  1002. if len(f.hooks) == 0 {
  1003. return f.defaultHook
  1004. }
  1005. hook := f.hooks[0]
  1006. f.hooks = f.hooks[1:]
  1007. return hook
  1008. }
  1009. func (f *UsersStoreDeleteByIDFunc) appendCall(r0 UsersStoreDeleteByIDFuncCall) {
  1010. f.mutex.Lock()
  1011. f.history = append(f.history, r0)
  1012. f.mutex.Unlock()
  1013. }
  1014. // History returns a sequence of UsersStoreDeleteByIDFuncCall objects
  1015. // describing the invocations of this function.
  1016. func (f *UsersStoreDeleteByIDFunc) History() []UsersStoreDeleteByIDFuncCall {
  1017. f.mutex.Lock()
  1018. history := make([]UsersStoreDeleteByIDFuncCall, len(f.history))
  1019. copy(history, f.history)
  1020. f.mutex.Unlock()
  1021. return history
  1022. }
  1023. // UsersStoreDeleteByIDFuncCall is an object that describes an invocation of
  1024. // method DeleteByID on an instance of MockUsersStore.
  1025. type UsersStoreDeleteByIDFuncCall struct {
  1026. // Arg0 is the value of the 1st argument passed to this method
  1027. // invocation.
  1028. Arg0 context.Context
  1029. // Arg1 is the value of the 2nd argument passed to this method
  1030. // invocation.
  1031. Arg1 int64
  1032. // Arg2 is the value of the 3rd argument passed to this method
  1033. // invocation.
  1034. Arg2 bool
  1035. // Result0 is the value of the 1st result returned from this method
  1036. // invocation.
  1037. Result0 error
  1038. }
  1039. // Args returns an interface slice containing the arguments of this
  1040. // invocation.
  1041. func (c UsersStoreDeleteByIDFuncCall) Args() []interface{} {
  1042. return []interface{}{c.Arg0, c.Arg1, c.Arg2}
  1043. }
  1044. // Results returns an interface slice containing the results of this
  1045. // invocation.
  1046. func (c UsersStoreDeleteByIDFuncCall) Results() []interface{} {
  1047. return []interface{}{c.Result0}
  1048. }
  1049. // UsersStoreDeleteCustomAvatarFunc describes the behavior when the
  1050. // DeleteCustomAvatar method of the parent MockUsersStore instance is
  1051. // invoked.
  1052. type UsersStoreDeleteCustomAvatarFunc struct {
  1053. defaultHook func(context.Context, int64) error
  1054. hooks []func(context.Context, int64) error
  1055. history []UsersStoreDeleteCustomAvatarFuncCall
  1056. mutex sync.Mutex
  1057. }
  1058. // DeleteCustomAvatar delegates to the next hook function in the queue and
  1059. // stores the parameter and result values of this invocation.
  1060. func (m *MockUsersStore) DeleteCustomAvatar(v0 context.Context, v1 int64) error {
  1061. r0 := m.DeleteCustomAvatarFunc.nextHook()(v0, v1)
  1062. m.DeleteCustomAvatarFunc.appendCall(UsersStoreDeleteCustomAvatarFuncCall{v0, v1, r0})
  1063. return r0
  1064. }
  1065. // SetDefaultHook sets function that is called when the DeleteCustomAvatar
  1066. // method of the parent MockUsersStore instance is invoked and the hook
  1067. // queue is empty.
  1068. func (f *UsersStoreDeleteCustomAvatarFunc) SetDefaultHook(hook func(context.Context, int64) error) {
  1069. f.defaultHook = hook
  1070. }
  1071. // PushHook adds a function to the end of hook queue. Each invocation of the
  1072. // DeleteCustomAvatar method of the parent MockUsersStore instance invokes
  1073. // the hook at the front of the queue and discards it. After the queue is
  1074. // empty, the default hook function is invoked for any future action.
  1075. func (f *UsersStoreDeleteCustomAvatarFunc) PushHook(hook func(context.Context, int64) error) {
  1076. f.mutex.Lock()
  1077. f.hooks = append(f.hooks, hook)
  1078. f.mutex.Unlock()
  1079. }
  1080. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  1081. // given values.
  1082. func (f *UsersStoreDeleteCustomAvatarFunc) SetDefaultReturn(r0 error) {
  1083. f.SetDefaultHook(func(context.Context, int64) error {
  1084. return r0
  1085. })
  1086. }
  1087. // PushReturn calls PushHook with a function that returns the given values.
  1088. func (f *UsersStoreDeleteCustomAvatarFunc) PushReturn(r0 error) {
  1089. f.PushHook(func(context.Context, int64) error {
  1090. return r0
  1091. })
  1092. }
  1093. func (f *UsersStoreDeleteCustomAvatarFunc) nextHook() func(context.Context, int64) error {
  1094. f.mutex.Lock()
  1095. defer f.mutex.Unlock()
  1096. if len(f.hooks) == 0 {
  1097. return f.defaultHook
  1098. }
  1099. hook := f.hooks[0]
  1100. f.hooks = f.hooks[1:]
  1101. return hook
  1102. }
  1103. func (f *UsersStoreDeleteCustomAvatarFunc) appendCall(r0 UsersStoreDeleteCustomAvatarFuncCall) {
  1104. f.mutex.Lock()
  1105. f.history = append(f.history, r0)
  1106. f.mutex.Unlock()
  1107. }
  1108. // History returns a sequence of UsersStoreDeleteCustomAvatarFuncCall
  1109. // objects describing the invocations of this function.
  1110. func (f *UsersStoreDeleteCustomAvatarFunc) History() []UsersStoreDeleteCustomAvatarFuncCall {
  1111. f.mutex.Lock()
  1112. history := make([]UsersStoreDeleteCustomAvatarFuncCall, len(f.history))
  1113. copy(history, f.history)
  1114. f.mutex.Unlock()
  1115. return history
  1116. }
  1117. // UsersStoreDeleteCustomAvatarFuncCall is an object that describes an
  1118. // invocation of method DeleteCustomAvatar on an instance of MockUsersStore.
  1119. type UsersStoreDeleteCustomAvatarFuncCall struct {
  1120. // Arg0 is the value of the 1st argument passed to this method
  1121. // invocation.
  1122. Arg0 context.Context
  1123. // Arg1 is the value of the 2nd argument passed to this method
  1124. // invocation.
  1125. Arg1 int64
  1126. // Result0 is the value of the 1st result returned from this method
  1127. // invocation.
  1128. Result0 error
  1129. }
  1130. // Args returns an interface slice containing the arguments of this
  1131. // invocation.
  1132. func (c UsersStoreDeleteCustomAvatarFuncCall) Args() []interface{} {
  1133. return []interface{}{c.Arg0, c.Arg1}
  1134. }
  1135. // Results returns an interface slice containing the results of this
  1136. // invocation.
  1137. func (c UsersStoreDeleteCustomAvatarFuncCall) Results() []interface{} {
  1138. return []interface{}{c.Result0}
  1139. }
  1140. // UsersStoreDeleteEmailFunc describes the behavior when the DeleteEmail
  1141. // method of the parent MockUsersStore instance is invoked.
  1142. type UsersStoreDeleteEmailFunc struct {
  1143. defaultHook func(context.Context, int64, string) error
  1144. hooks []func(context.Context, int64, string) error
  1145. history []UsersStoreDeleteEmailFuncCall
  1146. mutex sync.Mutex
  1147. }
  1148. // DeleteEmail delegates to the next hook function in the queue and stores
  1149. // the parameter and result values of this invocation.
  1150. func (m *MockUsersStore) DeleteEmail(v0 context.Context, v1 int64, v2 string) error {
  1151. r0 := m.DeleteEmailFunc.nextHook()(v0, v1, v2)
  1152. m.DeleteEmailFunc.appendCall(UsersStoreDeleteEmailFuncCall{v0, v1, v2, r0})
  1153. return r0
  1154. }
  1155. // SetDefaultHook sets function that is called when the DeleteEmail method
  1156. // of the parent MockUsersStore instance is invoked and the hook queue is
  1157. // empty.
  1158. func (f *UsersStoreDeleteEmailFunc) SetDefaultHook(hook func(context.Context, int64, string) error) {
  1159. f.defaultHook = hook
  1160. }
  1161. // PushHook adds a function to the end of hook queue. Each invocation of the
  1162. // DeleteEmail method of the parent MockUsersStore instance invokes the hook
  1163. // at the front of the queue and discards it. After the queue is empty, the
  1164. // default hook function is invoked for any future action.
  1165. func (f *UsersStoreDeleteEmailFunc) PushHook(hook func(context.Context, int64, string) error) {
  1166. f.mutex.Lock()
  1167. f.hooks = append(f.hooks, hook)
  1168. f.mutex.Unlock()
  1169. }
  1170. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  1171. // given values.
  1172. func (f *UsersStoreDeleteEmailFunc) SetDefaultReturn(r0 error) {
  1173. f.SetDefaultHook(func(context.Context, int64, string) error {
  1174. return r0
  1175. })
  1176. }
  1177. // PushReturn calls PushHook with a function that returns the given values.
  1178. func (f *UsersStoreDeleteEmailFunc) PushReturn(r0 error) {
  1179. f.PushHook(func(context.Context, int64, string) error {
  1180. return r0
  1181. })
  1182. }
  1183. func (f *UsersStoreDeleteEmailFunc) nextHook() func(context.Context, int64, string) error {
  1184. f.mutex.Lock()
  1185. defer f.mutex.Unlock()
  1186. if len(f.hooks) == 0 {
  1187. return f.defaultHook
  1188. }
  1189. hook := f.hooks[0]
  1190. f.hooks = f.hooks[1:]
  1191. return hook
  1192. }
  1193. func (f *UsersStoreDeleteEmailFunc) appendCall(r0 UsersStoreDeleteEmailFuncCall) {
  1194. f.mutex.Lock()
  1195. f.history = append(f.history, r0)
  1196. f.mutex.Unlock()
  1197. }
  1198. // History returns a sequence of UsersStoreDeleteEmailFuncCall objects
  1199. // describing the invocations of this function.
  1200. func (f *UsersStoreDeleteEmailFunc) History() []UsersStoreDeleteEmailFuncCall {
  1201. f.mutex.Lock()
  1202. history := make([]UsersStoreDeleteEmailFuncCall, len(f.history))
  1203. copy(history, f.history)
  1204. f.mutex.Unlock()
  1205. return history
  1206. }
  1207. // UsersStoreDeleteEmailFuncCall is an object that describes an invocation
  1208. // of method DeleteEmail on an instance of MockUsersStore.
  1209. type UsersStoreDeleteEmailFuncCall struct {
  1210. // Arg0 is the value of the 1st argument passed to this method
  1211. // invocation.
  1212. Arg0 context.Context
  1213. // Arg1 is the value of the 2nd argument passed to this method
  1214. // invocation.
  1215. Arg1 int64
  1216. // Arg2 is the value of the 3rd argument passed to this method
  1217. // invocation.
  1218. Arg2 string
  1219. // Result0 is the value of the 1st result returned from this method
  1220. // invocation.
  1221. Result0 error
  1222. }
  1223. // Args returns an interface slice containing the arguments of this
  1224. // invocation.
  1225. func (c UsersStoreDeleteEmailFuncCall) Args() []interface{} {
  1226. return []interface{}{c.Arg0, c.Arg1, c.Arg2}
  1227. }
  1228. // Results returns an interface slice containing the results of this
  1229. // invocation.
  1230. func (c UsersStoreDeleteEmailFuncCall) Results() []interface{} {
  1231. return []interface{}{c.Result0}
  1232. }
  1233. // UsersStoreDeleteInactivatedFunc describes the behavior when the
  1234. // DeleteInactivated method of the parent MockUsersStore instance is
  1235. // invoked.
  1236. type UsersStoreDeleteInactivatedFunc struct {
  1237. defaultHook func() error
  1238. hooks []func() error
  1239. history []UsersStoreDeleteInactivatedFuncCall
  1240. mutex sync.Mutex
  1241. }
  1242. // DeleteInactivated delegates to the next hook function in the queue and
  1243. // stores the parameter and result values of this invocation.
  1244. func (m *MockUsersStore) DeleteInactivated() error {
  1245. r0 := m.DeleteInactivatedFunc.nextHook()()
  1246. m.DeleteInactivatedFunc.appendCall(UsersStoreDeleteInactivatedFuncCall{r0})
  1247. return r0
  1248. }
  1249. // SetDefaultHook sets function that is called when the DeleteInactivated
  1250. // method of the parent MockUsersStore instance is invoked and the hook
  1251. // queue is empty.
  1252. func (f *UsersStoreDeleteInactivatedFunc) SetDefaultHook(hook func() error) {
  1253. f.defaultHook = hook
  1254. }
  1255. // PushHook adds a function to the end of hook queue. Each invocation of the
  1256. // DeleteInactivated method of the parent MockUsersStore instance invokes
  1257. // the hook at the front of the queue and discards it. After the queue is
  1258. // empty, the default hook function is invoked for any future action.
  1259. func (f *UsersStoreDeleteInactivatedFunc) PushHook(hook func() error) {
  1260. f.mutex.Lock()
  1261. f.hooks = append(f.hooks, hook)
  1262. f.mutex.Unlock()
  1263. }
  1264. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  1265. // given values.
  1266. func (f *UsersStoreDeleteInactivatedFunc) SetDefaultReturn(r0 error) {
  1267. f.SetDefaultHook(func() error {
  1268. return r0
  1269. })
  1270. }
  1271. // PushReturn calls PushHook with a function that returns the given values.
  1272. func (f *UsersStoreDeleteInactivatedFunc) PushReturn(r0 error) {
  1273. f.PushHook(func() error {
  1274. return r0
  1275. })
  1276. }
  1277. func (f *UsersStoreDeleteInactivatedFunc) nextHook() func() error {
  1278. f.mutex.Lock()
  1279. defer f.mutex.Unlock()
  1280. if len(f.hooks) == 0 {
  1281. return f.defaultHook
  1282. }
  1283. hook := f.hooks[0]
  1284. f.hooks = f.hooks[1:]
  1285. return hook
  1286. }
  1287. func (f *UsersStoreDeleteInactivatedFunc) appendCall(r0 UsersStoreDeleteInactivatedFuncCall) {
  1288. f.mutex.Lock()
  1289. f.history = append(f.history, r0)
  1290. f.mutex.Unlock()
  1291. }
  1292. // History returns a sequence of UsersStoreDeleteInactivatedFuncCall objects
  1293. // describing the invocations of this function.
  1294. func (f *UsersStoreDeleteInactivatedFunc) History() []UsersStoreDeleteInactivatedFuncCall {
  1295. f.mutex.Lock()
  1296. history := make([]UsersStoreDeleteInactivatedFuncCall, len(f.history))
  1297. copy(history, f.history)
  1298. f.mutex.Unlock()
  1299. return history
  1300. }
  1301. // UsersStoreDeleteInactivatedFuncCall is an object that describes an
  1302. // invocation of method DeleteInactivated on an instance of MockUsersStore.
  1303. type UsersStoreDeleteInactivatedFuncCall struct {
  1304. // Result0 is the value of the 1st result returned from this method
  1305. // invocation.
  1306. Result0 error
  1307. }
  1308. // Args returns an interface slice containing the arguments of this
  1309. // invocation.
  1310. func (c UsersStoreDeleteInactivatedFuncCall) Args() []interface{} {
  1311. return []interface{}{}
  1312. }
  1313. // Results returns an interface slice containing the results of this
  1314. // invocation.
  1315. func (c UsersStoreDeleteInactivatedFuncCall) Results() []interface{} {
  1316. return []interface{}{c.Result0}
  1317. }
  1318. // UsersStoreFollowFunc describes the behavior when the Follow method of the
  1319. // parent MockUsersStore instance is invoked.
  1320. type UsersStoreFollowFunc struct {
  1321. defaultHook func(context.Context, int64, int64) error
  1322. hooks []func(context.Context, int64, int64) error
  1323. history []UsersStoreFollowFuncCall
  1324. mutex sync.Mutex
  1325. }
  1326. // Follow delegates to the next hook function in the queue and stores the
  1327. // parameter and result values of this invocation.
  1328. func (m *MockUsersStore) Follow(v0 context.Context, v1 int64, v2 int64) error {
  1329. r0 := m.FollowFunc.nextHook()(v0, v1, v2)
  1330. m.FollowFunc.appendCall(UsersStoreFollowFuncCall{v0, v1, v2, r0})
  1331. return r0
  1332. }
  1333. // SetDefaultHook sets function that is called when the Follow method of the
  1334. // parent MockUsersStore instance is invoked and the hook queue is empty.
  1335. func (f *UsersStoreFollowFunc) SetDefaultHook(hook func(context.Context, int64, int64) error) {
  1336. f.defaultHook = hook
  1337. }
  1338. // PushHook adds a function to the end of hook queue. Each invocation of the
  1339. // Follow method of the parent MockUsersStore instance invokes the hook at
  1340. // the front of the queue and discards it. After the queue is empty, the
  1341. // default hook function is invoked for any future action.
  1342. func (f *UsersStoreFollowFunc) PushHook(hook func(context.Context, int64, int64) error) {
  1343. f.mutex.Lock()
  1344. f.hooks = append(f.hooks, hook)
  1345. f.mutex.Unlock()
  1346. }
  1347. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  1348. // given values.
  1349. func (f *UsersStoreFollowFunc) SetDefaultReturn(r0 error) {
  1350. f.SetDefaultHook(func(context.Context, int64, int64) error {
  1351. return r0
  1352. })
  1353. }
  1354. // PushReturn calls PushHook with a function that returns the given values.
  1355. func (f *UsersStoreFollowFunc) PushReturn(r0 error) {
  1356. f.PushHook(func(context.Context, int64, int64) error {
  1357. return r0
  1358. })
  1359. }
  1360. func (f *UsersStoreFollowFunc) nextHook() func(context.Context, int64, int64) error {
  1361. f.mutex.Lock()
  1362. defer f.mutex.Unlock()
  1363. if len(f.hooks) == 0 {
  1364. return f.defaultHook
  1365. }
  1366. hook := f.hooks[0]
  1367. f.hooks = f.hooks[1:]
  1368. return hook
  1369. }
  1370. func (f *UsersStoreFollowFunc) appendCall(r0 UsersStoreFollowFuncCall) {
  1371. f.mutex.Lock()
  1372. f.history = append(f.history, r0)
  1373. f.mutex.Unlock()
  1374. }
  1375. // History returns a sequence of UsersStoreFollowFuncCall objects describing
  1376. // the invocations of this function.
  1377. func (f *UsersStoreFollowFunc) History() []UsersStoreFollowFuncCall {
  1378. f.mutex.Lock()
  1379. history := make([]UsersStoreFollowFuncCall, len(f.history))
  1380. copy(history, f.history)
  1381. f.mutex.Unlock()
  1382. return history
  1383. }
  1384. // UsersStoreFollowFuncCall is an object that describes an invocation of
  1385. // method Follow on an instance of MockUsersStore.
  1386. type UsersStoreFollowFuncCall struct {
  1387. // Arg0 is the value of the 1st argument passed to this method
  1388. // invocation.
  1389. Arg0 context.Context
  1390. // Arg1 is the value of the 2nd argument passed to this method
  1391. // invocation.
  1392. Arg1 int64
  1393. // Arg2 is the value of the 3rd argument passed to this method
  1394. // invocation.
  1395. Arg2 int64
  1396. // Result0 is the value of the 1st result returned from this method
  1397. // invocation.
  1398. Result0 error
  1399. }
  1400. // Args returns an interface slice containing the arguments of this
  1401. // invocation.
  1402. func (c UsersStoreFollowFuncCall) Args() []interface{} {
  1403. return []interface{}{c.Arg0, c.Arg1, c.Arg2}
  1404. }
  1405. // Results returns an interface slice containing the results of this
  1406. // invocation.
  1407. func (c UsersStoreFollowFuncCall) Results() []interface{} {
  1408. return []interface{}{c.Result0}
  1409. }
  1410. // UsersStoreGetByEmailFunc describes the behavior when the GetByEmail
  1411. // method of the parent MockUsersStore instance is invoked.
  1412. type UsersStoreGetByEmailFunc struct {
  1413. defaultHook func(context.Context, string) (*database.User, error)
  1414. hooks []func(context.Context, string) (*database.User, error)
  1415. history []UsersStoreGetByEmailFuncCall
  1416. mutex sync.Mutex
  1417. }
  1418. // GetByEmail delegates to the next hook function in the queue and stores
  1419. // the parameter and result values of this invocation.
  1420. func (m *MockUsersStore) GetByEmail(v0 context.Context, v1 string) (*database.User, error) {
  1421. r0, r1 := m.GetByEmailFunc.nextHook()(v0, v1)
  1422. m.GetByEmailFunc.appendCall(UsersStoreGetByEmailFuncCall{v0, v1, r0, r1})
  1423. return r0, r1
  1424. }
  1425. // SetDefaultHook sets function that is called when the GetByEmail method of
  1426. // the parent MockUsersStore instance is invoked and the hook queue is
  1427. // empty.
  1428. func (f *UsersStoreGetByEmailFunc) SetDefaultHook(hook func(context.Context, string) (*database.User, error)) {
  1429. f.defaultHook = hook
  1430. }
  1431. // PushHook adds a function to the end of hook queue. Each invocation of the
  1432. // GetByEmail method of the parent MockUsersStore instance invokes the hook
  1433. // at the front of the queue and discards it. After the queue is empty, the
  1434. // default hook function is invoked for any future action.
  1435. func (f *UsersStoreGetByEmailFunc) PushHook(hook func(context.Context, string) (*database.User, error)) {
  1436. f.mutex.Lock()
  1437. f.hooks = append(f.hooks, hook)
  1438. f.mutex.Unlock()
  1439. }
  1440. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  1441. // given values.
  1442. func (f *UsersStoreGetByEmailFunc) SetDefaultReturn(r0 *database.User, r1 error) {
  1443. f.SetDefaultHook(func(context.Context, string) (*database.User, error) {
  1444. return r0, r1
  1445. })
  1446. }
  1447. // PushReturn calls PushHook with a function that returns the given values.
  1448. func (f *UsersStoreGetByEmailFunc) PushReturn(r0 *database.User, r1 error) {
  1449. f.PushHook(func(context.Context, string) (*database.User, error) {
  1450. return r0, r1
  1451. })
  1452. }
  1453. func (f *UsersStoreGetByEmailFunc) nextHook() func(context.Context, string) (*database.User, error) {
  1454. f.mutex.Lock()
  1455. defer f.mutex.Unlock()
  1456. if len(f.hooks) == 0 {
  1457. return f.defaultHook
  1458. }
  1459. hook := f.hooks[0]
  1460. f.hooks = f.hooks[1:]
  1461. return hook
  1462. }
  1463. func (f *UsersStoreGetByEmailFunc) appendCall(r0 UsersStoreGetByEmailFuncCall) {
  1464. f.mutex.Lock()
  1465. f.history = append(f.history, r0)
  1466. f.mutex.Unlock()
  1467. }
  1468. // History returns a sequence of UsersStoreGetByEmailFuncCall objects
  1469. // describing the invocations of this function.
  1470. func (f *UsersStoreGetByEmailFunc) History() []UsersStoreGetByEmailFuncCall {
  1471. f.mutex.Lock()
  1472. history := make([]UsersStoreGetByEmailFuncCall, len(f.history))
  1473. copy(history, f.history)
  1474. f.mutex.Unlock()
  1475. return history
  1476. }
  1477. // UsersStoreGetByEmailFuncCall is an object that describes an invocation of
  1478. // method GetByEmail on an instance of MockUsersStore.
  1479. type UsersStoreGetByEmailFuncCall struct {
  1480. // Arg0 is the value of the 1st argument passed to this method
  1481. // invocation.
  1482. Arg0 context.Context
  1483. // Arg1 is the value of the 2nd argument passed to this method
  1484. // invocation.
  1485. Arg1 string
  1486. // Result0 is the value of the 1st result returned from this method
  1487. // invocation.
  1488. Result0 *database.User
  1489. // Result1 is the value of the 2nd result returned from this method
  1490. // invocation.
  1491. Result1 error
  1492. }
  1493. // Args returns an interface slice containing the arguments of this
  1494. // invocation.
  1495. func (c UsersStoreGetByEmailFuncCall) Args() []interface{} {
  1496. return []interface{}{c.Arg0, c.Arg1}
  1497. }
  1498. // Results returns an interface slice containing the results of this
  1499. // invocation.
  1500. func (c UsersStoreGetByEmailFuncCall) Results() []interface{} {
  1501. return []interface{}{c.Result0, c.Result1}
  1502. }
  1503. // UsersStoreGetByIDFunc describes the behavior when the GetByID method of
  1504. // the parent MockUsersStore instance is invoked.
  1505. type UsersStoreGetByIDFunc struct {
  1506. defaultHook func(context.Context, int64) (*database.User, error)
  1507. hooks []func(context.Context, int64) (*database.User, error)
  1508. history []UsersStoreGetByIDFuncCall
  1509. mutex sync.Mutex
  1510. }
  1511. // GetByID delegates to the next hook function in the queue and stores the
  1512. // parameter and result values of this invocation.
  1513. func (m *MockUsersStore) GetByID(v0 context.Context, v1 int64) (*database.User, error) {
  1514. r0, r1 := m.GetByIDFunc.nextHook()(v0, v1)
  1515. m.GetByIDFunc.appendCall(UsersStoreGetByIDFuncCall{v0, v1, r0, r1})
  1516. return r0, r1
  1517. }
  1518. // SetDefaultHook sets function that is called when the GetByID method of
  1519. // the parent MockUsersStore instance is invoked and the hook queue is
  1520. // empty.
  1521. func (f *UsersStoreGetByIDFunc) SetDefaultHook(hook func(context.Context, int64) (*database.User, error)) {
  1522. f.defaultHook = hook
  1523. }
  1524. // PushHook adds a function to the end of hook queue. Each invocation of the
  1525. // GetByID method of the parent MockUsersStore instance invokes the hook at
  1526. // the front of the queue and discards it. After the queue is empty, the
  1527. // default hook function is invoked for any future action.
  1528. func (f *UsersStoreGetByIDFunc) PushHook(hook func(context.Context, int64) (*database.User, error)) {
  1529. f.mutex.Lock()
  1530. f.hooks = append(f.hooks, hook)
  1531. f.mutex.Unlock()
  1532. }
  1533. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  1534. // given values.
  1535. func (f *UsersStoreGetByIDFunc) SetDefaultReturn(r0 *database.User, r1 error) {
  1536. f.SetDefaultHook(func(context.Context, int64) (*database.User, error) {
  1537. return r0, r1
  1538. })
  1539. }
  1540. // PushReturn calls PushHook with a function that returns the given values.
  1541. func (f *UsersStoreGetByIDFunc) PushReturn(r0 *database.User, r1 error) {
  1542. f.PushHook(func(context.Context, int64) (*database.User, error) {
  1543. return r0, r1
  1544. })
  1545. }
  1546. func (f *UsersStoreGetByIDFunc) nextHook() func(context.Context, int64) (*database.User, error) {
  1547. f.mutex.Lock()
  1548. defer f.mutex.Unlock()
  1549. if len(f.hooks) == 0 {
  1550. return f.defaultHook
  1551. }
  1552. hook := f.hooks[0]
  1553. f.hooks = f.hooks[1:]
  1554. return hook
  1555. }
  1556. func (f *UsersStoreGetByIDFunc) appendCall(r0 UsersStoreGetByIDFuncCall) {
  1557. f.mutex.Lock()
  1558. f.history = append(f.history, r0)
  1559. f.mutex.Unlock()
  1560. }
  1561. // History returns a sequence of UsersStoreGetByIDFuncCall objects
  1562. // describing the invocations of this function.
  1563. func (f *UsersStoreGetByIDFunc) History() []UsersStoreGetByIDFuncCall {
  1564. f.mutex.Lock()
  1565. history := make([]UsersStoreGetByIDFuncCall, len(f.history))
  1566. copy(history, f.history)
  1567. f.mutex.Unlock()
  1568. return history
  1569. }
  1570. // UsersStoreGetByIDFuncCall is an object that describes an invocation of
  1571. // method GetByID on an instance of MockUsersStore.
  1572. type UsersStoreGetByIDFuncCall struct {
  1573. // Arg0 is the value of the 1st argument passed to this method
  1574. // invocation.
  1575. Arg0 context.Context
  1576. // Arg1 is the value of the 2nd argument passed to this method
  1577. // invocation.
  1578. Arg1 int64
  1579. // Result0 is the value of the 1st result returned from this method
  1580. // invocation.
  1581. Result0 *database.User
  1582. // Result1 is the value of the 2nd result returned from this method
  1583. // invocation.
  1584. Result1 error
  1585. }
  1586. // Args returns an interface slice containing the arguments of this
  1587. // invocation.
  1588. func (c UsersStoreGetByIDFuncCall) Args() []interface{} {
  1589. return []interface{}{c.Arg0, c.Arg1}
  1590. }
  1591. // Results returns an interface slice containing the results of this
  1592. // invocation.
  1593. func (c UsersStoreGetByIDFuncCall) Results() []interface{} {
  1594. return []interface{}{c.Result0, c.Result1}
  1595. }
  1596. // UsersStoreGetByKeyIDFunc describes the behavior when the GetByKeyID
  1597. // method of the parent MockUsersStore instance is invoked.
  1598. type UsersStoreGetByKeyIDFunc struct {
  1599. defaultHook func(context.Context, int64) (*database.User, error)
  1600. hooks []func(context.Context, int64) (*database.User, error)
  1601. history []UsersStoreGetByKeyIDFuncCall
  1602. mutex sync.Mutex
  1603. }
  1604. // GetByKeyID delegates to the next hook function in the queue and stores
  1605. // the parameter and result values of this invocation.
  1606. func (m *MockUsersStore) GetByKeyID(v0 context.Context, v1 int64) (*database.User, error) {
  1607. r0, r1 := m.GetByKeyIDFunc.nextHook()(v0, v1)
  1608. m.GetByKeyIDFunc.appendCall(UsersStoreGetByKeyIDFuncCall{v0, v1, r0, r1})
  1609. return r0, r1
  1610. }
  1611. // SetDefaultHook sets function that is called when the GetByKeyID method of
  1612. // the parent MockUsersStore instance is invoked and the hook queue is
  1613. // empty.
  1614. func (f *UsersStoreGetByKeyIDFunc) SetDefaultHook(hook func(context.Context, int64) (*database.User, error)) {
  1615. f.defaultHook = hook
  1616. }
  1617. // PushHook adds a function to the end of hook queue. Each invocation of the
  1618. // GetByKeyID method of the parent MockUsersStore instance invokes the hook
  1619. // at the front of the queue and discards it. After the queue is empty, the
  1620. // default hook function is invoked for any future action.
  1621. func (f *UsersStoreGetByKeyIDFunc) PushHook(hook func(context.Context, int64) (*database.User, error)) {
  1622. f.mutex.Lock()
  1623. f.hooks = append(f.hooks, hook)
  1624. f.mutex.Unlock()
  1625. }
  1626. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  1627. // given values.
  1628. func (f *UsersStoreGetByKeyIDFunc) SetDefaultReturn(r0 *database.User, r1 error) {
  1629. f.SetDefaultHook(func(context.Context, int64) (*database.User, error) {
  1630. return r0, r1
  1631. })
  1632. }
  1633. // PushReturn calls PushHook with a function that returns the given values.
  1634. func (f *UsersStoreGetByKeyIDFunc) PushReturn(r0 *database.User, r1 error) {
  1635. f.PushHook(func(context.Context, int64) (*database.User, error) {
  1636. return r0, r1
  1637. })
  1638. }
  1639. func (f *UsersStoreGetByKeyIDFunc) nextHook() func(context.Context, int64) (*database.User, error) {
  1640. f.mutex.Lock()
  1641. defer f.mutex.Unlock()
  1642. if len(f.hooks) == 0 {
  1643. return f.defaultHook
  1644. }
  1645. hook := f.hooks[0]
  1646. f.hooks = f.hooks[1:]
  1647. return hook
  1648. }
  1649. func (f *UsersStoreGetByKeyIDFunc) appendCall(r0 UsersStoreGetByKeyIDFuncCall) {
  1650. f.mutex.Lock()
  1651. f.history = append(f.history, r0)
  1652. f.mutex.Unlock()
  1653. }
  1654. // History returns a sequence of UsersStoreGetByKeyIDFuncCall objects
  1655. // describing the invocations of this function.
  1656. func (f *UsersStoreGetByKeyIDFunc) History() []UsersStoreGetByKeyIDFuncCall {
  1657. f.mutex.Lock()
  1658. history := make([]UsersStoreGetByKeyIDFuncCall, len(f.history))
  1659. copy(history, f.history)
  1660. f.mutex.Unlock()
  1661. return history
  1662. }
  1663. // UsersStoreGetByKeyIDFuncCall is an object that describes an invocation of
  1664. // method GetByKeyID on an instance of MockUsersStore.
  1665. type UsersStoreGetByKeyIDFuncCall struct {
  1666. // Arg0 is the value of the 1st argument passed to this method
  1667. // invocation.
  1668. Arg0 context.Context
  1669. // Arg1 is the value of the 2nd argument passed to this method
  1670. // invocation.
  1671. Arg1 int64
  1672. // Result0 is the value of the 1st result returned from this method
  1673. // invocation.
  1674. Result0 *database.User
  1675. // Result1 is the value of the 2nd result returned from this method
  1676. // invocation.
  1677. Result1 error
  1678. }
  1679. // Args returns an interface slice containing the arguments of this
  1680. // invocation.
  1681. func (c UsersStoreGetByKeyIDFuncCall) Args() []interface{} {
  1682. return []interface{}{c.Arg0, c.Arg1}
  1683. }
  1684. // Results returns an interface slice containing the results of this
  1685. // invocation.
  1686. func (c UsersStoreGetByKeyIDFuncCall) Results() []interface{} {
  1687. return []interface{}{c.Result0, c.Result1}
  1688. }
  1689. // UsersStoreGetByUsernameFunc describes the behavior when the GetByUsername
  1690. // method of the parent MockUsersStore instance is invoked.
  1691. type UsersStoreGetByUsernameFunc struct {
  1692. defaultHook func(context.Context, string) (*database.User, error)
  1693. hooks []func(context.Context, string) (*database.User, error)
  1694. history []UsersStoreGetByUsernameFuncCall
  1695. mutex sync.Mutex
  1696. }
  1697. // GetByUsername delegates to the next hook function in the queue and stores
  1698. // the parameter and result values of this invocation.
  1699. func (m *MockUsersStore) GetByUsername(v0 context.Context, v1 string) (*database.User, error) {
  1700. r0, r1 := m.GetByUsernameFunc.nextHook()(v0, v1)
  1701. m.GetByUsernameFunc.appendCall(UsersStoreGetByUsernameFuncCall{v0, v1, r0, r1})
  1702. return r0, r1
  1703. }
  1704. // SetDefaultHook sets function that is called when the GetByUsername method
  1705. // of the parent MockUsersStore instance is invoked and the hook queue is
  1706. // empty.
  1707. func (f *UsersStoreGetByUsernameFunc) SetDefaultHook(hook func(context.Context, string) (*database.User, error)) {
  1708. f.defaultHook = hook
  1709. }
  1710. // PushHook adds a function to the end of hook queue. Each invocation of the
  1711. // GetByUsername method of the parent MockUsersStore instance invokes the
  1712. // hook at the front of the queue and discards it. After the queue is empty,
  1713. // the default hook function is invoked for any future action.
  1714. func (f *UsersStoreGetByUsernameFunc) PushHook(hook func(context.Context, string) (*database.User, error)) {
  1715. f.mutex.Lock()
  1716. f.hooks = append(f.hooks, hook)
  1717. f.mutex.Unlock()
  1718. }
  1719. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  1720. // given values.
  1721. func (f *UsersStoreGetByUsernameFunc) SetDefaultReturn(r0 *database.User, r1 error) {
  1722. f.SetDefaultHook(func(context.Context, string) (*database.User, error) {
  1723. return r0, r1
  1724. })
  1725. }
  1726. // PushReturn calls PushHook with a function that returns the given values.
  1727. func (f *UsersStoreGetByUsernameFunc) PushReturn(r0 *database.User, r1 error) {
  1728. f.PushHook(func(context.Context, string) (*database.User, error) {
  1729. return r0, r1
  1730. })
  1731. }
  1732. func (f *UsersStoreGetByUsernameFunc) nextHook() func(context.Context, string) (*database.User, error) {
  1733. f.mutex.Lock()
  1734. defer f.mutex.Unlock()
  1735. if len(f.hooks) == 0 {
  1736. return f.defaultHook
  1737. }
  1738. hook := f.hooks[0]
  1739. f.hooks = f.hooks[1:]
  1740. return hook
  1741. }
  1742. func (f *UsersStoreGetByUsernameFunc) appendCall(r0 UsersStoreGetByUsernameFuncCall) {
  1743. f.mutex.Lock()
  1744. f.history = append(f.history, r0)
  1745. f.mutex.Unlock()
  1746. }
  1747. // History returns a sequence of UsersStoreGetByUsernameFuncCall objects
  1748. // describing the invocations of this function.
  1749. func (f *UsersStoreGetByUsernameFunc) History() []UsersStoreGetByUsernameFuncCall {
  1750. f.mutex.Lock()
  1751. history := make([]UsersStoreGetByUsernameFuncCall, len(f.history))
  1752. copy(history, f.history)
  1753. f.mutex.Unlock()
  1754. return history
  1755. }
  1756. // UsersStoreGetByUsernameFuncCall is an object that describes an invocation
  1757. // of method GetByUsername on an instance of MockUsersStore.
  1758. type UsersStoreGetByUsernameFuncCall struct {
  1759. // Arg0 is the value of the 1st argument passed to this method
  1760. // invocation.
  1761. Arg0 context.Context
  1762. // Arg1 is the value of the 2nd argument passed to this method
  1763. // invocation.
  1764. Arg1 string
  1765. // Result0 is the value of the 1st result returned from this method
  1766. // invocation.
  1767. Result0 *database.User
  1768. // Result1 is the value of the 2nd result returned from this method
  1769. // invocation.
  1770. Result1 error
  1771. }
  1772. // Args returns an interface slice containing the arguments of this
  1773. // invocation.
  1774. func (c UsersStoreGetByUsernameFuncCall) Args() []interface{} {
  1775. return []interface{}{c.Arg0, c.Arg1}
  1776. }
  1777. // Results returns an interface slice containing the results of this
  1778. // invocation.
  1779. func (c UsersStoreGetByUsernameFuncCall) Results() []interface{} {
  1780. return []interface{}{c.Result0, c.Result1}
  1781. }
  1782. // UsersStoreGetEmailFunc describes the behavior when the GetEmail method of
  1783. // the parent MockUsersStore instance is invoked.
  1784. type UsersStoreGetEmailFunc struct {
  1785. defaultHook func(context.Context, int64, string, bool) (*database.EmailAddress, error)
  1786. hooks []func(context.Context, int64, string, bool) (*database.EmailAddress, error)
  1787. history []UsersStoreGetEmailFuncCall
  1788. mutex sync.Mutex
  1789. }
  1790. // GetEmail delegates to the next hook function in the queue and stores the
  1791. // parameter and result values of this invocation.
  1792. func (m *MockUsersStore) GetEmail(v0 context.Context, v1 int64, v2 string, v3 bool) (*database.EmailAddress, error) {
  1793. r0, r1 := m.GetEmailFunc.nextHook()(v0, v1, v2, v3)
  1794. m.GetEmailFunc.appendCall(UsersStoreGetEmailFuncCall{v0, v1, v2, v3, r0, r1})
  1795. return r0, r1
  1796. }
  1797. // SetDefaultHook sets function that is called when the GetEmail method of
  1798. // the parent MockUsersStore instance is invoked and the hook queue is
  1799. // empty.
  1800. func (f *UsersStoreGetEmailFunc) SetDefaultHook(hook func(context.Context, int64, string, bool) (*database.EmailAddress, error)) {
  1801. f.defaultHook = hook
  1802. }
  1803. // PushHook adds a function to the end of hook queue. Each invocation of the
  1804. // GetEmail method of the parent MockUsersStore instance invokes the hook at
  1805. // the front of the queue and discards it. After the queue is empty, the
  1806. // default hook function is invoked for any future action.
  1807. func (f *UsersStoreGetEmailFunc) PushHook(hook func(context.Context, int64, string, bool) (*database.EmailAddress, error)) {
  1808. f.mutex.Lock()
  1809. f.hooks = append(f.hooks, hook)
  1810. f.mutex.Unlock()
  1811. }
  1812. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  1813. // given values.
  1814. func (f *UsersStoreGetEmailFunc) SetDefaultReturn(r0 *database.EmailAddress, r1 error) {
  1815. f.SetDefaultHook(func(context.Context, int64, string, bool) (*database.EmailAddress, error) {
  1816. return r0, r1
  1817. })
  1818. }
  1819. // PushReturn calls PushHook with a function that returns the given values.
  1820. func (f *UsersStoreGetEmailFunc) PushReturn(r0 *database.EmailAddress, r1 error) {
  1821. f.PushHook(func(context.Context, int64, string, bool) (*database.EmailAddress, error) {
  1822. return r0, r1
  1823. })
  1824. }
  1825. func (f *UsersStoreGetEmailFunc) nextHook() func(context.Context, int64, string, bool) (*database.EmailAddress, error) {
  1826. f.mutex.Lock()
  1827. defer f.mutex.Unlock()
  1828. if len(f.hooks) == 0 {
  1829. return f.defaultHook
  1830. }
  1831. hook := f.hooks[0]
  1832. f.hooks = f.hooks[1:]
  1833. return hook
  1834. }
  1835. func (f *UsersStoreGetEmailFunc) appendCall(r0 UsersStoreGetEmailFuncCall) {
  1836. f.mutex.Lock()
  1837. f.history = append(f.history, r0)
  1838. f.mutex.Unlock()
  1839. }
  1840. // History returns a sequence of UsersStoreGetEmailFuncCall objects
  1841. // describing the invocations of this function.
  1842. func (f *UsersStoreGetEmailFunc) History() []UsersStoreGetEmailFuncCall {
  1843. f.mutex.Lock()
  1844. history := make([]UsersStoreGetEmailFuncCall, len(f.history))
  1845. copy(history, f.history)
  1846. f.mutex.Unlock()
  1847. return history
  1848. }
  1849. // UsersStoreGetEmailFuncCall is an object that describes an invocation of
  1850. // method GetEmail on an instance of MockUsersStore.
  1851. type UsersStoreGetEmailFuncCall struct {
  1852. // Arg0 is the value of the 1st argument passed to this method
  1853. // invocation.
  1854. Arg0 context.Context
  1855. // Arg1 is the value of the 2nd argument passed to this method
  1856. // invocation.
  1857. Arg1 int64
  1858. // Arg2 is the value of the 3rd argument passed to this method
  1859. // invocation.
  1860. Arg2 string
  1861. // Arg3 is the value of the 4th argument passed to this method
  1862. // invocation.
  1863. Arg3 bool
  1864. // Result0 is the value of the 1st result returned from this method
  1865. // invocation.
  1866. Result0 *database.EmailAddress
  1867. // Result1 is the value of the 2nd result returned from this method
  1868. // invocation.
  1869. Result1 error
  1870. }
  1871. // Args returns an interface slice containing the arguments of this
  1872. // invocation.
  1873. func (c UsersStoreGetEmailFuncCall) Args() []interface{} {
  1874. return []interface{}{c.Arg0, c.Arg1, c.Arg2, c.Arg3}
  1875. }
  1876. // Results returns an interface slice containing the results of this
  1877. // invocation.
  1878. func (c UsersStoreGetEmailFuncCall) Results() []interface{} {
  1879. return []interface{}{c.Result0, c.Result1}
  1880. }
  1881. // UsersStoreGetMailableEmailsByUsernamesFunc describes the behavior when
  1882. // the GetMailableEmailsByUsernames method of the parent MockUsersStore
  1883. // instance is invoked.
  1884. type UsersStoreGetMailableEmailsByUsernamesFunc struct {
  1885. defaultHook func(context.Context, []string) ([]string, error)
  1886. hooks []func(context.Context, []string) ([]string, error)
  1887. history []UsersStoreGetMailableEmailsByUsernamesFuncCall
  1888. mutex sync.Mutex
  1889. }
  1890. // GetMailableEmailsByUsernames delegates to the next hook function in the
  1891. // queue and stores the parameter and result values of this invocation.
  1892. func (m *MockUsersStore) GetMailableEmailsByUsernames(v0 context.Context, v1 []string) ([]string, error) {
  1893. r0, r1 := m.GetMailableEmailsByUsernamesFunc.nextHook()(v0, v1)
  1894. m.GetMailableEmailsByUsernamesFunc.appendCall(UsersStoreGetMailableEmailsByUsernamesFuncCall{v0, v1, r0, r1})
  1895. return r0, r1
  1896. }
  1897. // SetDefaultHook sets function that is called when the
  1898. // GetMailableEmailsByUsernames method of the parent MockUsersStore instance
  1899. // is invoked and the hook queue is empty.
  1900. func (f *UsersStoreGetMailableEmailsByUsernamesFunc) SetDefaultHook(hook func(context.Context, []string) ([]string, error)) {
  1901. f.defaultHook = hook
  1902. }
  1903. // PushHook adds a function to the end of hook queue. Each invocation of the
  1904. // GetMailableEmailsByUsernames method of the parent MockUsersStore instance
  1905. // invokes the hook at the front of the queue and discards it. After the
  1906. // queue is empty, the default hook function is invoked for any future
  1907. // action.
  1908. func (f *UsersStoreGetMailableEmailsByUsernamesFunc) PushHook(hook func(context.Context, []string) ([]string, error)) {
  1909. f.mutex.Lock()
  1910. f.hooks = append(f.hooks, hook)
  1911. f.mutex.Unlock()
  1912. }
  1913. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  1914. // given values.
  1915. func (f *UsersStoreGetMailableEmailsByUsernamesFunc) SetDefaultReturn(r0 []string, r1 error) {
  1916. f.SetDefaultHook(func(context.Context, []string) ([]string, error) {
  1917. return r0, r1
  1918. })
  1919. }
  1920. // PushReturn calls PushHook with a function that returns the given values.
  1921. func (f *UsersStoreGetMailableEmailsByUsernamesFunc) PushReturn(r0 []string, r1 error) {
  1922. f.PushHook(func(context.Context, []string) ([]string, error) {
  1923. return r0, r1
  1924. })
  1925. }
  1926. func (f *UsersStoreGetMailableEmailsByUsernamesFunc) nextHook() func(context.Context, []string) ([]string, error) {
  1927. f.mutex.Lock()
  1928. defer f.mutex.Unlock()
  1929. if len(f.hooks) == 0 {
  1930. return f.defaultHook
  1931. }
  1932. hook := f.hooks[0]
  1933. f.hooks = f.hooks[1:]
  1934. return hook
  1935. }
  1936. func (f *UsersStoreGetMailableEmailsByUsernamesFunc) appendCall(r0 UsersStoreGetMailableEmailsByUsernamesFuncCall) {
  1937. f.mutex.Lock()
  1938. f.history = append(f.history, r0)
  1939. f.mutex.Unlock()
  1940. }
  1941. // History returns a sequence of
  1942. // UsersStoreGetMailableEmailsByUsernamesFuncCall objects describing the
  1943. // invocations of this function.
  1944. func (f *UsersStoreGetMailableEmailsByUsernamesFunc) History() []UsersStoreGetMailableEmailsByUsernamesFuncCall {
  1945. f.mutex.Lock()
  1946. history := make([]UsersStoreGetMailableEmailsByUsernamesFuncCall, len(f.history))
  1947. copy(history, f.history)
  1948. f.mutex.Unlock()
  1949. return history
  1950. }
  1951. // UsersStoreGetMailableEmailsByUsernamesFuncCall is an object that
  1952. // describes an invocation of method GetMailableEmailsByUsernames on an
  1953. // instance of MockUsersStore.
  1954. type UsersStoreGetMailableEmailsByUsernamesFuncCall struct {
  1955. // Arg0 is the value of the 1st argument passed to this method
  1956. // invocation.
  1957. Arg0 context.Context
  1958. // Arg1 is the value of the 2nd argument passed to this method
  1959. // invocation.
  1960. Arg1 []string
  1961. // Result0 is the value of the 1st result returned from this method
  1962. // invocation.
  1963. Result0 []string
  1964. // Result1 is the value of the 2nd result returned from this method
  1965. // invocation.
  1966. Result1 error
  1967. }
  1968. // Args returns an interface slice containing the arguments of this
  1969. // invocation.
  1970. func (c UsersStoreGetMailableEmailsByUsernamesFuncCall) Args() []interface{} {
  1971. return []interface{}{c.Arg0, c.Arg1}
  1972. }
  1973. // Results returns an interface slice containing the results of this
  1974. // invocation.
  1975. func (c UsersStoreGetMailableEmailsByUsernamesFuncCall) Results() []interface{} {
  1976. return []interface{}{c.Result0, c.Result1}
  1977. }
  1978. // UsersStoreIsFollowingFunc describes the behavior when the IsFollowing
  1979. // method of the parent MockUsersStore instance is invoked.
  1980. type UsersStoreIsFollowingFunc struct {
  1981. defaultHook func(context.Context, int64, int64) bool
  1982. hooks []func(context.Context, int64, int64) bool
  1983. history []UsersStoreIsFollowingFuncCall
  1984. mutex sync.Mutex
  1985. }
  1986. // IsFollowing delegates to the next hook function in the queue and stores
  1987. // the parameter and result values of this invocation.
  1988. func (m *MockUsersStore) IsFollowing(v0 context.Context, v1 int64, v2 int64) bool {
  1989. r0 := m.IsFollowingFunc.nextHook()(v0, v1, v2)
  1990. m.IsFollowingFunc.appendCall(UsersStoreIsFollowingFuncCall{v0, v1, v2, r0})
  1991. return r0
  1992. }
  1993. // SetDefaultHook sets function that is called when the IsFollowing method
  1994. // of the parent MockUsersStore instance is invoked and the hook queue is
  1995. // empty.
  1996. func (f *UsersStoreIsFollowingFunc) SetDefaultHook(hook func(context.Context, int64, int64) bool) {
  1997. f.defaultHook = hook
  1998. }
  1999. // PushHook adds a function to the end of hook queue. Each invocation of the
  2000. // IsFollowing method of the parent MockUsersStore instance invokes the hook
  2001. // at the front of the queue and discards it. After the queue is empty, the
  2002. // default hook function is invoked for any future action.
  2003. func (f *UsersStoreIsFollowingFunc) PushHook(hook func(context.Context, int64, int64) bool) {
  2004. f.mutex.Lock()
  2005. f.hooks = append(f.hooks, hook)
  2006. f.mutex.Unlock()
  2007. }
  2008. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  2009. // given values.
  2010. func (f *UsersStoreIsFollowingFunc) SetDefaultReturn(r0 bool) {
  2011. f.SetDefaultHook(func(context.Context, int64, int64) bool {
  2012. return r0
  2013. })
  2014. }
  2015. // PushReturn calls PushHook with a function that returns the given values.
  2016. func (f *UsersStoreIsFollowingFunc) PushReturn(r0 bool) {
  2017. f.PushHook(func(context.Context, int64, int64) bool {
  2018. return r0
  2019. })
  2020. }
  2021. func (f *UsersStoreIsFollowingFunc) nextHook() func(context.Context, int64, int64) bool {
  2022. f.mutex.Lock()
  2023. defer f.mutex.Unlock()
  2024. if len(f.hooks) == 0 {
  2025. return f.defaultHook
  2026. }
  2027. hook := f.hooks[0]
  2028. f.hooks = f.hooks[1:]
  2029. return hook
  2030. }
  2031. func (f *UsersStoreIsFollowingFunc) appendCall(r0 UsersStoreIsFollowingFuncCall) {
  2032. f.mutex.Lock()
  2033. f.history = append(f.history, r0)
  2034. f.mutex.Unlock()
  2035. }
  2036. // History returns a sequence of UsersStoreIsFollowingFuncCall objects
  2037. // describing the invocations of this function.
  2038. func (f *UsersStoreIsFollowingFunc) History() []UsersStoreIsFollowingFuncCall {
  2039. f.mutex.Lock()
  2040. history := make([]UsersStoreIsFollowingFuncCall, len(f.history))
  2041. copy(history, f.history)
  2042. f.mutex.Unlock()
  2043. return history
  2044. }
  2045. // UsersStoreIsFollowingFuncCall is an object that describes an invocation
  2046. // of method IsFollowing on an instance of MockUsersStore.
  2047. type UsersStoreIsFollowingFuncCall struct {
  2048. // Arg0 is the value of the 1st argument passed to this method
  2049. // invocation.
  2050. Arg0 context.Context
  2051. // Arg1 is the value of the 2nd argument passed to this method
  2052. // invocation.
  2053. Arg1 int64
  2054. // Arg2 is the value of the 3rd argument passed to this method
  2055. // invocation.
  2056. Arg2 int64
  2057. // Result0 is the value of the 1st result returned from this method
  2058. // invocation.
  2059. Result0 bool
  2060. }
  2061. // Args returns an interface slice containing the arguments of this
  2062. // invocation.
  2063. func (c UsersStoreIsFollowingFuncCall) Args() []interface{} {
  2064. return []interface{}{c.Arg0, c.Arg1, c.Arg2}
  2065. }
  2066. // Results returns an interface slice containing the results of this
  2067. // invocation.
  2068. func (c UsersStoreIsFollowingFuncCall) Results() []interface{} {
  2069. return []interface{}{c.Result0}
  2070. }
  2071. // UsersStoreIsUsernameUsedFunc describes the behavior when the
  2072. // IsUsernameUsed method of the parent MockUsersStore instance is invoked.
  2073. type UsersStoreIsUsernameUsedFunc struct {
  2074. defaultHook func(context.Context, string, int64) bool
  2075. hooks []func(context.Context, string, int64) bool
  2076. history []UsersStoreIsUsernameUsedFuncCall
  2077. mutex sync.Mutex
  2078. }
  2079. // IsUsernameUsed delegates to the next hook function in the queue and
  2080. // stores the parameter and result values of this invocation.
  2081. func (m *MockUsersStore) IsUsernameUsed(v0 context.Context, v1 string, v2 int64) bool {
  2082. r0 := m.IsUsernameUsedFunc.nextHook()(v0, v1, v2)
  2083. m.IsUsernameUsedFunc.appendCall(UsersStoreIsUsernameUsedFuncCall{v0, v1, v2, r0})
  2084. return r0
  2085. }
  2086. // SetDefaultHook sets function that is called when the IsUsernameUsed
  2087. // method of the parent MockUsersStore instance is invoked and the hook
  2088. // queue is empty.
  2089. func (f *UsersStoreIsUsernameUsedFunc) SetDefaultHook(hook func(context.Context, string, int64) bool) {
  2090. f.defaultHook = hook
  2091. }
  2092. // PushHook adds a function to the end of hook queue. Each invocation of the
  2093. // IsUsernameUsed method of the parent MockUsersStore instance invokes the
  2094. // hook at the front of the queue and discards it. After the queue is empty,
  2095. // the default hook function is invoked for any future action.
  2096. func (f *UsersStoreIsUsernameUsedFunc) PushHook(hook func(context.Context, string, int64) bool) {
  2097. f.mutex.Lock()
  2098. f.hooks = append(f.hooks, hook)
  2099. f.mutex.Unlock()
  2100. }
  2101. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  2102. // given values.
  2103. func (f *UsersStoreIsUsernameUsedFunc) SetDefaultReturn(r0 bool) {
  2104. f.SetDefaultHook(func(context.Context, string, int64) bool {
  2105. return r0
  2106. })
  2107. }
  2108. // PushReturn calls PushHook with a function that returns the given values.
  2109. func (f *UsersStoreIsUsernameUsedFunc) PushReturn(r0 bool) {
  2110. f.PushHook(func(context.Context, string, int64) bool {
  2111. return r0
  2112. })
  2113. }
  2114. func (f *UsersStoreIsUsernameUsedFunc) nextHook() func(context.Context, string, int64) bool {
  2115. f.mutex.Lock()
  2116. defer f.mutex.Unlock()
  2117. if len(f.hooks) == 0 {
  2118. return f.defaultHook
  2119. }
  2120. hook := f.hooks[0]
  2121. f.hooks = f.hooks[1:]
  2122. return hook
  2123. }
  2124. func (f *UsersStoreIsUsernameUsedFunc) appendCall(r0 UsersStoreIsUsernameUsedFuncCall) {
  2125. f.mutex.Lock()
  2126. f.history = append(f.history, r0)
  2127. f.mutex.Unlock()
  2128. }
  2129. // History returns a sequence of UsersStoreIsUsernameUsedFuncCall objects
  2130. // describing the invocations of this function.
  2131. func (f *UsersStoreIsUsernameUsedFunc) History() []UsersStoreIsUsernameUsedFuncCall {
  2132. f.mutex.Lock()
  2133. history := make([]UsersStoreIsUsernameUsedFuncCall, len(f.history))
  2134. copy(history, f.history)
  2135. f.mutex.Unlock()
  2136. return history
  2137. }
  2138. // UsersStoreIsUsernameUsedFuncCall is an object that describes an
  2139. // invocation of method IsUsernameUsed on an instance of MockUsersStore.
  2140. type UsersStoreIsUsernameUsedFuncCall struct {
  2141. // Arg0 is the value of the 1st argument passed to this method
  2142. // invocation.
  2143. Arg0 context.Context
  2144. // Arg1 is the value of the 2nd argument passed to this method
  2145. // invocation.
  2146. Arg1 string
  2147. // Arg2 is the value of the 3rd argument passed to this method
  2148. // invocation.
  2149. Arg2 int64
  2150. // Result0 is the value of the 1st result returned from this method
  2151. // invocation.
  2152. Result0 bool
  2153. }
  2154. // Args returns an interface slice containing the arguments of this
  2155. // invocation.
  2156. func (c UsersStoreIsUsernameUsedFuncCall) Args() []interface{} {
  2157. return []interface{}{c.Arg0, c.Arg1, c.Arg2}
  2158. }
  2159. // Results returns an interface slice containing the results of this
  2160. // invocation.
  2161. func (c UsersStoreIsUsernameUsedFuncCall) Results() []interface{} {
  2162. return []interface{}{c.Result0}
  2163. }
  2164. // UsersStoreListFunc describes the behavior when the List method of the
  2165. // parent MockUsersStore instance is invoked.
  2166. type UsersStoreListFunc struct {
  2167. defaultHook func(context.Context, int, int) ([]*database.User, error)
  2168. hooks []func(context.Context, int, int) ([]*database.User, error)
  2169. history []UsersStoreListFuncCall
  2170. mutex sync.Mutex
  2171. }
  2172. // List delegates to the next hook function in the queue and stores the
  2173. // parameter and result values of this invocation.
  2174. func (m *MockUsersStore) List(v0 context.Context, v1 int, v2 int) ([]*database.User, error) {
  2175. r0, r1 := m.ListFunc.nextHook()(v0, v1, v2)
  2176. m.ListFunc.appendCall(UsersStoreListFuncCall{v0, v1, v2, r0, r1})
  2177. return r0, r1
  2178. }
  2179. // SetDefaultHook sets function that is called when the List method of the
  2180. // parent MockUsersStore instance is invoked and the hook queue is empty.
  2181. func (f *UsersStoreListFunc) SetDefaultHook(hook func(context.Context, int, int) ([]*database.User, error)) {
  2182. f.defaultHook = hook
  2183. }
  2184. // PushHook adds a function to the end of hook queue. Each invocation of the
  2185. // List method of the parent MockUsersStore instance invokes the hook at the
  2186. // front of the queue and discards it. After the queue is empty, the default
  2187. // hook function is invoked for any future action.
  2188. func (f *UsersStoreListFunc) PushHook(hook func(context.Context, int, int) ([]*database.User, error)) {
  2189. f.mutex.Lock()
  2190. f.hooks = append(f.hooks, hook)
  2191. f.mutex.Unlock()
  2192. }
  2193. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  2194. // given values.
  2195. func (f *UsersStoreListFunc) SetDefaultReturn(r0 []*database.User, r1 error) {
  2196. f.SetDefaultHook(func(context.Context, int, int) ([]*database.User, error) {
  2197. return r0, r1
  2198. })
  2199. }
  2200. // PushReturn calls PushHook with a function that returns the given values.
  2201. func (f *UsersStoreListFunc) PushReturn(r0 []*database.User, r1 error) {
  2202. f.PushHook(func(context.Context, int, int) ([]*database.User, error) {
  2203. return r0, r1
  2204. })
  2205. }
  2206. func (f *UsersStoreListFunc) nextHook() func(context.Context, int, int) ([]*database.User, error) {
  2207. f.mutex.Lock()
  2208. defer f.mutex.Unlock()
  2209. if len(f.hooks) == 0 {
  2210. return f.defaultHook
  2211. }
  2212. hook := f.hooks[0]
  2213. f.hooks = f.hooks[1:]
  2214. return hook
  2215. }
  2216. func (f *UsersStoreListFunc) appendCall(r0 UsersStoreListFuncCall) {
  2217. f.mutex.Lock()
  2218. f.history = append(f.history, r0)
  2219. f.mutex.Unlock()
  2220. }
  2221. // History returns a sequence of UsersStoreListFuncCall objects describing
  2222. // the invocations of this function.
  2223. func (f *UsersStoreListFunc) History() []UsersStoreListFuncCall {
  2224. f.mutex.Lock()
  2225. history := make([]UsersStoreListFuncCall, len(f.history))
  2226. copy(history, f.history)
  2227. f.mutex.Unlock()
  2228. return history
  2229. }
  2230. // UsersStoreListFuncCall is an object that describes an invocation of
  2231. // method List on an instance of MockUsersStore.
  2232. type UsersStoreListFuncCall struct {
  2233. // Arg0 is the value of the 1st argument passed to this method
  2234. // invocation.
  2235. Arg0 context.Context
  2236. // Arg1 is the value of the 2nd argument passed to this method
  2237. // invocation.
  2238. Arg1 int
  2239. // Arg2 is the value of the 3rd argument passed to this method
  2240. // invocation.
  2241. Arg2 int
  2242. // Result0 is the value of the 1st result returned from this method
  2243. // invocation.
  2244. Result0 []*database.User
  2245. // Result1 is the value of the 2nd result returned from this method
  2246. // invocation.
  2247. Result1 error
  2248. }
  2249. // Args returns an interface slice containing the arguments of this
  2250. // invocation.
  2251. func (c UsersStoreListFuncCall) Args() []interface{} {
  2252. return []interface{}{c.Arg0, c.Arg1, c.Arg2}
  2253. }
  2254. // Results returns an interface slice containing the results of this
  2255. // invocation.
  2256. func (c UsersStoreListFuncCall) Results() []interface{} {
  2257. return []interface{}{c.Result0, c.Result1}
  2258. }
  2259. // UsersStoreListEmailsFunc describes the behavior when the ListEmails
  2260. // method of the parent MockUsersStore instance is invoked.
  2261. type UsersStoreListEmailsFunc struct {
  2262. defaultHook func(context.Context, int64) ([]*database.EmailAddress, error)
  2263. hooks []func(context.Context, int64) ([]*database.EmailAddress, error)
  2264. history []UsersStoreListEmailsFuncCall
  2265. mutex sync.Mutex
  2266. }
  2267. // ListEmails delegates to the next hook function in the queue and stores
  2268. // the parameter and result values of this invocation.
  2269. func (m *MockUsersStore) ListEmails(v0 context.Context, v1 int64) ([]*database.EmailAddress, error) {
  2270. r0, r1 := m.ListEmailsFunc.nextHook()(v0, v1)
  2271. m.ListEmailsFunc.appendCall(UsersStoreListEmailsFuncCall{v0, v1, r0, r1})
  2272. return r0, r1
  2273. }
  2274. // SetDefaultHook sets function that is called when the ListEmails method of
  2275. // the parent MockUsersStore instance is invoked and the hook queue is
  2276. // empty.
  2277. func (f *UsersStoreListEmailsFunc) SetDefaultHook(hook func(context.Context, int64) ([]*database.EmailAddress, error)) {
  2278. f.defaultHook = hook
  2279. }
  2280. // PushHook adds a function to the end of hook queue. Each invocation of the
  2281. // ListEmails method of the parent MockUsersStore instance invokes the hook
  2282. // at the front of the queue and discards it. After the queue is empty, the
  2283. // default hook function is invoked for any future action.
  2284. func (f *UsersStoreListEmailsFunc) PushHook(hook func(context.Context, int64) ([]*database.EmailAddress, error)) {
  2285. f.mutex.Lock()
  2286. f.hooks = append(f.hooks, hook)
  2287. f.mutex.Unlock()
  2288. }
  2289. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  2290. // given values.
  2291. func (f *UsersStoreListEmailsFunc) SetDefaultReturn(r0 []*database.EmailAddress, r1 error) {
  2292. f.SetDefaultHook(func(context.Context, int64) ([]*database.EmailAddress, error) {
  2293. return r0, r1
  2294. })
  2295. }
  2296. // PushReturn calls PushHook with a function that returns the given values.
  2297. func (f *UsersStoreListEmailsFunc) PushReturn(r0 []*database.EmailAddress, r1 error) {
  2298. f.PushHook(func(context.Context, int64) ([]*database.EmailAddress, error) {
  2299. return r0, r1
  2300. })
  2301. }
  2302. func (f *UsersStoreListEmailsFunc) nextHook() func(context.Context, int64) ([]*database.EmailAddress, error) {
  2303. f.mutex.Lock()
  2304. defer f.mutex.Unlock()
  2305. if len(f.hooks) == 0 {
  2306. return f.defaultHook
  2307. }
  2308. hook := f.hooks[0]
  2309. f.hooks = f.hooks[1:]
  2310. return hook
  2311. }
  2312. func (f *UsersStoreListEmailsFunc) appendCall(r0 UsersStoreListEmailsFuncCall) {
  2313. f.mutex.Lock()
  2314. f.history = append(f.history, r0)
  2315. f.mutex.Unlock()
  2316. }
  2317. // History returns a sequence of UsersStoreListEmailsFuncCall objects
  2318. // describing the invocations of this function.
  2319. func (f *UsersStoreListEmailsFunc) History() []UsersStoreListEmailsFuncCall {
  2320. f.mutex.Lock()
  2321. history := make([]UsersStoreListEmailsFuncCall, len(f.history))
  2322. copy(history, f.history)
  2323. f.mutex.Unlock()
  2324. return history
  2325. }
  2326. // UsersStoreListEmailsFuncCall is an object that describes an invocation of
  2327. // method ListEmails on an instance of MockUsersStore.
  2328. type UsersStoreListEmailsFuncCall struct {
  2329. // Arg0 is the value of the 1st argument passed to this method
  2330. // invocation.
  2331. Arg0 context.Context
  2332. // Arg1 is the value of the 2nd argument passed to this method
  2333. // invocation.
  2334. Arg1 int64
  2335. // Result0 is the value of the 1st result returned from this method
  2336. // invocation.
  2337. Result0 []*database.EmailAddress
  2338. // Result1 is the value of the 2nd result returned from this method
  2339. // invocation.
  2340. Result1 error
  2341. }
  2342. // Args returns an interface slice containing the arguments of this
  2343. // invocation.
  2344. func (c UsersStoreListEmailsFuncCall) Args() []interface{} {
  2345. return []interface{}{c.Arg0, c.Arg1}
  2346. }
  2347. // Results returns an interface slice containing the results of this
  2348. // invocation.
  2349. func (c UsersStoreListEmailsFuncCall) Results() []interface{} {
  2350. return []interface{}{c.Result0, c.Result1}
  2351. }
  2352. // UsersStoreListFollowersFunc describes the behavior when the ListFollowers
  2353. // method of the parent MockUsersStore instance is invoked.
  2354. type UsersStoreListFollowersFunc struct {
  2355. defaultHook func(context.Context, int64, int, int) ([]*database.User, error)
  2356. hooks []func(context.Context, int64, int, int) ([]*database.User, error)
  2357. history []UsersStoreListFollowersFuncCall
  2358. mutex sync.Mutex
  2359. }
  2360. // ListFollowers delegates to the next hook function in the queue and stores
  2361. // the parameter and result values of this invocation.
  2362. func (m *MockUsersStore) ListFollowers(v0 context.Context, v1 int64, v2 int, v3 int) ([]*database.User, error) {
  2363. r0, r1 := m.ListFollowersFunc.nextHook()(v0, v1, v2, v3)
  2364. m.ListFollowersFunc.appendCall(UsersStoreListFollowersFuncCall{v0, v1, v2, v3, r0, r1})
  2365. return r0, r1
  2366. }
  2367. // SetDefaultHook sets function that is called when the ListFollowers method
  2368. // of the parent MockUsersStore instance is invoked and the hook queue is
  2369. // empty.
  2370. func (f *UsersStoreListFollowersFunc) SetDefaultHook(hook func(context.Context, int64, int, int) ([]*database.User, error)) {
  2371. f.defaultHook = hook
  2372. }
  2373. // PushHook adds a function to the end of hook queue. Each invocation of the
  2374. // ListFollowers method of the parent MockUsersStore instance invokes the
  2375. // hook at the front of the queue and discards it. After the queue is empty,
  2376. // the default hook function is invoked for any future action.
  2377. func (f *UsersStoreListFollowersFunc) PushHook(hook func(context.Context, int64, int, int) ([]*database.User, error)) {
  2378. f.mutex.Lock()
  2379. f.hooks = append(f.hooks, hook)
  2380. f.mutex.Unlock()
  2381. }
  2382. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  2383. // given values.
  2384. func (f *UsersStoreListFollowersFunc) SetDefaultReturn(r0 []*database.User, r1 error) {
  2385. f.SetDefaultHook(func(context.Context, int64, int, int) ([]*database.User, error) {
  2386. return r0, r1
  2387. })
  2388. }
  2389. // PushReturn calls PushHook with a function that returns the given values.
  2390. func (f *UsersStoreListFollowersFunc) PushReturn(r0 []*database.User, r1 error) {
  2391. f.PushHook(func(context.Context, int64, int, int) ([]*database.User, error) {
  2392. return r0, r1
  2393. })
  2394. }
  2395. func (f *UsersStoreListFollowersFunc) nextHook() func(context.Context, int64, int, int) ([]*database.User, error) {
  2396. f.mutex.Lock()
  2397. defer f.mutex.Unlock()
  2398. if len(f.hooks) == 0 {
  2399. return f.defaultHook
  2400. }
  2401. hook := f.hooks[0]
  2402. f.hooks = f.hooks[1:]
  2403. return hook
  2404. }
  2405. func (f *UsersStoreListFollowersFunc) appendCall(r0 UsersStoreListFollowersFuncCall) {
  2406. f.mutex.Lock()
  2407. f.history = append(f.history, r0)
  2408. f.mutex.Unlock()
  2409. }
  2410. // History returns a sequence of UsersStoreListFollowersFuncCall objects
  2411. // describing the invocations of this function.
  2412. func (f *UsersStoreListFollowersFunc) History() []UsersStoreListFollowersFuncCall {
  2413. f.mutex.Lock()
  2414. history := make([]UsersStoreListFollowersFuncCall, len(f.history))
  2415. copy(history, f.history)
  2416. f.mutex.Unlock()
  2417. return history
  2418. }
  2419. // UsersStoreListFollowersFuncCall is an object that describes an invocation
  2420. // of method ListFollowers on an instance of MockUsersStore.
  2421. type UsersStoreListFollowersFuncCall struct {
  2422. // Arg0 is the value of the 1st argument passed to this method
  2423. // invocation.
  2424. Arg0 context.Context
  2425. // Arg1 is the value of the 2nd argument passed to this method
  2426. // invocation.
  2427. Arg1 int64
  2428. // Arg2 is the value of the 3rd argument passed to this method
  2429. // invocation.
  2430. Arg2 int
  2431. // Arg3 is the value of the 4th argument passed to this method
  2432. // invocation.
  2433. Arg3 int
  2434. // Result0 is the value of the 1st result returned from this method
  2435. // invocation.
  2436. Result0 []*database.User
  2437. // Result1 is the value of the 2nd result returned from this method
  2438. // invocation.
  2439. Result1 error
  2440. }
  2441. // Args returns an interface slice containing the arguments of this
  2442. // invocation.
  2443. func (c UsersStoreListFollowersFuncCall) Args() []interface{} {
  2444. return []interface{}{c.Arg0, c.Arg1, c.Arg2, c.Arg3}
  2445. }
  2446. // Results returns an interface slice containing the results of this
  2447. // invocation.
  2448. func (c UsersStoreListFollowersFuncCall) Results() []interface{} {
  2449. return []interface{}{c.Result0, c.Result1}
  2450. }
  2451. // UsersStoreListFollowingsFunc describes the behavior when the
  2452. // ListFollowings method of the parent MockUsersStore instance is invoked.
  2453. type UsersStoreListFollowingsFunc struct {
  2454. defaultHook func(context.Context, int64, int, int) ([]*database.User, error)
  2455. hooks []func(context.Context, int64, int, int) ([]*database.User, error)
  2456. history []UsersStoreListFollowingsFuncCall
  2457. mutex sync.Mutex
  2458. }
  2459. // ListFollowings delegates to the next hook function in the queue and
  2460. // stores the parameter and result values of this invocation.
  2461. func (m *MockUsersStore) ListFollowings(v0 context.Context, v1 int64, v2 int, v3 int) ([]*database.User, error) {
  2462. r0, r1 := m.ListFollowingsFunc.nextHook()(v0, v1, v2, v3)
  2463. m.ListFollowingsFunc.appendCall(UsersStoreListFollowingsFuncCall{v0, v1, v2, v3, r0, r1})
  2464. return r0, r1
  2465. }
  2466. // SetDefaultHook sets function that is called when the ListFollowings
  2467. // method of the parent MockUsersStore instance is invoked and the hook
  2468. // queue is empty.
  2469. func (f *UsersStoreListFollowingsFunc) SetDefaultHook(hook func(context.Context, int64, int, int) ([]*database.User, error)) {
  2470. f.defaultHook = hook
  2471. }
  2472. // PushHook adds a function to the end of hook queue. Each invocation of the
  2473. // ListFollowings method of the parent MockUsersStore instance invokes the
  2474. // hook at the front of the queue and discards it. After the queue is empty,
  2475. // the default hook function is invoked for any future action.
  2476. func (f *UsersStoreListFollowingsFunc) PushHook(hook func(context.Context, int64, int, int) ([]*database.User, error)) {
  2477. f.mutex.Lock()
  2478. f.hooks = append(f.hooks, hook)
  2479. f.mutex.Unlock()
  2480. }
  2481. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  2482. // given values.
  2483. func (f *UsersStoreListFollowingsFunc) SetDefaultReturn(r0 []*database.User, r1 error) {
  2484. f.SetDefaultHook(func(context.Context, int64, int, int) ([]*database.User, error) {
  2485. return r0, r1
  2486. })
  2487. }
  2488. // PushReturn calls PushHook with a function that returns the given values.
  2489. func (f *UsersStoreListFollowingsFunc) PushReturn(r0 []*database.User, r1 error) {
  2490. f.PushHook(func(context.Context, int64, int, int) ([]*database.User, error) {
  2491. return r0, r1
  2492. })
  2493. }
  2494. func (f *UsersStoreListFollowingsFunc) nextHook() func(context.Context, int64, int, int) ([]*database.User, error) {
  2495. f.mutex.Lock()
  2496. defer f.mutex.Unlock()
  2497. if len(f.hooks) == 0 {
  2498. return f.defaultHook
  2499. }
  2500. hook := f.hooks[0]
  2501. f.hooks = f.hooks[1:]
  2502. return hook
  2503. }
  2504. func (f *UsersStoreListFollowingsFunc) appendCall(r0 UsersStoreListFollowingsFuncCall) {
  2505. f.mutex.Lock()
  2506. f.history = append(f.history, r0)
  2507. f.mutex.Unlock()
  2508. }
  2509. // History returns a sequence of UsersStoreListFollowingsFuncCall objects
  2510. // describing the invocations of this function.
  2511. func (f *UsersStoreListFollowingsFunc) History() []UsersStoreListFollowingsFuncCall {
  2512. f.mutex.Lock()
  2513. history := make([]UsersStoreListFollowingsFuncCall, len(f.history))
  2514. copy(history, f.history)
  2515. f.mutex.Unlock()
  2516. return history
  2517. }
  2518. // UsersStoreListFollowingsFuncCall is an object that describes an
  2519. // invocation of method ListFollowings on an instance of MockUsersStore.
  2520. type UsersStoreListFollowingsFuncCall struct {
  2521. // Arg0 is the value of the 1st argument passed to this method
  2522. // invocation.
  2523. Arg0 context.Context
  2524. // Arg1 is the value of the 2nd argument passed to this method
  2525. // invocation.
  2526. Arg1 int64
  2527. // Arg2 is the value of the 3rd argument passed to this method
  2528. // invocation.
  2529. Arg2 int
  2530. // Arg3 is the value of the 4th argument passed to this method
  2531. // invocation.
  2532. Arg3 int
  2533. // Result0 is the value of the 1st result returned from this method
  2534. // invocation.
  2535. Result0 []*database.User
  2536. // Result1 is the value of the 2nd result returned from this method
  2537. // invocation.
  2538. Result1 error
  2539. }
  2540. // Args returns an interface slice containing the arguments of this
  2541. // invocation.
  2542. func (c UsersStoreListFollowingsFuncCall) Args() []interface{} {
  2543. return []interface{}{c.Arg0, c.Arg1, c.Arg2, c.Arg3}
  2544. }
  2545. // Results returns an interface slice containing the results of this
  2546. // invocation.
  2547. func (c UsersStoreListFollowingsFuncCall) Results() []interface{} {
  2548. return []interface{}{c.Result0, c.Result1}
  2549. }
  2550. // UsersStoreMarkEmailActivatedFunc describes the behavior when the
  2551. // MarkEmailActivated method of the parent MockUsersStore instance is
  2552. // invoked.
  2553. type UsersStoreMarkEmailActivatedFunc struct {
  2554. defaultHook func(context.Context, int64, string) error
  2555. hooks []func(context.Context, int64, string) error
  2556. history []UsersStoreMarkEmailActivatedFuncCall
  2557. mutex sync.Mutex
  2558. }
  2559. // MarkEmailActivated delegates to the next hook function in the queue and
  2560. // stores the parameter and result values of this invocation.
  2561. func (m *MockUsersStore) MarkEmailActivated(v0 context.Context, v1 int64, v2 string) error {
  2562. r0 := m.MarkEmailActivatedFunc.nextHook()(v0, v1, v2)
  2563. m.MarkEmailActivatedFunc.appendCall(UsersStoreMarkEmailActivatedFuncCall{v0, v1, v2, r0})
  2564. return r0
  2565. }
  2566. // SetDefaultHook sets function that is called when the MarkEmailActivated
  2567. // method of the parent MockUsersStore instance is invoked and the hook
  2568. // queue is empty.
  2569. func (f *UsersStoreMarkEmailActivatedFunc) SetDefaultHook(hook func(context.Context, int64, string) error) {
  2570. f.defaultHook = hook
  2571. }
  2572. // PushHook adds a function to the end of hook queue. Each invocation of the
  2573. // MarkEmailActivated method of the parent MockUsersStore instance invokes
  2574. // the hook at the front of the queue and discards it. After the queue is
  2575. // empty, the default hook function is invoked for any future action.
  2576. func (f *UsersStoreMarkEmailActivatedFunc) PushHook(hook func(context.Context, int64, string) error) {
  2577. f.mutex.Lock()
  2578. f.hooks = append(f.hooks, hook)
  2579. f.mutex.Unlock()
  2580. }
  2581. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  2582. // given values.
  2583. func (f *UsersStoreMarkEmailActivatedFunc) SetDefaultReturn(r0 error) {
  2584. f.SetDefaultHook(func(context.Context, int64, string) error {
  2585. return r0
  2586. })
  2587. }
  2588. // PushReturn calls PushHook with a function that returns the given values.
  2589. func (f *UsersStoreMarkEmailActivatedFunc) PushReturn(r0 error) {
  2590. f.PushHook(func(context.Context, int64, string) error {
  2591. return r0
  2592. })
  2593. }
  2594. func (f *UsersStoreMarkEmailActivatedFunc) nextHook() func(context.Context, int64, string) error {
  2595. f.mutex.Lock()
  2596. defer f.mutex.Unlock()
  2597. if len(f.hooks) == 0 {
  2598. return f.defaultHook
  2599. }
  2600. hook := f.hooks[0]
  2601. f.hooks = f.hooks[1:]
  2602. return hook
  2603. }
  2604. func (f *UsersStoreMarkEmailActivatedFunc) appendCall(r0 UsersStoreMarkEmailActivatedFuncCall) {
  2605. f.mutex.Lock()
  2606. f.history = append(f.history, r0)
  2607. f.mutex.Unlock()
  2608. }
  2609. // History returns a sequence of UsersStoreMarkEmailActivatedFuncCall
  2610. // objects describing the invocations of this function.
  2611. func (f *UsersStoreMarkEmailActivatedFunc) History() []UsersStoreMarkEmailActivatedFuncCall {
  2612. f.mutex.Lock()
  2613. history := make([]UsersStoreMarkEmailActivatedFuncCall, len(f.history))
  2614. copy(history, f.history)
  2615. f.mutex.Unlock()
  2616. return history
  2617. }
  2618. // UsersStoreMarkEmailActivatedFuncCall is an object that describes an
  2619. // invocation of method MarkEmailActivated on an instance of MockUsersStore.
  2620. type UsersStoreMarkEmailActivatedFuncCall struct {
  2621. // Arg0 is the value of the 1st argument passed to this method
  2622. // invocation.
  2623. Arg0 context.Context
  2624. // Arg1 is the value of the 2nd argument passed to this method
  2625. // invocation.
  2626. Arg1 int64
  2627. // Arg2 is the value of the 3rd argument passed to this method
  2628. // invocation.
  2629. Arg2 string
  2630. // Result0 is the value of the 1st result returned from this method
  2631. // invocation.
  2632. Result0 error
  2633. }
  2634. // Args returns an interface slice containing the arguments of this
  2635. // invocation.
  2636. func (c UsersStoreMarkEmailActivatedFuncCall) Args() []interface{} {
  2637. return []interface{}{c.Arg0, c.Arg1, c.Arg2}
  2638. }
  2639. // Results returns an interface slice containing the results of this
  2640. // invocation.
  2641. func (c UsersStoreMarkEmailActivatedFuncCall) Results() []interface{} {
  2642. return []interface{}{c.Result0}
  2643. }
  2644. // UsersStoreMarkEmailPrimaryFunc describes the behavior when the
  2645. // MarkEmailPrimary method of the parent MockUsersStore instance is invoked.
  2646. type UsersStoreMarkEmailPrimaryFunc struct {
  2647. defaultHook func(context.Context, int64, string) error
  2648. hooks []func(context.Context, int64, string) error
  2649. history []UsersStoreMarkEmailPrimaryFuncCall
  2650. mutex sync.Mutex
  2651. }
  2652. // MarkEmailPrimary delegates to the next hook function in the queue and
  2653. // stores the parameter and result values of this invocation.
  2654. func (m *MockUsersStore) MarkEmailPrimary(v0 context.Context, v1 int64, v2 string) error {
  2655. r0 := m.MarkEmailPrimaryFunc.nextHook()(v0, v1, v2)
  2656. m.MarkEmailPrimaryFunc.appendCall(UsersStoreMarkEmailPrimaryFuncCall{v0, v1, v2, r0})
  2657. return r0
  2658. }
  2659. // SetDefaultHook sets function that is called when the MarkEmailPrimary
  2660. // method of the parent MockUsersStore instance is invoked and the hook
  2661. // queue is empty.
  2662. func (f *UsersStoreMarkEmailPrimaryFunc) SetDefaultHook(hook func(context.Context, int64, string) error) {
  2663. f.defaultHook = hook
  2664. }
  2665. // PushHook adds a function to the end of hook queue. Each invocation of the
  2666. // MarkEmailPrimary method of the parent MockUsersStore instance invokes the
  2667. // hook at the front of the queue and discards it. After the queue is empty,
  2668. // the default hook function is invoked for any future action.
  2669. func (f *UsersStoreMarkEmailPrimaryFunc) PushHook(hook func(context.Context, int64, string) error) {
  2670. f.mutex.Lock()
  2671. f.hooks = append(f.hooks, hook)
  2672. f.mutex.Unlock()
  2673. }
  2674. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  2675. // given values.
  2676. func (f *UsersStoreMarkEmailPrimaryFunc) SetDefaultReturn(r0 error) {
  2677. f.SetDefaultHook(func(context.Context, int64, string) error {
  2678. return r0
  2679. })
  2680. }
  2681. // PushReturn calls PushHook with a function that returns the given values.
  2682. func (f *UsersStoreMarkEmailPrimaryFunc) PushReturn(r0 error) {
  2683. f.PushHook(func(context.Context, int64, string) error {
  2684. return r0
  2685. })
  2686. }
  2687. func (f *UsersStoreMarkEmailPrimaryFunc) nextHook() func(context.Context, int64, string) error {
  2688. f.mutex.Lock()
  2689. defer f.mutex.Unlock()
  2690. if len(f.hooks) == 0 {
  2691. return f.defaultHook
  2692. }
  2693. hook := f.hooks[0]
  2694. f.hooks = f.hooks[1:]
  2695. return hook
  2696. }
  2697. func (f *UsersStoreMarkEmailPrimaryFunc) appendCall(r0 UsersStoreMarkEmailPrimaryFuncCall) {
  2698. f.mutex.Lock()
  2699. f.history = append(f.history, r0)
  2700. f.mutex.Unlock()
  2701. }
  2702. // History returns a sequence of UsersStoreMarkEmailPrimaryFuncCall objects
  2703. // describing the invocations of this function.
  2704. func (f *UsersStoreMarkEmailPrimaryFunc) History() []UsersStoreMarkEmailPrimaryFuncCall {
  2705. f.mutex.Lock()
  2706. history := make([]UsersStoreMarkEmailPrimaryFuncCall, len(f.history))
  2707. copy(history, f.history)
  2708. f.mutex.Unlock()
  2709. return history
  2710. }
  2711. // UsersStoreMarkEmailPrimaryFuncCall is an object that describes an
  2712. // invocation of method MarkEmailPrimary on an instance of MockUsersStore.
  2713. type UsersStoreMarkEmailPrimaryFuncCall struct {
  2714. // Arg0 is the value of the 1st argument passed to this method
  2715. // invocation.
  2716. Arg0 context.Context
  2717. // Arg1 is the value of the 2nd argument passed to this method
  2718. // invocation.
  2719. Arg1 int64
  2720. // Arg2 is the value of the 3rd argument passed to this method
  2721. // invocation.
  2722. Arg2 string
  2723. // Result0 is the value of the 1st result returned from this method
  2724. // invocation.
  2725. Result0 error
  2726. }
  2727. // Args returns an interface slice containing the arguments of this
  2728. // invocation.
  2729. func (c UsersStoreMarkEmailPrimaryFuncCall) Args() []interface{} {
  2730. return []interface{}{c.Arg0, c.Arg1, c.Arg2}
  2731. }
  2732. // Results returns an interface slice containing the results of this
  2733. // invocation.
  2734. func (c UsersStoreMarkEmailPrimaryFuncCall) Results() []interface{} {
  2735. return []interface{}{c.Result0}
  2736. }
  2737. // UsersStoreSearchByNameFunc describes the behavior when the SearchByName
  2738. // method of the parent MockUsersStore instance is invoked.
  2739. type UsersStoreSearchByNameFunc struct {
  2740. defaultHook func(context.Context, string, int, int, string) ([]*database.User, int64, error)
  2741. hooks []func(context.Context, string, int, int, string) ([]*database.User, int64, error)
  2742. history []UsersStoreSearchByNameFuncCall
  2743. mutex sync.Mutex
  2744. }
  2745. // SearchByName delegates to the next hook function in the queue and stores
  2746. // the parameter and result values of this invocation.
  2747. func (m *MockUsersStore) SearchByName(v0 context.Context, v1 string, v2 int, v3 int, v4 string) ([]*database.User, int64, error) {
  2748. r0, r1, r2 := m.SearchByNameFunc.nextHook()(v0, v1, v2, v3, v4)
  2749. m.SearchByNameFunc.appendCall(UsersStoreSearchByNameFuncCall{v0, v1, v2, v3, v4, r0, r1, r2})
  2750. return r0, r1, r2
  2751. }
  2752. // SetDefaultHook sets function that is called when the SearchByName method
  2753. // of the parent MockUsersStore instance is invoked and the hook queue is
  2754. // empty.
  2755. func (f *UsersStoreSearchByNameFunc) SetDefaultHook(hook func(context.Context, string, int, int, string) ([]*database.User, int64, error)) {
  2756. f.defaultHook = hook
  2757. }
  2758. // PushHook adds a function to the end of hook queue. Each invocation of the
  2759. // SearchByName method of the parent MockUsersStore instance invokes the
  2760. // hook at the front of the queue and discards it. After the queue is empty,
  2761. // the default hook function is invoked for any future action.
  2762. func (f *UsersStoreSearchByNameFunc) PushHook(hook func(context.Context, string, int, int, string) ([]*database.User, int64, error)) {
  2763. f.mutex.Lock()
  2764. f.hooks = append(f.hooks, hook)
  2765. f.mutex.Unlock()
  2766. }
  2767. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  2768. // given values.
  2769. func (f *UsersStoreSearchByNameFunc) SetDefaultReturn(r0 []*database.User, r1 int64, r2 error) {
  2770. f.SetDefaultHook(func(context.Context, string, int, int, string) ([]*database.User, int64, error) {
  2771. return r0, r1, r2
  2772. })
  2773. }
  2774. // PushReturn calls PushHook with a function that returns the given values.
  2775. func (f *UsersStoreSearchByNameFunc) PushReturn(r0 []*database.User, r1 int64, r2 error) {
  2776. f.PushHook(func(context.Context, string, int, int, string) ([]*database.User, int64, error) {
  2777. return r0, r1, r2
  2778. })
  2779. }
  2780. func (f *UsersStoreSearchByNameFunc) nextHook() func(context.Context, string, int, int, string) ([]*database.User, int64, error) {
  2781. f.mutex.Lock()
  2782. defer f.mutex.Unlock()
  2783. if len(f.hooks) == 0 {
  2784. return f.defaultHook
  2785. }
  2786. hook := f.hooks[0]
  2787. f.hooks = f.hooks[1:]
  2788. return hook
  2789. }
  2790. func (f *UsersStoreSearchByNameFunc) appendCall(r0 UsersStoreSearchByNameFuncCall) {
  2791. f.mutex.Lock()
  2792. f.history = append(f.history, r0)
  2793. f.mutex.Unlock()
  2794. }
  2795. // History returns a sequence of UsersStoreSearchByNameFuncCall objects
  2796. // describing the invocations of this function.
  2797. func (f *UsersStoreSearchByNameFunc) History() []UsersStoreSearchByNameFuncCall {
  2798. f.mutex.Lock()
  2799. history := make([]UsersStoreSearchByNameFuncCall, len(f.history))
  2800. copy(history, f.history)
  2801. f.mutex.Unlock()
  2802. return history
  2803. }
  2804. // UsersStoreSearchByNameFuncCall is an object that describes an invocation
  2805. // of method SearchByName on an instance of MockUsersStore.
  2806. type UsersStoreSearchByNameFuncCall struct {
  2807. // Arg0 is the value of the 1st argument passed to this method
  2808. // invocation.
  2809. Arg0 context.Context
  2810. // Arg1 is the value of the 2nd argument passed to this method
  2811. // invocation.
  2812. Arg1 string
  2813. // Arg2 is the value of the 3rd argument passed to this method
  2814. // invocation.
  2815. Arg2 int
  2816. // Arg3 is the value of the 4th argument passed to this method
  2817. // invocation.
  2818. Arg3 int
  2819. // Arg4 is the value of the 5th argument passed to this method
  2820. // invocation.
  2821. Arg4 string
  2822. // Result0 is the value of the 1st result returned from this method
  2823. // invocation.
  2824. Result0 []*database.User
  2825. // Result1 is the value of the 2nd result returned from this method
  2826. // invocation.
  2827. Result1 int64
  2828. // Result2 is the value of the 3rd result returned from this method
  2829. // invocation.
  2830. Result2 error
  2831. }
  2832. // Args returns an interface slice containing the arguments of this
  2833. // invocation.
  2834. func (c UsersStoreSearchByNameFuncCall) Args() []interface{} {
  2835. return []interface{}{c.Arg0, c.Arg1, c.Arg2, c.Arg3, c.Arg4}
  2836. }
  2837. // Results returns an interface slice containing the results of this
  2838. // invocation.
  2839. func (c UsersStoreSearchByNameFuncCall) Results() []interface{} {
  2840. return []interface{}{c.Result0, c.Result1, c.Result2}
  2841. }
  2842. // UsersStoreUnfollowFunc describes the behavior when the Unfollow method of
  2843. // the parent MockUsersStore instance is invoked.
  2844. type UsersStoreUnfollowFunc struct {
  2845. defaultHook func(context.Context, int64, int64) error
  2846. hooks []func(context.Context, int64, int64) error
  2847. history []UsersStoreUnfollowFuncCall
  2848. mutex sync.Mutex
  2849. }
  2850. // Unfollow delegates to the next hook function in the queue and stores the
  2851. // parameter and result values of this invocation.
  2852. func (m *MockUsersStore) Unfollow(v0 context.Context, v1 int64, v2 int64) error {
  2853. r0 := m.UnfollowFunc.nextHook()(v0, v1, v2)
  2854. m.UnfollowFunc.appendCall(UsersStoreUnfollowFuncCall{v0, v1, v2, r0})
  2855. return r0
  2856. }
  2857. // SetDefaultHook sets function that is called when the Unfollow method of
  2858. // the parent MockUsersStore instance is invoked and the hook queue is
  2859. // empty.
  2860. func (f *UsersStoreUnfollowFunc) SetDefaultHook(hook func(context.Context, int64, int64) error) {
  2861. f.defaultHook = hook
  2862. }
  2863. // PushHook adds a function to the end of hook queue. Each invocation of the
  2864. // Unfollow method of the parent MockUsersStore instance invokes the hook at
  2865. // the front of the queue and discards it. After the queue is empty, the
  2866. // default hook function is invoked for any future action.
  2867. func (f *UsersStoreUnfollowFunc) PushHook(hook func(context.Context, int64, int64) error) {
  2868. f.mutex.Lock()
  2869. f.hooks = append(f.hooks, hook)
  2870. f.mutex.Unlock()
  2871. }
  2872. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  2873. // given values.
  2874. func (f *UsersStoreUnfollowFunc) SetDefaultReturn(r0 error) {
  2875. f.SetDefaultHook(func(context.Context, int64, int64) error {
  2876. return r0
  2877. })
  2878. }
  2879. // PushReturn calls PushHook with a function that returns the given values.
  2880. func (f *UsersStoreUnfollowFunc) PushReturn(r0 error) {
  2881. f.PushHook(func(context.Context, int64, int64) error {
  2882. return r0
  2883. })
  2884. }
  2885. func (f *UsersStoreUnfollowFunc) nextHook() func(context.Context, int64, int64) error {
  2886. f.mutex.Lock()
  2887. defer f.mutex.Unlock()
  2888. if len(f.hooks) == 0 {
  2889. return f.defaultHook
  2890. }
  2891. hook := f.hooks[0]
  2892. f.hooks = f.hooks[1:]
  2893. return hook
  2894. }
  2895. func (f *UsersStoreUnfollowFunc) appendCall(r0 UsersStoreUnfollowFuncCall) {
  2896. f.mutex.Lock()
  2897. f.history = append(f.history, r0)
  2898. f.mutex.Unlock()
  2899. }
  2900. // History returns a sequence of UsersStoreUnfollowFuncCall objects
  2901. // describing the invocations of this function.
  2902. func (f *UsersStoreUnfollowFunc) History() []UsersStoreUnfollowFuncCall {
  2903. f.mutex.Lock()
  2904. history := make([]UsersStoreUnfollowFuncCall, len(f.history))
  2905. copy(history, f.history)
  2906. f.mutex.Unlock()
  2907. return history
  2908. }
  2909. // UsersStoreUnfollowFuncCall is an object that describes an invocation of
  2910. // method Unfollow on an instance of MockUsersStore.
  2911. type UsersStoreUnfollowFuncCall struct {
  2912. // Arg0 is the value of the 1st argument passed to this method
  2913. // invocation.
  2914. Arg0 context.Context
  2915. // Arg1 is the value of the 2nd argument passed to this method
  2916. // invocation.
  2917. Arg1 int64
  2918. // Arg2 is the value of the 3rd argument passed to this method
  2919. // invocation.
  2920. Arg2 int64
  2921. // Result0 is the value of the 1st result returned from this method
  2922. // invocation.
  2923. Result0 error
  2924. }
  2925. // Args returns an interface slice containing the arguments of this
  2926. // invocation.
  2927. func (c UsersStoreUnfollowFuncCall) Args() []interface{} {
  2928. return []interface{}{c.Arg0, c.Arg1, c.Arg2}
  2929. }
  2930. // Results returns an interface slice containing the results of this
  2931. // invocation.
  2932. func (c UsersStoreUnfollowFuncCall) Results() []interface{} {
  2933. return []interface{}{c.Result0}
  2934. }
  2935. // UsersStoreUpdateFunc describes the behavior when the Update method of the
  2936. // parent MockUsersStore instance is invoked.
  2937. type UsersStoreUpdateFunc struct {
  2938. defaultHook func(context.Context, int64, database.UpdateUserOptions) error
  2939. hooks []func(context.Context, int64, database.UpdateUserOptions) error
  2940. history []UsersStoreUpdateFuncCall
  2941. mutex sync.Mutex
  2942. }
  2943. // Update delegates to the next hook function in the queue and stores the
  2944. // parameter and result values of this invocation.
  2945. func (m *MockUsersStore) Update(v0 context.Context, v1 int64, v2 database.UpdateUserOptions) error {
  2946. r0 := m.UpdateFunc.nextHook()(v0, v1, v2)
  2947. m.UpdateFunc.appendCall(UsersStoreUpdateFuncCall{v0, v1, v2, r0})
  2948. return r0
  2949. }
  2950. // SetDefaultHook sets function that is called when the Update method of the
  2951. // parent MockUsersStore instance is invoked and the hook queue is empty.
  2952. func (f *UsersStoreUpdateFunc) SetDefaultHook(hook func(context.Context, int64, database.UpdateUserOptions) error) {
  2953. f.defaultHook = hook
  2954. }
  2955. // PushHook adds a function to the end of hook queue. Each invocation of the
  2956. // Update method of the parent MockUsersStore instance invokes the hook at
  2957. // the front of the queue and discards it. After the queue is empty, the
  2958. // default hook function is invoked for any future action.
  2959. func (f *UsersStoreUpdateFunc) PushHook(hook func(context.Context, int64, database.UpdateUserOptions) error) {
  2960. f.mutex.Lock()
  2961. f.hooks = append(f.hooks, hook)
  2962. f.mutex.Unlock()
  2963. }
  2964. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  2965. // given values.
  2966. func (f *UsersStoreUpdateFunc) SetDefaultReturn(r0 error) {
  2967. f.SetDefaultHook(func(context.Context, int64, database.UpdateUserOptions) error {
  2968. return r0
  2969. })
  2970. }
  2971. // PushReturn calls PushHook with a function that returns the given values.
  2972. func (f *UsersStoreUpdateFunc) PushReturn(r0 error) {
  2973. f.PushHook(func(context.Context, int64, database.UpdateUserOptions) error {
  2974. return r0
  2975. })
  2976. }
  2977. func (f *UsersStoreUpdateFunc) nextHook() func(context.Context, int64, database.UpdateUserOptions) error {
  2978. f.mutex.Lock()
  2979. defer f.mutex.Unlock()
  2980. if len(f.hooks) == 0 {
  2981. return f.defaultHook
  2982. }
  2983. hook := f.hooks[0]
  2984. f.hooks = f.hooks[1:]
  2985. return hook
  2986. }
  2987. func (f *UsersStoreUpdateFunc) appendCall(r0 UsersStoreUpdateFuncCall) {
  2988. f.mutex.Lock()
  2989. f.history = append(f.history, r0)
  2990. f.mutex.Unlock()
  2991. }
  2992. // History returns a sequence of UsersStoreUpdateFuncCall objects describing
  2993. // the invocations of this function.
  2994. func (f *UsersStoreUpdateFunc) History() []UsersStoreUpdateFuncCall {
  2995. f.mutex.Lock()
  2996. history := make([]UsersStoreUpdateFuncCall, len(f.history))
  2997. copy(history, f.history)
  2998. f.mutex.Unlock()
  2999. return history
  3000. }
  3001. // UsersStoreUpdateFuncCall is an object that describes an invocation of
  3002. // method Update on an instance of MockUsersStore.
  3003. type UsersStoreUpdateFuncCall struct {
  3004. // Arg0 is the value of the 1st argument passed to this method
  3005. // invocation.
  3006. Arg0 context.Context
  3007. // Arg1 is the value of the 2nd argument passed to this method
  3008. // invocation.
  3009. Arg1 int64
  3010. // Arg2 is the value of the 3rd argument passed to this method
  3011. // invocation.
  3012. Arg2 database.UpdateUserOptions
  3013. // Result0 is the value of the 1st result returned from this method
  3014. // invocation.
  3015. Result0 error
  3016. }
  3017. // Args returns an interface slice containing the arguments of this
  3018. // invocation.
  3019. func (c UsersStoreUpdateFuncCall) Args() []interface{} {
  3020. return []interface{}{c.Arg0, c.Arg1, c.Arg2}
  3021. }
  3022. // Results returns an interface slice containing the results of this
  3023. // invocation.
  3024. func (c UsersStoreUpdateFuncCall) Results() []interface{} {
  3025. return []interface{}{c.Result0}
  3026. }
  3027. // UsersStoreUseCustomAvatarFunc describes the behavior when the
  3028. // UseCustomAvatar method of the parent MockUsersStore instance is invoked.
  3029. type UsersStoreUseCustomAvatarFunc struct {
  3030. defaultHook func(context.Context, int64, []byte) error
  3031. hooks []func(context.Context, int64, []byte) error
  3032. history []UsersStoreUseCustomAvatarFuncCall
  3033. mutex sync.Mutex
  3034. }
  3035. // UseCustomAvatar delegates to the next hook function in the queue and
  3036. // stores the parameter and result values of this invocation.
  3037. func (m *MockUsersStore) UseCustomAvatar(v0 context.Context, v1 int64, v2 []byte) error {
  3038. r0 := m.UseCustomAvatarFunc.nextHook()(v0, v1, v2)
  3039. m.UseCustomAvatarFunc.appendCall(UsersStoreUseCustomAvatarFuncCall{v0, v1, v2, r0})
  3040. return r0
  3041. }
  3042. // SetDefaultHook sets function that is called when the UseCustomAvatar
  3043. // method of the parent MockUsersStore instance is invoked and the hook
  3044. // queue is empty.
  3045. func (f *UsersStoreUseCustomAvatarFunc) SetDefaultHook(hook func(context.Context, int64, []byte) error) {
  3046. f.defaultHook = hook
  3047. }
  3048. // PushHook adds a function to the end of hook queue. Each invocation of the
  3049. // UseCustomAvatar method of the parent MockUsersStore instance invokes the
  3050. // hook at the front of the queue and discards it. After the queue is empty,
  3051. // the default hook function is invoked for any future action.
  3052. func (f *UsersStoreUseCustomAvatarFunc) PushHook(hook func(context.Context, int64, []byte) error) {
  3053. f.mutex.Lock()
  3054. f.hooks = append(f.hooks, hook)
  3055. f.mutex.Unlock()
  3056. }
  3057. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  3058. // given values.
  3059. func (f *UsersStoreUseCustomAvatarFunc) SetDefaultReturn(r0 error) {
  3060. f.SetDefaultHook(func(context.Context, int64, []byte) error {
  3061. return r0
  3062. })
  3063. }
  3064. // PushReturn calls PushHook with a function that returns the given values.
  3065. func (f *UsersStoreUseCustomAvatarFunc) PushReturn(r0 error) {
  3066. f.PushHook(func(context.Context, int64, []byte) error {
  3067. return r0
  3068. })
  3069. }
  3070. func (f *UsersStoreUseCustomAvatarFunc) nextHook() func(context.Context, int64, []byte) error {
  3071. f.mutex.Lock()
  3072. defer f.mutex.Unlock()
  3073. if len(f.hooks) == 0 {
  3074. return f.defaultHook
  3075. }
  3076. hook := f.hooks[0]
  3077. f.hooks = f.hooks[1:]
  3078. return hook
  3079. }
  3080. func (f *UsersStoreUseCustomAvatarFunc) appendCall(r0 UsersStoreUseCustomAvatarFuncCall) {
  3081. f.mutex.Lock()
  3082. f.history = append(f.history, r0)
  3083. f.mutex.Unlock()
  3084. }
  3085. // History returns a sequence of UsersStoreUseCustomAvatarFuncCall objects
  3086. // describing the invocations of this function.
  3087. func (f *UsersStoreUseCustomAvatarFunc) History() []UsersStoreUseCustomAvatarFuncCall {
  3088. f.mutex.Lock()
  3089. history := make([]UsersStoreUseCustomAvatarFuncCall, len(f.history))
  3090. copy(history, f.history)
  3091. f.mutex.Unlock()
  3092. return history
  3093. }
  3094. // UsersStoreUseCustomAvatarFuncCall is an object that describes an
  3095. // invocation of method UseCustomAvatar on an instance of MockUsersStore.
  3096. type UsersStoreUseCustomAvatarFuncCall struct {
  3097. // Arg0 is the value of the 1st argument passed to this method
  3098. // invocation.
  3099. Arg0 context.Context
  3100. // Arg1 is the value of the 2nd argument passed to this method
  3101. // invocation.
  3102. Arg1 int64
  3103. // Arg2 is the value of the 3rd argument passed to this method
  3104. // invocation.
  3105. Arg2 []byte
  3106. // Result0 is the value of the 1st result returned from this method
  3107. // invocation.
  3108. Result0 error
  3109. }
  3110. // Args returns an interface slice containing the arguments of this
  3111. // invocation.
  3112. func (c UsersStoreUseCustomAvatarFuncCall) Args() []interface{} {
  3113. return []interface{}{c.Arg0, c.Arg1, c.Arg2}
  3114. }
  3115. // Results returns an interface slice containing the results of this
  3116. // invocation.
  3117. func (c UsersStoreUseCustomAvatarFuncCall) Results() []interface{} {
  3118. return []interface{}{c.Result0}
  3119. }
  3120. // MockStore is a mock implementation of the Store interface (from the
  3121. // package gogs.io/gogs/internal/route/lfs) used for unit testing.
  3122. type MockStore struct {
  3123. // AuthorizeRepositoryAccessFunc is an instance of a mock function
  3124. // object controlling the behavior of the method
  3125. // AuthorizeRepositoryAccess.
  3126. AuthorizeRepositoryAccessFunc *StoreAuthorizeRepositoryAccessFunc
  3127. // CreateLFSObjectFunc is an instance of a mock function object
  3128. // controlling the behavior of the method CreateLFSObject.
  3129. CreateLFSObjectFunc *StoreCreateLFSObjectFunc
  3130. // GetAccessTokenBySHA1Func is an instance of a mock function object
  3131. // controlling the behavior of the method GetAccessTokenBySHA1.
  3132. GetAccessTokenBySHA1Func *StoreGetAccessTokenBySHA1Func
  3133. // GetLFSObjectByOIDFunc is an instance of a mock function object
  3134. // controlling the behavior of the method GetLFSObjectByOID.
  3135. GetLFSObjectByOIDFunc *StoreGetLFSObjectByOIDFunc
  3136. // GetLFSObjectsByOIDsFunc is an instance of a mock function object
  3137. // controlling the behavior of the method GetLFSObjectsByOIDs.
  3138. GetLFSObjectsByOIDsFunc *StoreGetLFSObjectsByOIDsFunc
  3139. // GetRepositoryByNameFunc is an instance of a mock function object
  3140. // controlling the behavior of the method GetRepositoryByName.
  3141. GetRepositoryByNameFunc *StoreGetRepositoryByNameFunc
  3142. // IsTwoFactorEnabledFunc is an instance of a mock function object
  3143. // controlling the behavior of the method IsTwoFactorEnabled.
  3144. IsTwoFactorEnabledFunc *StoreIsTwoFactorEnabledFunc
  3145. // TouchAccessTokenByIDFunc is an instance of a mock function object
  3146. // controlling the behavior of the method TouchAccessTokenByID.
  3147. TouchAccessTokenByIDFunc *StoreTouchAccessTokenByIDFunc
  3148. }
  3149. // NewMockStore creates a new mock of the Store interface. All methods
  3150. // return zero values for all results, unless overwritten.
  3151. func NewMockStore() *MockStore {
  3152. return &MockStore{
  3153. AuthorizeRepositoryAccessFunc: &StoreAuthorizeRepositoryAccessFunc{
  3154. defaultHook: func(context.Context, int64, int64, database.AccessMode, database.AccessModeOptions) (r0 bool) {
  3155. return
  3156. },
  3157. },
  3158. CreateLFSObjectFunc: &StoreCreateLFSObjectFunc{
  3159. defaultHook: func(context.Context, int64, lfsutil.OID, int64, lfsutil.Storage) (r0 error) {
  3160. return
  3161. },
  3162. },
  3163. GetAccessTokenBySHA1Func: &StoreGetAccessTokenBySHA1Func{
  3164. defaultHook: func(context.Context, string) (r0 *database.AccessToken, r1 error) {
  3165. return
  3166. },
  3167. },
  3168. GetLFSObjectByOIDFunc: &StoreGetLFSObjectByOIDFunc{
  3169. defaultHook: func(context.Context, int64, lfsutil.OID) (r0 *database.LFSObject, r1 error) {
  3170. return
  3171. },
  3172. },
  3173. GetLFSObjectsByOIDsFunc: &StoreGetLFSObjectsByOIDsFunc{
  3174. defaultHook: func(context.Context, int64, ...lfsutil.OID) (r0 []*database.LFSObject, r1 error) {
  3175. return
  3176. },
  3177. },
  3178. GetRepositoryByNameFunc: &StoreGetRepositoryByNameFunc{
  3179. defaultHook: func(context.Context, int64, string) (r0 *database.Repository, r1 error) {
  3180. return
  3181. },
  3182. },
  3183. IsTwoFactorEnabledFunc: &StoreIsTwoFactorEnabledFunc{
  3184. defaultHook: func(context.Context, int64) (r0 bool) {
  3185. return
  3186. },
  3187. },
  3188. TouchAccessTokenByIDFunc: &StoreTouchAccessTokenByIDFunc{
  3189. defaultHook: func(context.Context, int64) (r0 error) {
  3190. return
  3191. },
  3192. },
  3193. }
  3194. }
  3195. // NewStrictMockStore creates a new mock of the Store interface. All methods
  3196. // panic on invocation, unless overwritten.
  3197. func NewStrictMockStore() *MockStore {
  3198. return &MockStore{
  3199. AuthorizeRepositoryAccessFunc: &StoreAuthorizeRepositoryAccessFunc{
  3200. defaultHook: func(context.Context, int64, int64, database.AccessMode, database.AccessModeOptions) bool {
  3201. panic("unexpected invocation of MockStore.AuthorizeRepositoryAccess")
  3202. },
  3203. },
  3204. CreateLFSObjectFunc: &StoreCreateLFSObjectFunc{
  3205. defaultHook: func(context.Context, int64, lfsutil.OID, int64, lfsutil.Storage) error {
  3206. panic("unexpected invocation of MockStore.CreateLFSObject")
  3207. },
  3208. },
  3209. GetAccessTokenBySHA1Func: &StoreGetAccessTokenBySHA1Func{
  3210. defaultHook: func(context.Context, string) (*database.AccessToken, error) {
  3211. panic("unexpected invocation of MockStore.GetAccessTokenBySHA1")
  3212. },
  3213. },
  3214. GetLFSObjectByOIDFunc: &StoreGetLFSObjectByOIDFunc{
  3215. defaultHook: func(context.Context, int64, lfsutil.OID) (*database.LFSObject, error) {
  3216. panic("unexpected invocation of MockStore.GetLFSObjectByOID")
  3217. },
  3218. },
  3219. GetLFSObjectsByOIDsFunc: &StoreGetLFSObjectsByOIDsFunc{
  3220. defaultHook: func(context.Context, int64, ...lfsutil.OID) ([]*database.LFSObject, error) {
  3221. panic("unexpected invocation of MockStore.GetLFSObjectsByOIDs")
  3222. },
  3223. },
  3224. GetRepositoryByNameFunc: &StoreGetRepositoryByNameFunc{
  3225. defaultHook: func(context.Context, int64, string) (*database.Repository, error) {
  3226. panic("unexpected invocation of MockStore.GetRepositoryByName")
  3227. },
  3228. },
  3229. IsTwoFactorEnabledFunc: &StoreIsTwoFactorEnabledFunc{
  3230. defaultHook: func(context.Context, int64) bool {
  3231. panic("unexpected invocation of MockStore.IsTwoFactorEnabled")
  3232. },
  3233. },
  3234. TouchAccessTokenByIDFunc: &StoreTouchAccessTokenByIDFunc{
  3235. defaultHook: func(context.Context, int64) error {
  3236. panic("unexpected invocation of MockStore.TouchAccessTokenByID")
  3237. },
  3238. },
  3239. }
  3240. }
  3241. // NewMockStoreFrom creates a new mock of the MockStore interface. All
  3242. // methods delegate to the given implementation, unless overwritten.
  3243. func NewMockStoreFrom(i Store) *MockStore {
  3244. return &MockStore{
  3245. AuthorizeRepositoryAccessFunc: &StoreAuthorizeRepositoryAccessFunc{
  3246. defaultHook: i.AuthorizeRepositoryAccess,
  3247. },
  3248. CreateLFSObjectFunc: &StoreCreateLFSObjectFunc{
  3249. defaultHook: i.CreateLFSObject,
  3250. },
  3251. GetAccessTokenBySHA1Func: &StoreGetAccessTokenBySHA1Func{
  3252. defaultHook: i.GetAccessTokenBySHA1,
  3253. },
  3254. GetLFSObjectByOIDFunc: &StoreGetLFSObjectByOIDFunc{
  3255. defaultHook: i.GetLFSObjectByOID,
  3256. },
  3257. GetLFSObjectsByOIDsFunc: &StoreGetLFSObjectsByOIDsFunc{
  3258. defaultHook: i.GetLFSObjectsByOIDs,
  3259. },
  3260. GetRepositoryByNameFunc: &StoreGetRepositoryByNameFunc{
  3261. defaultHook: i.GetRepositoryByName,
  3262. },
  3263. IsTwoFactorEnabledFunc: &StoreIsTwoFactorEnabledFunc{
  3264. defaultHook: i.IsTwoFactorEnabled,
  3265. },
  3266. TouchAccessTokenByIDFunc: &StoreTouchAccessTokenByIDFunc{
  3267. defaultHook: i.TouchAccessTokenByID,
  3268. },
  3269. }
  3270. }
  3271. // StoreAuthorizeRepositoryAccessFunc describes the behavior when the
  3272. // AuthorizeRepositoryAccess method of the parent MockStore instance is
  3273. // invoked.
  3274. type StoreAuthorizeRepositoryAccessFunc struct {
  3275. defaultHook func(context.Context, int64, int64, database.AccessMode, database.AccessModeOptions) bool
  3276. hooks []func(context.Context, int64, int64, database.AccessMode, database.AccessModeOptions) bool
  3277. history []StoreAuthorizeRepositoryAccessFuncCall
  3278. mutex sync.Mutex
  3279. }
  3280. // AuthorizeRepositoryAccess delegates to the next hook function in the
  3281. // queue and stores the parameter and result values of this invocation.
  3282. func (m *MockStore) AuthorizeRepositoryAccess(v0 context.Context, v1 int64, v2 int64, v3 database.AccessMode, v4 database.AccessModeOptions) bool {
  3283. r0 := m.AuthorizeRepositoryAccessFunc.nextHook()(v0, v1, v2, v3, v4)
  3284. m.AuthorizeRepositoryAccessFunc.appendCall(StoreAuthorizeRepositoryAccessFuncCall{v0, v1, v2, v3, v4, r0})
  3285. return r0
  3286. }
  3287. // SetDefaultHook sets function that is called when the
  3288. // AuthorizeRepositoryAccess method of the parent MockStore instance is
  3289. // invoked and the hook queue is empty.
  3290. func (f *StoreAuthorizeRepositoryAccessFunc) SetDefaultHook(hook func(context.Context, int64, int64, database.AccessMode, database.AccessModeOptions) bool) {
  3291. f.defaultHook = hook
  3292. }
  3293. // PushHook adds a function to the end of hook queue. Each invocation of the
  3294. // AuthorizeRepositoryAccess method of the parent MockStore instance invokes
  3295. // the hook at the front of the queue and discards it. After the queue is
  3296. // empty, the default hook function is invoked for any future action.
  3297. func (f *StoreAuthorizeRepositoryAccessFunc) PushHook(hook func(context.Context, int64, int64, database.AccessMode, database.AccessModeOptions) bool) {
  3298. f.mutex.Lock()
  3299. f.hooks = append(f.hooks, hook)
  3300. f.mutex.Unlock()
  3301. }
  3302. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  3303. // given values.
  3304. func (f *StoreAuthorizeRepositoryAccessFunc) SetDefaultReturn(r0 bool) {
  3305. f.SetDefaultHook(func(context.Context, int64, int64, database.AccessMode, database.AccessModeOptions) bool {
  3306. return r0
  3307. })
  3308. }
  3309. // PushReturn calls PushHook with a function that returns the given values.
  3310. func (f *StoreAuthorizeRepositoryAccessFunc) PushReturn(r0 bool) {
  3311. f.PushHook(func(context.Context, int64, int64, database.AccessMode, database.AccessModeOptions) bool {
  3312. return r0
  3313. })
  3314. }
  3315. func (f *StoreAuthorizeRepositoryAccessFunc) nextHook() func(context.Context, int64, int64, database.AccessMode, database.AccessModeOptions) bool {
  3316. f.mutex.Lock()
  3317. defer f.mutex.Unlock()
  3318. if len(f.hooks) == 0 {
  3319. return f.defaultHook
  3320. }
  3321. hook := f.hooks[0]
  3322. f.hooks = f.hooks[1:]
  3323. return hook
  3324. }
  3325. func (f *StoreAuthorizeRepositoryAccessFunc) appendCall(r0 StoreAuthorizeRepositoryAccessFuncCall) {
  3326. f.mutex.Lock()
  3327. f.history = append(f.history, r0)
  3328. f.mutex.Unlock()
  3329. }
  3330. // History returns a sequence of StoreAuthorizeRepositoryAccessFuncCall
  3331. // objects describing the invocations of this function.
  3332. func (f *StoreAuthorizeRepositoryAccessFunc) History() []StoreAuthorizeRepositoryAccessFuncCall {
  3333. f.mutex.Lock()
  3334. history := make([]StoreAuthorizeRepositoryAccessFuncCall, len(f.history))
  3335. copy(history, f.history)
  3336. f.mutex.Unlock()
  3337. return history
  3338. }
  3339. // StoreAuthorizeRepositoryAccessFuncCall is an object that describes an
  3340. // invocation of method AuthorizeRepositoryAccess on an instance of
  3341. // MockStore.
  3342. type StoreAuthorizeRepositoryAccessFuncCall struct {
  3343. // Arg0 is the value of the 1st argument passed to this method
  3344. // invocation.
  3345. Arg0 context.Context
  3346. // Arg1 is the value of the 2nd argument passed to this method
  3347. // invocation.
  3348. Arg1 int64
  3349. // Arg2 is the value of the 3rd argument passed to this method
  3350. // invocation.
  3351. Arg2 int64
  3352. // Arg3 is the value of the 4th argument passed to this method
  3353. // invocation.
  3354. Arg3 database.AccessMode
  3355. // Arg4 is the value of the 5th argument passed to this method
  3356. // invocation.
  3357. Arg4 database.AccessModeOptions
  3358. // Result0 is the value of the 1st result returned from this method
  3359. // invocation.
  3360. Result0 bool
  3361. }
  3362. // Args returns an interface slice containing the arguments of this
  3363. // invocation.
  3364. func (c StoreAuthorizeRepositoryAccessFuncCall) Args() []interface{} {
  3365. return []interface{}{c.Arg0, c.Arg1, c.Arg2, c.Arg3, c.Arg4}
  3366. }
  3367. // Results returns an interface slice containing the results of this
  3368. // invocation.
  3369. func (c StoreAuthorizeRepositoryAccessFuncCall) Results() []interface{} {
  3370. return []interface{}{c.Result0}
  3371. }
  3372. // StoreCreateLFSObjectFunc describes the behavior when the CreateLFSObject
  3373. // method of the parent MockStore instance is invoked.
  3374. type StoreCreateLFSObjectFunc struct {
  3375. defaultHook func(context.Context, int64, lfsutil.OID, int64, lfsutil.Storage) error
  3376. hooks []func(context.Context, int64, lfsutil.OID, int64, lfsutil.Storage) error
  3377. history []StoreCreateLFSObjectFuncCall
  3378. mutex sync.Mutex
  3379. }
  3380. // CreateLFSObject delegates to the next hook function in the queue and
  3381. // stores the parameter and result values of this invocation.
  3382. func (m *MockStore) CreateLFSObject(v0 context.Context, v1 int64, v2 lfsutil.OID, v3 int64, v4 lfsutil.Storage) error {
  3383. r0 := m.CreateLFSObjectFunc.nextHook()(v0, v1, v2, v3, v4)
  3384. m.CreateLFSObjectFunc.appendCall(StoreCreateLFSObjectFuncCall{v0, v1, v2, v3, v4, r0})
  3385. return r0
  3386. }
  3387. // SetDefaultHook sets function that is called when the CreateLFSObject
  3388. // method of the parent MockStore instance is invoked and the hook queue is
  3389. // empty.
  3390. func (f *StoreCreateLFSObjectFunc) SetDefaultHook(hook func(context.Context, int64, lfsutil.OID, int64, lfsutil.Storage) error) {
  3391. f.defaultHook = hook
  3392. }
  3393. // PushHook adds a function to the end of hook queue. Each invocation of the
  3394. // CreateLFSObject method of the parent MockStore instance invokes the hook
  3395. // at the front of the queue and discards it. After the queue is empty, the
  3396. // default hook function is invoked for any future action.
  3397. func (f *StoreCreateLFSObjectFunc) PushHook(hook func(context.Context, int64, lfsutil.OID, int64, lfsutil.Storage) error) {
  3398. f.mutex.Lock()
  3399. f.hooks = append(f.hooks, hook)
  3400. f.mutex.Unlock()
  3401. }
  3402. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  3403. // given values.
  3404. func (f *StoreCreateLFSObjectFunc) SetDefaultReturn(r0 error) {
  3405. f.SetDefaultHook(func(context.Context, int64, lfsutil.OID, int64, lfsutil.Storage) error {
  3406. return r0
  3407. })
  3408. }
  3409. // PushReturn calls PushHook with a function that returns the given values.
  3410. func (f *StoreCreateLFSObjectFunc) PushReturn(r0 error) {
  3411. f.PushHook(func(context.Context, int64, lfsutil.OID, int64, lfsutil.Storage) error {
  3412. return r0
  3413. })
  3414. }
  3415. func (f *StoreCreateLFSObjectFunc) nextHook() func(context.Context, int64, lfsutil.OID, int64, lfsutil.Storage) error {
  3416. f.mutex.Lock()
  3417. defer f.mutex.Unlock()
  3418. if len(f.hooks) == 0 {
  3419. return f.defaultHook
  3420. }
  3421. hook := f.hooks[0]
  3422. f.hooks = f.hooks[1:]
  3423. return hook
  3424. }
  3425. func (f *StoreCreateLFSObjectFunc) appendCall(r0 StoreCreateLFSObjectFuncCall) {
  3426. f.mutex.Lock()
  3427. f.history = append(f.history, r0)
  3428. f.mutex.Unlock()
  3429. }
  3430. // History returns a sequence of StoreCreateLFSObjectFuncCall objects
  3431. // describing the invocations of this function.
  3432. func (f *StoreCreateLFSObjectFunc) History() []StoreCreateLFSObjectFuncCall {
  3433. f.mutex.Lock()
  3434. history := make([]StoreCreateLFSObjectFuncCall, len(f.history))
  3435. copy(history, f.history)
  3436. f.mutex.Unlock()
  3437. return history
  3438. }
  3439. // StoreCreateLFSObjectFuncCall is an object that describes an invocation of
  3440. // method CreateLFSObject on an instance of MockStore.
  3441. type StoreCreateLFSObjectFuncCall struct {
  3442. // Arg0 is the value of the 1st argument passed to this method
  3443. // invocation.
  3444. Arg0 context.Context
  3445. // Arg1 is the value of the 2nd argument passed to this method
  3446. // invocation.
  3447. Arg1 int64
  3448. // Arg2 is the value of the 3rd argument passed to this method
  3449. // invocation.
  3450. Arg2 lfsutil.OID
  3451. // Arg3 is the value of the 4th argument passed to this method
  3452. // invocation.
  3453. Arg3 int64
  3454. // Arg4 is the value of the 5th argument passed to this method
  3455. // invocation.
  3456. Arg4 lfsutil.Storage
  3457. // Result0 is the value of the 1st result returned from this method
  3458. // invocation.
  3459. Result0 error
  3460. }
  3461. // Args returns an interface slice containing the arguments of this
  3462. // invocation.
  3463. func (c StoreCreateLFSObjectFuncCall) Args() []interface{} {
  3464. return []interface{}{c.Arg0, c.Arg1, c.Arg2, c.Arg3, c.Arg4}
  3465. }
  3466. // Results returns an interface slice containing the results of this
  3467. // invocation.
  3468. func (c StoreCreateLFSObjectFuncCall) Results() []interface{} {
  3469. return []interface{}{c.Result0}
  3470. }
  3471. // StoreGetAccessTokenBySHA1Func describes the behavior when the
  3472. // GetAccessTokenBySHA1 method of the parent MockStore instance is invoked.
  3473. type StoreGetAccessTokenBySHA1Func struct {
  3474. defaultHook func(context.Context, string) (*database.AccessToken, error)
  3475. hooks []func(context.Context, string) (*database.AccessToken, error)
  3476. history []StoreGetAccessTokenBySHA1FuncCall
  3477. mutex sync.Mutex
  3478. }
  3479. // GetAccessTokenBySHA1 delegates to the next hook function in the queue and
  3480. // stores the parameter and result values of this invocation.
  3481. func (m *MockStore) GetAccessTokenBySHA1(v0 context.Context, v1 string) (*database.AccessToken, error) {
  3482. r0, r1 := m.GetAccessTokenBySHA1Func.nextHook()(v0, v1)
  3483. m.GetAccessTokenBySHA1Func.appendCall(StoreGetAccessTokenBySHA1FuncCall{v0, v1, r0, r1})
  3484. return r0, r1
  3485. }
  3486. // SetDefaultHook sets function that is called when the GetAccessTokenBySHA1
  3487. // method of the parent MockStore instance is invoked and the hook queue is
  3488. // empty.
  3489. func (f *StoreGetAccessTokenBySHA1Func) SetDefaultHook(hook func(context.Context, string) (*database.AccessToken, error)) {
  3490. f.defaultHook = hook
  3491. }
  3492. // PushHook adds a function to the end of hook queue. Each invocation of the
  3493. // GetAccessTokenBySHA1 method of the parent MockStore instance invokes the
  3494. // hook at the front of the queue and discards it. After the queue is empty,
  3495. // the default hook function is invoked for any future action.
  3496. func (f *StoreGetAccessTokenBySHA1Func) PushHook(hook func(context.Context, string) (*database.AccessToken, error)) {
  3497. f.mutex.Lock()
  3498. f.hooks = append(f.hooks, hook)
  3499. f.mutex.Unlock()
  3500. }
  3501. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  3502. // given values.
  3503. func (f *StoreGetAccessTokenBySHA1Func) SetDefaultReturn(r0 *database.AccessToken, r1 error) {
  3504. f.SetDefaultHook(func(context.Context, string) (*database.AccessToken, error) {
  3505. return r0, r1
  3506. })
  3507. }
  3508. // PushReturn calls PushHook with a function that returns the given values.
  3509. func (f *StoreGetAccessTokenBySHA1Func) PushReturn(r0 *database.AccessToken, r1 error) {
  3510. f.PushHook(func(context.Context, string) (*database.AccessToken, error) {
  3511. return r0, r1
  3512. })
  3513. }
  3514. func (f *StoreGetAccessTokenBySHA1Func) nextHook() func(context.Context, string) (*database.AccessToken, error) {
  3515. f.mutex.Lock()
  3516. defer f.mutex.Unlock()
  3517. if len(f.hooks) == 0 {
  3518. return f.defaultHook
  3519. }
  3520. hook := f.hooks[0]
  3521. f.hooks = f.hooks[1:]
  3522. return hook
  3523. }
  3524. func (f *StoreGetAccessTokenBySHA1Func) appendCall(r0 StoreGetAccessTokenBySHA1FuncCall) {
  3525. f.mutex.Lock()
  3526. f.history = append(f.history, r0)
  3527. f.mutex.Unlock()
  3528. }
  3529. // History returns a sequence of StoreGetAccessTokenBySHA1FuncCall objects
  3530. // describing the invocations of this function.
  3531. func (f *StoreGetAccessTokenBySHA1Func) History() []StoreGetAccessTokenBySHA1FuncCall {
  3532. f.mutex.Lock()
  3533. history := make([]StoreGetAccessTokenBySHA1FuncCall, len(f.history))
  3534. copy(history, f.history)
  3535. f.mutex.Unlock()
  3536. return history
  3537. }
  3538. // StoreGetAccessTokenBySHA1FuncCall is an object that describes an
  3539. // invocation of method GetAccessTokenBySHA1 on an instance of MockStore.
  3540. type StoreGetAccessTokenBySHA1FuncCall struct {
  3541. // Arg0 is the value of the 1st argument passed to this method
  3542. // invocation.
  3543. Arg0 context.Context
  3544. // Arg1 is the value of the 2nd argument passed to this method
  3545. // invocation.
  3546. Arg1 string
  3547. // Result0 is the value of the 1st result returned from this method
  3548. // invocation.
  3549. Result0 *database.AccessToken
  3550. // Result1 is the value of the 2nd result returned from this method
  3551. // invocation.
  3552. Result1 error
  3553. }
  3554. // Args returns an interface slice containing the arguments of this
  3555. // invocation.
  3556. func (c StoreGetAccessTokenBySHA1FuncCall) Args() []interface{} {
  3557. return []interface{}{c.Arg0, c.Arg1}
  3558. }
  3559. // Results returns an interface slice containing the results of this
  3560. // invocation.
  3561. func (c StoreGetAccessTokenBySHA1FuncCall) Results() []interface{} {
  3562. return []interface{}{c.Result0, c.Result1}
  3563. }
  3564. // StoreGetLFSObjectByOIDFunc describes the behavior when the
  3565. // GetLFSObjectByOID method of the parent MockStore instance is invoked.
  3566. type StoreGetLFSObjectByOIDFunc struct {
  3567. defaultHook func(context.Context, int64, lfsutil.OID) (*database.LFSObject, error)
  3568. hooks []func(context.Context, int64, lfsutil.OID) (*database.LFSObject, error)
  3569. history []StoreGetLFSObjectByOIDFuncCall
  3570. mutex sync.Mutex
  3571. }
  3572. // GetLFSObjectByOID delegates to the next hook function in the queue and
  3573. // stores the parameter and result values of this invocation.
  3574. func (m *MockStore) GetLFSObjectByOID(v0 context.Context, v1 int64, v2 lfsutil.OID) (*database.LFSObject, error) {
  3575. r0, r1 := m.GetLFSObjectByOIDFunc.nextHook()(v0, v1, v2)
  3576. m.GetLFSObjectByOIDFunc.appendCall(StoreGetLFSObjectByOIDFuncCall{v0, v1, v2, r0, r1})
  3577. return r0, r1
  3578. }
  3579. // SetDefaultHook sets function that is called when the GetLFSObjectByOID
  3580. // method of the parent MockStore instance is invoked and the hook queue is
  3581. // empty.
  3582. func (f *StoreGetLFSObjectByOIDFunc) SetDefaultHook(hook func(context.Context, int64, lfsutil.OID) (*database.LFSObject, error)) {
  3583. f.defaultHook = hook
  3584. }
  3585. // PushHook adds a function to the end of hook queue. Each invocation of the
  3586. // GetLFSObjectByOID method of the parent MockStore instance invokes the
  3587. // hook at the front of the queue and discards it. After the queue is empty,
  3588. // the default hook function is invoked for any future action.
  3589. func (f *StoreGetLFSObjectByOIDFunc) PushHook(hook func(context.Context, int64, lfsutil.OID) (*database.LFSObject, error)) {
  3590. f.mutex.Lock()
  3591. f.hooks = append(f.hooks, hook)
  3592. f.mutex.Unlock()
  3593. }
  3594. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  3595. // given values.
  3596. func (f *StoreGetLFSObjectByOIDFunc) SetDefaultReturn(r0 *database.LFSObject, r1 error) {
  3597. f.SetDefaultHook(func(context.Context, int64, lfsutil.OID) (*database.LFSObject, error) {
  3598. return r0, r1
  3599. })
  3600. }
  3601. // PushReturn calls PushHook with a function that returns the given values.
  3602. func (f *StoreGetLFSObjectByOIDFunc) PushReturn(r0 *database.LFSObject, r1 error) {
  3603. f.PushHook(func(context.Context, int64, lfsutil.OID) (*database.LFSObject, error) {
  3604. return r0, r1
  3605. })
  3606. }
  3607. func (f *StoreGetLFSObjectByOIDFunc) nextHook() func(context.Context, int64, lfsutil.OID) (*database.LFSObject, error) {
  3608. f.mutex.Lock()
  3609. defer f.mutex.Unlock()
  3610. if len(f.hooks) == 0 {
  3611. return f.defaultHook
  3612. }
  3613. hook := f.hooks[0]
  3614. f.hooks = f.hooks[1:]
  3615. return hook
  3616. }
  3617. func (f *StoreGetLFSObjectByOIDFunc) appendCall(r0 StoreGetLFSObjectByOIDFuncCall) {
  3618. f.mutex.Lock()
  3619. f.history = append(f.history, r0)
  3620. f.mutex.Unlock()
  3621. }
  3622. // History returns a sequence of StoreGetLFSObjectByOIDFuncCall objects
  3623. // describing the invocations of this function.
  3624. func (f *StoreGetLFSObjectByOIDFunc) History() []StoreGetLFSObjectByOIDFuncCall {
  3625. f.mutex.Lock()
  3626. history := make([]StoreGetLFSObjectByOIDFuncCall, len(f.history))
  3627. copy(history, f.history)
  3628. f.mutex.Unlock()
  3629. return history
  3630. }
  3631. // StoreGetLFSObjectByOIDFuncCall is an object that describes an invocation
  3632. // of method GetLFSObjectByOID on an instance of MockStore.
  3633. type StoreGetLFSObjectByOIDFuncCall struct {
  3634. // Arg0 is the value of the 1st argument passed to this method
  3635. // invocation.
  3636. Arg0 context.Context
  3637. // Arg1 is the value of the 2nd argument passed to this method
  3638. // invocation.
  3639. Arg1 int64
  3640. // Arg2 is the value of the 3rd argument passed to this method
  3641. // invocation.
  3642. Arg2 lfsutil.OID
  3643. // Result0 is the value of the 1st result returned from this method
  3644. // invocation.
  3645. Result0 *database.LFSObject
  3646. // Result1 is the value of the 2nd result returned from this method
  3647. // invocation.
  3648. Result1 error
  3649. }
  3650. // Args returns an interface slice containing the arguments of this
  3651. // invocation.
  3652. func (c StoreGetLFSObjectByOIDFuncCall) Args() []interface{} {
  3653. return []interface{}{c.Arg0, c.Arg1, c.Arg2}
  3654. }
  3655. // Results returns an interface slice containing the results of this
  3656. // invocation.
  3657. func (c StoreGetLFSObjectByOIDFuncCall) Results() []interface{} {
  3658. return []interface{}{c.Result0, c.Result1}
  3659. }
  3660. // StoreGetLFSObjectsByOIDsFunc describes the behavior when the
  3661. // GetLFSObjectsByOIDs method of the parent MockStore instance is invoked.
  3662. type StoreGetLFSObjectsByOIDsFunc struct {
  3663. defaultHook func(context.Context, int64, ...lfsutil.OID) ([]*database.LFSObject, error)
  3664. hooks []func(context.Context, int64, ...lfsutil.OID) ([]*database.LFSObject, error)
  3665. history []StoreGetLFSObjectsByOIDsFuncCall
  3666. mutex sync.Mutex
  3667. }
  3668. // GetLFSObjectsByOIDs delegates to the next hook function in the queue and
  3669. // stores the parameter and result values of this invocation.
  3670. func (m *MockStore) GetLFSObjectsByOIDs(v0 context.Context, v1 int64, v2 ...lfsutil.OID) ([]*database.LFSObject, error) {
  3671. r0, r1 := m.GetLFSObjectsByOIDsFunc.nextHook()(v0, v1, v2...)
  3672. m.GetLFSObjectsByOIDsFunc.appendCall(StoreGetLFSObjectsByOIDsFuncCall{v0, v1, v2, r0, r1})
  3673. return r0, r1
  3674. }
  3675. // SetDefaultHook sets function that is called when the GetLFSObjectsByOIDs
  3676. // method of the parent MockStore instance is invoked and the hook queue is
  3677. // empty.
  3678. func (f *StoreGetLFSObjectsByOIDsFunc) SetDefaultHook(hook func(context.Context, int64, ...lfsutil.OID) ([]*database.LFSObject, error)) {
  3679. f.defaultHook = hook
  3680. }
  3681. // PushHook adds a function to the end of hook queue. Each invocation of the
  3682. // GetLFSObjectsByOIDs method of the parent MockStore instance invokes the
  3683. // hook at the front of the queue and discards it. After the queue is empty,
  3684. // the default hook function is invoked for any future action.
  3685. func (f *StoreGetLFSObjectsByOIDsFunc) PushHook(hook func(context.Context, int64, ...lfsutil.OID) ([]*database.LFSObject, error)) {
  3686. f.mutex.Lock()
  3687. f.hooks = append(f.hooks, hook)
  3688. f.mutex.Unlock()
  3689. }
  3690. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  3691. // given values.
  3692. func (f *StoreGetLFSObjectsByOIDsFunc) SetDefaultReturn(r0 []*database.LFSObject, r1 error) {
  3693. f.SetDefaultHook(func(context.Context, int64, ...lfsutil.OID) ([]*database.LFSObject, error) {
  3694. return r0, r1
  3695. })
  3696. }
  3697. // PushReturn calls PushHook with a function that returns the given values.
  3698. func (f *StoreGetLFSObjectsByOIDsFunc) PushReturn(r0 []*database.LFSObject, r1 error) {
  3699. f.PushHook(func(context.Context, int64, ...lfsutil.OID) ([]*database.LFSObject, error) {
  3700. return r0, r1
  3701. })
  3702. }
  3703. func (f *StoreGetLFSObjectsByOIDsFunc) nextHook() func(context.Context, int64, ...lfsutil.OID) ([]*database.LFSObject, error) {
  3704. f.mutex.Lock()
  3705. defer f.mutex.Unlock()
  3706. if len(f.hooks) == 0 {
  3707. return f.defaultHook
  3708. }
  3709. hook := f.hooks[0]
  3710. f.hooks = f.hooks[1:]
  3711. return hook
  3712. }
  3713. func (f *StoreGetLFSObjectsByOIDsFunc) appendCall(r0 StoreGetLFSObjectsByOIDsFuncCall) {
  3714. f.mutex.Lock()
  3715. f.history = append(f.history, r0)
  3716. f.mutex.Unlock()
  3717. }
  3718. // History returns a sequence of StoreGetLFSObjectsByOIDsFuncCall objects
  3719. // describing the invocations of this function.
  3720. func (f *StoreGetLFSObjectsByOIDsFunc) History() []StoreGetLFSObjectsByOIDsFuncCall {
  3721. f.mutex.Lock()
  3722. history := make([]StoreGetLFSObjectsByOIDsFuncCall, len(f.history))
  3723. copy(history, f.history)
  3724. f.mutex.Unlock()
  3725. return history
  3726. }
  3727. // StoreGetLFSObjectsByOIDsFuncCall is an object that describes an
  3728. // invocation of method GetLFSObjectsByOIDs on an instance of MockStore.
  3729. type StoreGetLFSObjectsByOIDsFuncCall struct {
  3730. // Arg0 is the value of the 1st argument passed to this method
  3731. // invocation.
  3732. Arg0 context.Context
  3733. // Arg1 is the value of the 2nd argument passed to this method
  3734. // invocation.
  3735. Arg1 int64
  3736. // Arg2 is a slice containing the values of the variadic arguments
  3737. // passed to this method invocation.
  3738. Arg2 []lfsutil.OID
  3739. // Result0 is the value of the 1st result returned from this method
  3740. // invocation.
  3741. Result0 []*database.LFSObject
  3742. // Result1 is the value of the 2nd result returned from this method
  3743. // invocation.
  3744. Result1 error
  3745. }
  3746. // Args returns an interface slice containing the arguments of this
  3747. // invocation. The variadic slice argument is flattened in this array such
  3748. // that one positional argument and three variadic arguments would result in
  3749. // a slice of four, not two.
  3750. func (c StoreGetLFSObjectsByOIDsFuncCall) Args() []interface{} {
  3751. trailing := []interface{}{}
  3752. for _, val := range c.Arg2 {
  3753. trailing = append(trailing, val)
  3754. }
  3755. return append([]interface{}{c.Arg0, c.Arg1}, trailing...)
  3756. }
  3757. // Results returns an interface slice containing the results of this
  3758. // invocation.
  3759. func (c StoreGetLFSObjectsByOIDsFuncCall) Results() []interface{} {
  3760. return []interface{}{c.Result0, c.Result1}
  3761. }
  3762. // StoreGetRepositoryByNameFunc describes the behavior when the
  3763. // GetRepositoryByName method of the parent MockStore instance is invoked.
  3764. type StoreGetRepositoryByNameFunc struct {
  3765. defaultHook func(context.Context, int64, string) (*database.Repository, error)
  3766. hooks []func(context.Context, int64, string) (*database.Repository, error)
  3767. history []StoreGetRepositoryByNameFuncCall
  3768. mutex sync.Mutex
  3769. }
  3770. // GetRepositoryByName delegates to the next hook function in the queue and
  3771. // stores the parameter and result values of this invocation.
  3772. func (m *MockStore) GetRepositoryByName(v0 context.Context, v1 int64, v2 string) (*database.Repository, error) {
  3773. r0, r1 := m.GetRepositoryByNameFunc.nextHook()(v0, v1, v2)
  3774. m.GetRepositoryByNameFunc.appendCall(StoreGetRepositoryByNameFuncCall{v0, v1, v2, r0, r1})
  3775. return r0, r1
  3776. }
  3777. // SetDefaultHook sets function that is called when the GetRepositoryByName
  3778. // method of the parent MockStore instance is invoked and the hook queue is
  3779. // empty.
  3780. func (f *StoreGetRepositoryByNameFunc) SetDefaultHook(hook func(context.Context, int64, string) (*database.Repository, error)) {
  3781. f.defaultHook = hook
  3782. }
  3783. // PushHook adds a function to the end of hook queue. Each invocation of the
  3784. // GetRepositoryByName method of the parent MockStore instance invokes the
  3785. // hook at the front of the queue and discards it. After the queue is empty,
  3786. // the default hook function is invoked for any future action.
  3787. func (f *StoreGetRepositoryByNameFunc) PushHook(hook func(context.Context, int64, string) (*database.Repository, error)) {
  3788. f.mutex.Lock()
  3789. f.hooks = append(f.hooks, hook)
  3790. f.mutex.Unlock()
  3791. }
  3792. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  3793. // given values.
  3794. func (f *StoreGetRepositoryByNameFunc) SetDefaultReturn(r0 *database.Repository, r1 error) {
  3795. f.SetDefaultHook(func(context.Context, int64, string) (*database.Repository, error) {
  3796. return r0, r1
  3797. })
  3798. }
  3799. // PushReturn calls PushHook with a function that returns the given values.
  3800. func (f *StoreGetRepositoryByNameFunc) PushReturn(r0 *database.Repository, r1 error) {
  3801. f.PushHook(func(context.Context, int64, string) (*database.Repository, error) {
  3802. return r0, r1
  3803. })
  3804. }
  3805. func (f *StoreGetRepositoryByNameFunc) nextHook() func(context.Context, int64, string) (*database.Repository, error) {
  3806. f.mutex.Lock()
  3807. defer f.mutex.Unlock()
  3808. if len(f.hooks) == 0 {
  3809. return f.defaultHook
  3810. }
  3811. hook := f.hooks[0]
  3812. f.hooks = f.hooks[1:]
  3813. return hook
  3814. }
  3815. func (f *StoreGetRepositoryByNameFunc) appendCall(r0 StoreGetRepositoryByNameFuncCall) {
  3816. f.mutex.Lock()
  3817. f.history = append(f.history, r0)
  3818. f.mutex.Unlock()
  3819. }
  3820. // History returns a sequence of StoreGetRepositoryByNameFuncCall objects
  3821. // describing the invocations of this function.
  3822. func (f *StoreGetRepositoryByNameFunc) History() []StoreGetRepositoryByNameFuncCall {
  3823. f.mutex.Lock()
  3824. history := make([]StoreGetRepositoryByNameFuncCall, len(f.history))
  3825. copy(history, f.history)
  3826. f.mutex.Unlock()
  3827. return history
  3828. }
  3829. // StoreGetRepositoryByNameFuncCall is an object that describes an
  3830. // invocation of method GetRepositoryByName on an instance of MockStore.
  3831. type StoreGetRepositoryByNameFuncCall struct {
  3832. // Arg0 is the value of the 1st argument passed to this method
  3833. // invocation.
  3834. Arg0 context.Context
  3835. // Arg1 is the value of the 2nd argument passed to this method
  3836. // invocation.
  3837. Arg1 int64
  3838. // Arg2 is the value of the 3rd argument passed to this method
  3839. // invocation.
  3840. Arg2 string
  3841. // Result0 is the value of the 1st result returned from this method
  3842. // invocation.
  3843. Result0 *database.Repository
  3844. // Result1 is the value of the 2nd result returned from this method
  3845. // invocation.
  3846. Result1 error
  3847. }
  3848. // Args returns an interface slice containing the arguments of this
  3849. // invocation.
  3850. func (c StoreGetRepositoryByNameFuncCall) Args() []interface{} {
  3851. return []interface{}{c.Arg0, c.Arg1, c.Arg2}
  3852. }
  3853. // Results returns an interface slice containing the results of this
  3854. // invocation.
  3855. func (c StoreGetRepositoryByNameFuncCall) Results() []interface{} {
  3856. return []interface{}{c.Result0, c.Result1}
  3857. }
  3858. // StoreIsTwoFactorEnabledFunc describes the behavior when the
  3859. // IsTwoFactorEnabled method of the parent MockStore instance is invoked.
  3860. type StoreIsTwoFactorEnabledFunc struct {
  3861. defaultHook func(context.Context, int64) bool
  3862. hooks []func(context.Context, int64) bool
  3863. history []StoreIsTwoFactorEnabledFuncCall
  3864. mutex sync.Mutex
  3865. }
  3866. // IsTwoFactorEnabled delegates to the next hook function in the queue and
  3867. // stores the parameter and result values of this invocation.
  3868. func (m *MockStore) IsTwoFactorEnabled(v0 context.Context, v1 int64) bool {
  3869. r0 := m.IsTwoFactorEnabledFunc.nextHook()(v0, v1)
  3870. m.IsTwoFactorEnabledFunc.appendCall(StoreIsTwoFactorEnabledFuncCall{v0, v1, r0})
  3871. return r0
  3872. }
  3873. // SetDefaultHook sets function that is called when the IsTwoFactorEnabled
  3874. // method of the parent MockStore instance is invoked and the hook queue is
  3875. // empty.
  3876. func (f *StoreIsTwoFactorEnabledFunc) SetDefaultHook(hook func(context.Context, int64) bool) {
  3877. f.defaultHook = hook
  3878. }
  3879. // PushHook adds a function to the end of hook queue. Each invocation of the
  3880. // IsTwoFactorEnabled method of the parent MockStore instance invokes the
  3881. // hook at the front of the queue and discards it. After the queue is empty,
  3882. // the default hook function is invoked for any future action.
  3883. func (f *StoreIsTwoFactorEnabledFunc) PushHook(hook func(context.Context, int64) bool) {
  3884. f.mutex.Lock()
  3885. f.hooks = append(f.hooks, hook)
  3886. f.mutex.Unlock()
  3887. }
  3888. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  3889. // given values.
  3890. func (f *StoreIsTwoFactorEnabledFunc) SetDefaultReturn(r0 bool) {
  3891. f.SetDefaultHook(func(context.Context, int64) bool {
  3892. return r0
  3893. })
  3894. }
  3895. // PushReturn calls PushHook with a function that returns the given values.
  3896. func (f *StoreIsTwoFactorEnabledFunc) PushReturn(r0 bool) {
  3897. f.PushHook(func(context.Context, int64) bool {
  3898. return r0
  3899. })
  3900. }
  3901. func (f *StoreIsTwoFactorEnabledFunc) nextHook() func(context.Context, int64) bool {
  3902. f.mutex.Lock()
  3903. defer f.mutex.Unlock()
  3904. if len(f.hooks) == 0 {
  3905. return f.defaultHook
  3906. }
  3907. hook := f.hooks[0]
  3908. f.hooks = f.hooks[1:]
  3909. return hook
  3910. }
  3911. func (f *StoreIsTwoFactorEnabledFunc) appendCall(r0 StoreIsTwoFactorEnabledFuncCall) {
  3912. f.mutex.Lock()
  3913. f.history = append(f.history, r0)
  3914. f.mutex.Unlock()
  3915. }
  3916. // History returns a sequence of StoreIsTwoFactorEnabledFuncCall objects
  3917. // describing the invocations of this function.
  3918. func (f *StoreIsTwoFactorEnabledFunc) History() []StoreIsTwoFactorEnabledFuncCall {
  3919. f.mutex.Lock()
  3920. history := make([]StoreIsTwoFactorEnabledFuncCall, len(f.history))
  3921. copy(history, f.history)
  3922. f.mutex.Unlock()
  3923. return history
  3924. }
  3925. // StoreIsTwoFactorEnabledFuncCall is an object that describes an invocation
  3926. // of method IsTwoFactorEnabled on an instance of MockStore.
  3927. type StoreIsTwoFactorEnabledFuncCall struct {
  3928. // Arg0 is the value of the 1st argument passed to this method
  3929. // invocation.
  3930. Arg0 context.Context
  3931. // Arg1 is the value of the 2nd argument passed to this method
  3932. // invocation.
  3933. Arg1 int64
  3934. // Result0 is the value of the 1st result returned from this method
  3935. // invocation.
  3936. Result0 bool
  3937. }
  3938. // Args returns an interface slice containing the arguments of this
  3939. // invocation.
  3940. func (c StoreIsTwoFactorEnabledFuncCall) Args() []interface{} {
  3941. return []interface{}{c.Arg0, c.Arg1}
  3942. }
  3943. // Results returns an interface slice containing the results of this
  3944. // invocation.
  3945. func (c StoreIsTwoFactorEnabledFuncCall) Results() []interface{} {
  3946. return []interface{}{c.Result0}
  3947. }
  3948. // StoreTouchAccessTokenByIDFunc describes the behavior when the
  3949. // TouchAccessTokenByID method of the parent MockStore instance is invoked.
  3950. type StoreTouchAccessTokenByIDFunc struct {
  3951. defaultHook func(context.Context, int64) error
  3952. hooks []func(context.Context, int64) error
  3953. history []StoreTouchAccessTokenByIDFuncCall
  3954. mutex sync.Mutex
  3955. }
  3956. // TouchAccessTokenByID delegates to the next hook function in the queue and
  3957. // stores the parameter and result values of this invocation.
  3958. func (m *MockStore) TouchAccessTokenByID(v0 context.Context, v1 int64) error {
  3959. r0 := m.TouchAccessTokenByIDFunc.nextHook()(v0, v1)
  3960. m.TouchAccessTokenByIDFunc.appendCall(StoreTouchAccessTokenByIDFuncCall{v0, v1, r0})
  3961. return r0
  3962. }
  3963. // SetDefaultHook sets function that is called when the TouchAccessTokenByID
  3964. // method of the parent MockStore instance is invoked and the hook queue is
  3965. // empty.
  3966. func (f *StoreTouchAccessTokenByIDFunc) SetDefaultHook(hook func(context.Context, int64) error) {
  3967. f.defaultHook = hook
  3968. }
  3969. // PushHook adds a function to the end of hook queue. Each invocation of the
  3970. // TouchAccessTokenByID method of the parent MockStore instance invokes the
  3971. // hook at the front of the queue and discards it. After the queue is empty,
  3972. // the default hook function is invoked for any future action.
  3973. func (f *StoreTouchAccessTokenByIDFunc) PushHook(hook func(context.Context, int64) error) {
  3974. f.mutex.Lock()
  3975. f.hooks = append(f.hooks, hook)
  3976. f.mutex.Unlock()
  3977. }
  3978. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  3979. // given values.
  3980. func (f *StoreTouchAccessTokenByIDFunc) SetDefaultReturn(r0 error) {
  3981. f.SetDefaultHook(func(context.Context, int64) error {
  3982. return r0
  3983. })
  3984. }
  3985. // PushReturn calls PushHook with a function that returns the given values.
  3986. func (f *StoreTouchAccessTokenByIDFunc) PushReturn(r0 error) {
  3987. f.PushHook(func(context.Context, int64) error {
  3988. return r0
  3989. })
  3990. }
  3991. func (f *StoreTouchAccessTokenByIDFunc) nextHook() func(context.Context, int64) error {
  3992. f.mutex.Lock()
  3993. defer f.mutex.Unlock()
  3994. if len(f.hooks) == 0 {
  3995. return f.defaultHook
  3996. }
  3997. hook := f.hooks[0]
  3998. f.hooks = f.hooks[1:]
  3999. return hook
  4000. }
  4001. func (f *StoreTouchAccessTokenByIDFunc) appendCall(r0 StoreTouchAccessTokenByIDFuncCall) {
  4002. f.mutex.Lock()
  4003. f.history = append(f.history, r0)
  4004. f.mutex.Unlock()
  4005. }
  4006. // History returns a sequence of StoreTouchAccessTokenByIDFuncCall objects
  4007. // describing the invocations of this function.
  4008. func (f *StoreTouchAccessTokenByIDFunc) History() []StoreTouchAccessTokenByIDFuncCall {
  4009. f.mutex.Lock()
  4010. history := make([]StoreTouchAccessTokenByIDFuncCall, len(f.history))
  4011. copy(history, f.history)
  4012. f.mutex.Unlock()
  4013. return history
  4014. }
  4015. // StoreTouchAccessTokenByIDFuncCall is an object that describes an
  4016. // invocation of method TouchAccessTokenByID on an instance of MockStore.
  4017. type StoreTouchAccessTokenByIDFuncCall struct {
  4018. // Arg0 is the value of the 1st argument passed to this method
  4019. // invocation.
  4020. Arg0 context.Context
  4021. // Arg1 is the value of the 2nd argument passed to this method
  4022. // invocation.
  4023. Arg1 int64
  4024. // Result0 is the value of the 1st result returned from this method
  4025. // invocation.
  4026. Result0 error
  4027. }
  4028. // Args returns an interface slice containing the arguments of this
  4029. // invocation.
  4030. func (c StoreTouchAccessTokenByIDFuncCall) Args() []interface{} {
  4031. return []interface{}{c.Arg0, c.Arg1}
  4032. }
  4033. // Results returns an interface slice containing the results of this
  4034. // invocation.
  4035. func (c StoreTouchAccessTokenByIDFuncCall) Results() []interface{} {
  4036. return []interface{}{c.Result0}
  4037. }