Upgrade to Pro — share decks privately, control downloads, hide ads and more …

日報を golang で支える技術

日報を golang で支える技術

github-nippou という gem を golang で書き直したお話です。
https://developer.feedforce.jp/entry/2017/10/16/150000

D6c5403c0b6ef2f9fd51910ea38323a3?s=128

Takashi Masuda

October 14, 2017
Tweet

More Decks by Takashi Masuda

Other Decks in Programming

Transcript

  1. ̋̋Λࢧ͑Δٕज़ ૿ాو࢜ !NBTVUBLB

  2. ೔̋Λࢧ͑Δٕज़ ૿ాو࢜ !NBTVUBLB

  3. ೔ใΛࢧ͑Δٕज़ ૿ాو࢜ !NBTVUBLB

  4. ͜Ε·Ͱͷ͓࿩ w ͷࣾ಺ษڧձͰɺHJUIVCOJQQPVͱ͍͏HFN Λ࡞ͬͨ࿩Λͨ͠ w (JU)VCͷࠓ೔ͷߦಈΛ੔ܗͯ͠ग़ྗ͢Δπʔϧ w ݩ͸-*/&ͷ͖͚ͨʔ !LJUBL ͞ΜͷεΫϦϓτ

    w (JU)VCͷ&WFOUT"1*ͷ࢓༷ʹԊͬͨΓɺฒྻॲཧΛ ࣮૷ͨ͠Γͯ͠ɺͦͦ͜͜ຬ଍Ͱ͖Δπʔϧʹͳͬͨ IUUQTNBTVUBLBOFUDIBMPXIUNM
  5. ࠷ۙͷ HJUIVCOJQQPV

  6. !SZ[

  7. WϦϦʔε w (JTU্ͷઃఆϑΝΠϧͰग़ྗϑΥʔϚοτΛมߋՄೳʹͳͬͨCZ !SZ[ w ্هʹ൐͍αϒίϚϯυʮJOJUʯΛ௥ՃCZ!SZ[ w ઃఆϑΝΠϧͷ63-Λϒϥ΢βͰ։͘αϒίϚϯυʮPQFOTFUUJOHTʯ Λ௥Ճ w

    %PDLFSJ[F w ςετ STQFD ΛಋೖCZ!SZ[ w 5SBWJT$*Λಋೖ IUUQTHJUIVCDPNNBTVUBLBHJUIVCOJQQPVSFMFBTFTUBHW
  8. WϦϦʔε w ઃఆϑΝΠϧͷॻࣜΛগ͠มߋ IUUQTHJUIVCDPNNBTVUBLBHJUIVCOJQQPVSFMFBTFTUBHW

  9. WϦϦʔε w αϒίϚϯυʮJOJUʯʹॳظઃఆॲཧΛ͢΂ͯ· ͱΊͨ IUUQTHJUIVCDPNNBTVUBLBHJUIVCOJQQPVSFMFBTFTUBHW

  10. w ͻͱͭͷεΫϦϓτ͔Βɺ๞͖ͣʹΑ͘࡞Γࠐ Μͩͳͱݴ͏ײ૝ w ΋͏͜ΕҎ্΍ΕΔ͜ͱ͸ͳ͍Ͱ͋Ζ͏

  11. Ͱ΋ɺ

  12. Α͘෼͔Βͳ͍͚Ͳɺ ٸʹ΍Δؾ͕ग़͖ͯͨʂ

  13. None
  14. ೔ใΛࢧ͑Δٕज़ ૿ాو࢜ !NBTVUBLB HPMBOHͰ

  15. WϦϦʔε͠·͢ HJUQVTIPSJHJOHPMBOH HJUCSPXTFSFNPUFQS 8BJU$*BOE.FSHF13 HJUDIFDLPVUNBTUFS HJUQVMM NBLFEJTU NBLFSFMFBTF PQFOIUUQTHJUIVCDPNNBTVUBLBHJUIVC OJQQPVSFMFBTFTUBHW

    "EESFMFBTFOPUF $*͕Ϳ͚ͬͭ ຊ൪ ??
  16. WϦϦʔε w ϢʔβʹҰ੾ӨڹΛ༩͑ͣʹɺ͢΂ͯHPMBOHͰ ॻ͖׵͑ͨ w %PDLFSJ[F͸Ұ୴ഇࢭ IUUQTHJUIVCDPNNBTVUBLBHJUIVCOJQQPVSFMFBTFTUBHW

  17. )PNFCSFX޲͚ϦϦʔε &EJUHJUIVCOJQQPVSC HJUBEEHJUIVCOJQQPVSC HJUDPNNJUN"EEGPSNVMB HJUQVTIPSJHJONBTUFS PQFOIUUQTHJUIVCDPNNBTVUBLBIPNFCSFX HJUIVCOJQQPVTFUUJOHT .BLFQVCMJD CSFXJOTUBMMNBTVUBLBHJUIVCOJQQPVHJUIVCOJQQPV ग़དྷΔ͸ͣɻ

  18. Ϟνϕʔγϣϯ w ҎલɺIVCίϚϯυ͕SVCZ͔ΒHPMBOHʹҠߦͨ࣌͠ɺ ͔͍͍ͬ͜ͳʔͱࢥ͍ͬͯͨ w SVCZͷ$-*Λ%PDLFSJ[Fͯ͠ϙʔλϏϦςΟΛߴΊΔͷ͸ Կ͔͕ҧ͏ͱ͍͏ؾ࣋ͪ w %PDLFSJ[FͰ࢖͑ͳ͘ͳΔػೳ΋͋Δʢྫɿϒϥ΢β Ͱ։͘ʣ

    w !SZ[͔Β΋Βͬͨݩؾ IUUQTHJUIVCDPNHJUIVCIVCSFMFBTFTUBHW
  19. Ͳ͏ਐΊ͔ͨ  ίΞػೳ͔ΒҠ২։࢝ w ϩδοΫ͸3VCZͰ׬੒͍ͯͨ͠ͷͰɺΨʔοͱॻ্͖͛Β Εͨ w ͱ͸ݴ͑ɺக໋తͳԿ͔ΛҰ൪ڪΕ͍ͯͨ  αϒίϚϯυΛҠ২

     ςετΛҠ২  .BLFpMF࡞ΓࠐΈ
  20. ୅ସϥΠϒϥϦͳͲ SVCZ HPMBOH PDUPLJUHFN HJUIVCDPNHPPHMFHPHJUIVC ˞ QBSBMMFMHFN 5ISFBE HPSPVUJOF DIBOOFM

    UIPSHFN HJUIVCDPNTQGDPCSB :".-.PEVMF HPQLHJOZBNMW MBVODIZHFN HJUIVCDPNTLSBUDIEPUPQFOHPMBOH IJHIMJOFHFN GNUQBDLBHF /BNFEGPSNBUTUSJOH UFYUUFNQMBUFQBDLBHF ˞ ˞HJUIVCDPNPDUPLJUHPPDUPLJU͸։ൃ͕ࢭ·͍ͬͯ·͢ ˞಺෦Ͱ\IPHF^Λ\\IPHF^^ʹม׵͠·ͨ͠
  21. ୅ସϩδοΫͳͲ w 0DUPLJU$MJFOUTDPQFT ˞ ͳΜ͍ͯ͏ศརϝιο υ͸ͳ͔ͬͨɻίʔυΛಡΜͰ MJCHFU$MJFOU4DPQFT Λࣗ࡞ͨ͠ w "TTFU

    DPOpHTFUUJOHTZNM ͸ϓϩάϥϜ͔Βࢀ রͰ͖ͳ͘ͳΔɻHJUIVCDPNKUFFVXFOHP CJOEBUBͰCJOEBUBHPʹม׵ɻ͍͍ײ͡ͷNBLF ͷSVMF΋ॻ͍ͨ ˞IUUQTHPPHMN[D#J.
  22. –Takashi Masuda 2017 “ಉ͡΋ͷ͸ͻͱͭͱͯ͠࢖͑ͳ͍”

  23. ྑ͔ͬͨ͜ͱ w Πϯετʔϧ΍Ξοϓσʔτ͕༰қʹͳͬͨ w ྫɿ)PNFCSFXͰΠϯετʔϧ w ྫɿ#JU#BSͰΞοϓσʔτݕ஌ IUUQTHFUCJUCBSDPNQMVHJOT%FW)PNFCSFXCSFXVQEBUFTITI

  24. ྑ͔ͬͨ͜ͱ w ༧૝֎ͷύϑΥʔϚϯε޲্ w ྫHJUIVCOJQQPVTT w 3VCZTFD w HPMBOHTFD w

    ͍͍ͩͨഒҎ্଎͍
  25. ྑ͔ͬͨ͜ͱ w ݁Ռతʹ͍ΖΜͳϥΠϒϥϦΛ࢖͑ͯɺྑ͍ૉ ৼΓʹͳͬͨ w HPMBOHͷϥΠϒϥϦΛࢼ͢৺ཧతোน͕ݮͬ ͨ

  26. ࠔͬͨ͜ͱ w ͱʹ͔ؔ͘਺͕௕͘ͳΓ͕ͪ w HFU999 ଟ͘ͳΓ͗͢ w ϑΝΠϧ෼ׂͷҙຯ w ॻ͚͹ॻ͘΄ͲHPMBOHͬΆ͍ॻ͖ํ͕෼͔Βͳ͘ͳΔ

    w 001Ͱ͸ͳ͍͜ͱ΁ͷށ࿭͍ʢঃʑʹʣ w 3VCZ͕ॊೈ͗ͯ͢Ҡ২͸೉͔ͬͨ͠ɻΦεεϝ͸͠ͳ͍
  27. ਫ਼ਆతʹେมͩͬͨ͜ͱ w ਫ໘ԼͰਐΊͨ͜ͱ w $*΍ϦϦʔεͷςετ͕ग़དྷͳ͍ͷͰɺͿͬ ͚ͭຊ൪ w ༵ۚͷΠϯϑϥڞ༗ձͰͷϙʔΧʔϑΣΠε w ษڧձ·Ͱʹؒʹ߹͏ͷ͔ʁͱ͍͏যΓ

  28. ٙ໰ͳͲ w DMBTTઃܭͰศརͩͬͨɺQSJWBUFNFUIPEͷ୅ΘΓ w ઃܭ͠௚͢΂͖͔ w DMBTTΛ࢖Θͳ͔ͬͨࠒͷ+4ͷ஌ݟΛ஌Γ͍ͨ w ϏδωεϩδοΫͷύοέʔδ໊͸Ͳ͏͢Ε͹ w

    ࠓճ͸MJCʹͨ͠
  29. ײ૝ w ࠓޙɺSVCZHFNTͰ$-*πʔϧΛ࡞Δ͜ͱ͸ͳ͍ ͱࢥ͏ɻܧଓར༻Λߟ͑ΔͱקΊͮΒ͍ w HPMBOH͸୯ҰϑΝΠϧͰͷ࣮૷ͱ࣮ߦʹҰ൪ ϋʔυϧ͕௿͍ؾ͕͍ͯ͠Δ w ΋ͬͱָͳݴޠ͋ͬͨΒڭ͑ͯ IUUQTHJUIVCDPNHJUIVCIVCSFMFBTFTUBHW

  30. ࠓޙͷ༧ఆ w HPMBOHͬΆ͍ॻ͖ํʹ͢Δ w ΋ͬͱςετΛॻ͘ w HPMBOHPO-BNCEB΍"1*αʔό΋ֶश͢Δ w ʰελʔςΟϯά(PݴޠʱΛಡΈ੾Δ

  31. ͓࿳ͼ w !SZ[ͷίʔυ͸શ෦ͳ͘ͳΓ·ͨ͠ɻਃ͠ ༁͍͟͝·ͤΜ

  32. ׬