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

Goでデーモンを作ってみる

 Goでデーモンを作ってみる

Go Conference 2016 SprintのLT資料です。 #gocon
サンプルコード: https://gist.github.com/hironobu-s/548b98c63d4cb6cede95

F52f57f9b8a5de82dcc02f8d7b0b76f1?s=128

Hironobu Saitoh

April 23, 2016
Tweet

Transcript

  1. (PͰσʔϞϯΛ࡞ͬͯΈΔ (P$POGFSFODF4QSJOH )JSPOPCV4BJUPI

  2. w ੪౻߂৴ ͻΖͷͿ  w (.0*OUFSOFU *OD w 0QFO4UBDLͱ͔Ϋϥ΢υͷ࢓ࣄͯ͠·͢ @hironobu_s

    hironobu.saitoh hironobu-s
  3. (PͰσʔϞϯΛॻ͖͍ͨ

  4. σʔϞϯΛॻ͖͍ͨ w ࣗ࡞ͷ(PϓϩάϥϜͰඞཁʹͳͬͨ w JOJUE΍TVQFSWJTPSE΍TZTUFNEͰ΍Δͷ͕ਖ਼࿦ͬΆ͍ w Ͱ΋৭ʑ໘౗ͳͷͰ୯ಠͰಈ͘΍͕ͭ΄͔ͬͨ͠

  5. σʔϞϯ w ཁ͸όοΫάϥ΢ϯυϓϩηεͷ͜ͱ w IUUQEͱ͔NZTRMEͱ͔ w EBFNPO͸ʮѱຐʯͰ͸ͳ͘ʮकޢਆʯͷ͜ͱ w Ұൠతʹ͸GPSL 

    ͯࣗ͠෼ࣗ਎Λෳ੡ͯ͠ɺ਌͕ऴྃ͢Ε͹ྑ͍
  6. σʔϞϯԽ GPSL

  7. TZTDBMM3BX4ZTDBMM (PͰ΋ҰԠͰ͖Δ

  8. TZTDBMM3BX4ZTDBMM 8JOEPXTͰ͸ಈ͔ͳ͍

  9. GPSL͸ແཧ IUUQTHJUIVCDPNHPMBOHHPJTTVFT 2(PͰGPSLͨ͠ΓσʔϞϯͭͬͨ͘Γ͢Δʹ͸ Ͳ͏͢Δͷ͕ྑ͍ͷ͔ͳʁʁʁ

  10. GPSL͸ແཧ IUUQTHJUIVCDPNHPMBOHHPJTTVFT (Pʹ؆୯ʹ௥Ճ͢Δͷ͸ແཧͩΑ ͋ͱɺ͜ͷ࣮૷͸ϓϩάϥϜ͕ ϚϧνεϨουͷ࣌͸ͪΌΜͱಈ͔ΜΑ

  11. ͡Ό͊Ͳ͏͢ΔΑʁ w PT4UBSU1SPDFTT ΍FYFD$PNNBOE Λ࢖͏ w ࣗ෼ࣗ਎Λ֎෦ίϚϯυͱ࣮ͯ͠ߦ͢Δ w ˢGPSL ͱ͸ҧ͏ͷͰ޻෉͕͍Δ

  12. ޻෉ w ਌ϓϩηε͸ࢠϓϩηεΛϑϥά DIJME ෇͖Ͱ࣮ߦ͢Δ w ਌ࢠͰ͸ύΠϓΛ࢖ͬͯϓϩηεؒ௨৴Λ͢Δ IUUQTHJTUHJUIVCDPNIJSPOPCVTCDEDCDFEF

  13. σʔϞϯԽ (P

  14. ࣗ෼ࣗ਎Λ࣮ߦ͢Δ IUUQTHJTUHJUIVCDPNIJSPOPCVTCDEDCDFEF

  15. NBJO IUUQTHJTUHJUIVCDPNIJSPOPCVTCDEDCDFEF

  16. PT1JQF IUUQTHJTUHJUIVCDPNIJSPOPCVTCDEDCDFEF FYFD$.%

  17. ͓ΘΓʹ w (PͳΓͷ΍ΓํͰ΍ͬͯΈͨ w (JU)VCͷϦϙδτϦݟͯ΋େମಉ͡Α͏ͳײ͡  w ଞʹྑ͍΍Γํ͋ͬͨΒ஌Γ͍ͨ w 0QFO4UBDLڵຯ͋Δਓ͓༑ୡʹͳͬͯԼ͍͞

    IUUQTHJTUHJUIVCDPNIJSPOPCVTCDEDCDFEF