Web API × Clean Architecture / CleanArchitecture Go

7afaad8f870ef79e2c3284a91e13f0b3?s=47 nakabonne
September 23, 2018

Web API × Clean Architecture / CleanArchitecture Go

7afaad8f870ef79e2c3284a91e13f0b3?s=128

nakabonne

September 23, 2018
Tweet

Transcript

  1. 8FC"1* º $MFBO"SDIJUFDUVSF ʙ(PʹΑΔ࣮૷ύλʔϯʙ

  2. .F wதඌྋ !OBLBCPOOF  wதԝେֶ঎ֶ෦೥ wגࣜձࣾαΠόʔΤʔδΣϯτ JOUFSOTIJQ

  3. "HFOEB w ࠓ೔ͷΰʔϧ w $MFBO"SDIJUFDUVSFͱ͸ w ࣮૷ύλʔϯͷ঺հ

  4. ࠓ೔ͷΰʔϧ

  5. ࠓ೔ͷΰʔϧ 8FC"1*Λθϩ͔Β࡞Δ࣌ͷ Ҿ͖ग़͕͠Ұͭ૿͑Δ

  6. $MFBO"SDIJUFDUVSFͱ͸

  7. ͦͷલʹ

  8. ͜Μͳίʔυॻ͍ͯ·ͤΜ͔ʁ

  9. Ϣʔβʔ৘ใΛฦ͢ॲཧ

  10. Ϣʔβʔ৘ใΛฦ͢ॲཧ ˡ6TFSߏ଄ମʹVTFSςʔϒϧͷ஋ΛϚοϐϯά ˡϏδωεʹ͓͚Δ6TFSͱ͍͏֓೦Λද͢σʔλߏ଄ ˡΫϥΠΞϯτͰදࣔ͢ΔͨΊʹVTFSΛKTPOʹͯ͠ฦ͢

  11. Ϣʔβʔ৘ใΛฦ͢ॲཧ Ϗδωεʹ͓͚Δ6TFSͱ͍͏֓೦͕ %#ʹ΋6*ʹ΋ґଘͯ͠͠·͍ͬͯΔ

  12. ґଘʹΑΔ໰୊ w 6*มߋ͢ΔͱϏδωεϩδοΫ΋มߋ͕ඞཁʹͳΔ w ςετ࣌ʹ%#Λ༻ҙ͠ͳ͍ͱ͍͚ͳ͍ w ϏδωεϩδοΫͰԿͯ͠Δͷ͔෼͔ΓͮΒ͍

  13. ϏδωεϩδοΫΛִ཭͢Ε͹Α͘Ͷʁ

  14. $MFBO"SDIJUFDUVSFͱ͸ ιϑτ΢ΣΞΛϨΠϠʔʹ෼͚Δ͜ͱʹΑͬͯ ؔ৺ͷ෼཭Λୡ੒͢ΔͨΊͷΞʔΩςΫνϟύλʔϯͷͭ

  15. $MFBO"SDIJUFDUVSFͱ͸ ιϑτ΢ΣΞΛϨΠϠʔʹ෼͚Δ͜ͱʹΑͬͯ ؔ৺ͷ෼཭Λୡ੒͢ΔͨΊͷΞʔΩςΫνϟύλʔϯͷͭ ʁ

  16. ͭͷ૚

  17. &OUJUJFT૚ w ϏδωεϩδοΫʹඞཁͳσʔλߏ଄ͱϝιουͷηοτ ྫ 4/4ʹ͓͚ΔϢʔβʔ΍౤ߘΛද͢Ϋϥε΍ߏ଄ମ

  18. 6TFDBTF૚ w &OUJUJFTΛར༻ͯ͠ϏδωεϩδοΫΛهड़͢Δ ྫ ౤ߘϑΥʔϜͷೖྗΛ%#ʹૠೖ͠ɺ݁ՌΛग़ྗ͢Δ

  19. *OUFSGBDF"EBQUFS૚ w ֎քͱϏδωεϞσϧͷؒͷσʔλม׵Λ͢Δ ྫ 03.ͱϏδωεϞσϧͷ٧Ίସ͑

  20. 'SBNFXPSLT%SJWFST૚ w ֎քͱͷڥքʹ͋Γɺ૬ޓʹ௨৴͢Δ ྫ %#ͱͷίωΫγϣϯɺϧʔςΟϯά

  21. ϨΠϠʔͷ෼͚ํ w͜ͷ૚Ͱͳ͍͍ͯ͘ wͨͩɺด࠯ੑڞ௨ͷݪଇ $$1 ʹଇͬͯ෼͚Δ ɹɹˠಉ͡ཧ༝Ͱมߋ͢Δίϯϙʔωϯτ͸·ͱΊΔ w ࢀߟɿ*NBO5VNPSBOHͷ l5SZJOH$MFBO"SDIJUFDUVSFPO(PMBOHz

  22. ͳͥґଘํ޲Λ಺ଆʹറΔͷʁ w ϏδωεϩδοΫ͕ͦΕ୯ମͰςετग़དྷΔ w Πϯϑϥ΍6*ͷมߋ͕༰қʹͳΔ ґଘํ޲͕಺ଆͷΈˠ%#΍6*͕ͳͯ͘΋ΞϓϦέʔγϣϯ͕ಈ͘

  23. ࣮૷ύλʔϯͷ঺հ

  24. ࡞Δ΋ͷ w VTFSʹ1045ͯ͠Ϣʔβʔొ࿥͢Δ͢Δ͚ͩͷ"1* w IUUQTHJUIVCDPNOBLBCPOOFDMFBOBSDIJUFDUVSFTBNQMF

  25. ґଘؔ܎ͷపఈ w ґଘؔ܎͸಺ଆ΁อͭඞཁ͕͋Δ w ͔͠͠ͲΜͳϓϩάϥϜʹ΋ೖྗͱग़ྗ͕͋Δ

  26. ґଘؔ܎ͷపఈ w ґଘؔ܎͸಺ଆ΁อͭඞཁ͕͋Δ w ͔͠͠ͲΜͳϓϩάϥϜʹ΋ೖྗͱग़ྗ͕͋Δ ಺ଆ͔Β֎ଆ΁ґଘ͍ͨ͠৔໘͕ඞͣ๚ΕΔ

  27. ґଘؔ܎ٯసͷݪଇ w 40-*%ݪଇͷҰͭ w ґଘؔ܎͕۩৅Ͱ͸ͳ͘ந৅͚ͩΛࢀরͯ͠Δ΋ͷ͕ɺ࠷ ΋ॊೈͳγεςϜͰ͋Δ w ಺ଆ͸֎ଆʹґଘ͢ΔͷͰ͸ͳ͘ɺந৅ʹґଘ͢Δ΂͖

  28. ґଘؔ܎ٯసͷݪଇ ίʔυྫ ಺͔Β൪໨ͷBEBQUFS૚ͷॲཧ ͜ͷ%#อଘ͢Δ۩৅࣮૷ΛϏδωεϩδοΫͰ࢖͍͍ͨ

  29. ґଘؔ܎ٯసͷݪଇ ίʔυྫ ಺͔Β൪໨ͷVTFDBTF૚ͷॲཧ VTFDBTF૚ʹந৅Λఆ͓ٛͯ͘͠

  30. ґଘؔ܎ٯసͷݪଇ ίʔυྫ ಺͔Β൪໨ͷVTFDBTF૚ͷॲཧ VTFSΛετϨʔδʹอଘ͢Δॲཧ͸ͨͬͨ͜Ε͚ͩ

  31. (PʹΑΔ࣮૷ͷҰྫ

  32. 3PVUJOH Ұ൪֎ଆͷ૚ͷॲཧ %#ίωΫγϣϯ΍ϩΨʔͷ۩৅ܕΛ ಺ଆͷ૚ʹ౉͢ˣ ˣ8"'΁ͷґଘΛ͜ͷ૚ʹݶఆ

  33. $POUSPMMFS ಺͔Β൪໨ͷBEBQUFS૚ͷॲཧ ˡΤϯυϙΠϯτຖͷ*0Λఆٛ ˡϏδωεϩδοΫ༻ͷσʔλߏ଄ͱ*0༻ͷ΋ͷΛม׵ ˢ

  34. 03. ಺͔Β൪໨ͷBEBQUFS૚ͷॲཧ ˣυϝΠϯϞσϧΛฦ͢

  35. ·ͱΊ

  36. $MFBO"SDIJUFDUVSF w ϏδωεϩδοΫΛִ཭͢Δͱ͍͍͜ͱ͋Δ w $MFBO"SDIJUFDUVSF͸͍͍ײ͡ʹϏδωεϩδοΫΛִ཭Ͱ͖Δ w εςʔΫϗϧμʔͷଟ͍8FC"1*͸$MFBO"SDIJUFDUVSFʹ޲͍ͯͦ͏ w ґଘ͸಺ଆ΁ͷ୯Ұํ޲ʹݶఆ͢Δ w

    ಺ˠ֎ʹґଘͨ͘͠ͳͬͨΒந৅ʹґଘ͢Δ
  37. $MFBO"SDIJUFDUVSF͸ສ෺ʹରԠͰ͖Δ ۜͷ஄ؙͰ͸ͳ͍ w VTFSొ࿥͚ͩͰ͜Μͳେ͖ͳ"1*ʹͳͬͯ͠·͏ w ந৅Խ͸ෳࡶԽ w ण໋͸௕͘ɺن໛͸େ͖͘ͳΔ͜ͱ͕༧૝͞ΕΔBQQҎ֎ ͸͋·Γ͓͢͢ΊͰ͖ͳ͍

  38. ͋Γ͕ͱ͏͍͟͝·ͨ͠ αϯϓϧίʔυ IUUQTHJUIVCDPNOBLBCPOOFDMFBOBSDIJUFDUVSFTBNQMF