Slide 1

Slide 1 text

Go/GAEͰ࡞Δ ۚ༥γεςϜ גࣜձࣾωΫετΧϨϯγʔ

Slide 2

Slide 2 text

Agenda • ձࣾʹ͍ͭͯ • 4ͭͷʮ͍͍ͧʯ - Google App Engine(GAE)͸͍͍ͧ - Stackdriver Logging͸͍͍ͧ - Protocol Buffers͸͍͍ͧ - Golang͸͍͍ͧ

Slide 3

Slide 3 text

ձࣾʹ͍ͭͯ

Slide 4

Slide 4 text

גࣜձࣾ ωΫετΧϨϯγʔ

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

Ӷҙ੡࡞தʂ

Slide 7

Slide 7 text

Ծ૝௨՟ަ׵ۀ

Slide 8

Slide 8 text

ϒϩοΫνΣʔϯ

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

ۚ༥

Slide 11

Slide 11 text

͓٬༷ͷ͓ۚΛ ͓༬͔Γ͢Δ

Slide 12

Slide 12 text

ߴ͍҆શੑ

Slide 13

Slide 13 text

ۀքͷྲྀΕ͸ૣ͍

Slide 14

Slide 14 text

ߴ଎ͳ։ൃ͕ ٻΊΒΕΔ

Slide 15

Slide 15 text

Server Side CONCEPT

Slide 16

Slide 16 text

Environment is Easy Code is Simple

Slide 17

Slide 17 text

؀ڥ͸؆୯ʹ ίʔυ͸୯७ʹ

Slide 18

Slide 18 text

࢖༻ٕज़ • Google Cloud Platform - Google App Engine - Cloud SQL - Datastore - Cloud Functions • Golang - ϝΠϯͱͳΔϩδοΫ • Node.js - Cloud FunctionsͰͷϩάૢ࡞

Slide 19

Slide 19 text

࢖༻ٕज़ • Google Cloud Platform - Google App Engine - Cloud SQL - Datastore - Cloud Functions • Golang - ϝΠϯͱͳΔϩδοΫ • Node.js - Cloud FunctionsͰͷϩάૢ࡞

Slide 20

Slide 20 text

࢖༻ٕज़ • Google Cloud Platform - Google App Engine - Cloud SQL - Datastore - Cloud Functions • Golang - ϝΠϯͱͳΔϩδοΫ • Node.js - Cloud FunctionsͰͷϩάૢ࡞ &BTZ

Slide 21

Slide 21 text

࢖༻ٕज़ • Google Cloud Platform - Google App Engine - Cloud SQL - Datastore - Cloud Functions • Golang - ϝΠϯͱͳΔϩδοΫ • Node.js - Cloud FunctionsͰͷϩάૢ࡞

Slide 22

Slide 22 text

࢖༻ٕज़ • Google Cloud Platform - Google App Engine - Cloud SQL - Datastore - Cloud Functions • Golang - ϝΠϯͱͳΔϩδοΫ • Node.js - Cloud FunctionsͰͷϩάૢ࡞ 4JNQMF

Slide 23

Slide 23 text

։ൃதʹൃݟͨ͠

Slide 24

Slide 24 text

ʮ˓˓͸͍͍ͧʯ

Slide 25

Slide 25 text

4ͭͷʮ͍͍ͧʯ • Google App Engine(GAE)͸͍͍ͧ • Stackdriver Logging͸͍͍ͧ • Protocol Buffers͸͍͍ͧ • Golang͸͍͍ͧ

Slide 26

Slide 26 text

Google App Engine(GAE)͸ ͍͍ͧ

Slide 27

Slide 27 text

Google App Engine • Google͕ఏڙ͍ͯ͠ΔPaaS • Python, Java, Node.js, PHP, Goʹඪ४ͰରԠ • ඇৗʹߴ͍Մ༻ੑ

Slide 28

Slide 28 text

What is “͍͍ͧ”?

Slide 29

Slide 29 text

ָ

Slide 30

Slide 30 text

ΠϯϑϥߏஙͰͷ՝୊ • Blue/GreenσϓϩΠ͕࣮ݱͰ͖Δ͔ • ద੾ʹεέʔϧΞ΢τͰ͖Δ͔ • ηΩϡϦςΟʹ໰୊͕ͳ͍͔

Slide 31

Slide 31 text

ΠϯϑϥߏஙͰͷ՝୊ • Blue/GreenσϓϩΠ͕࣮ݱͰ͖Δ͔ - GAEΛ࢖͏ͱղܾ • ద੾ʹεέʔϧΞ΢τͰ͖Δ͔ - GAEΛ࢖͏ͱղܾ • ηΩϡϦςΟʹ໰୊͕ͳ͍͔ - GAEΛ࢖͏ͱ෦෼తʹղܾ

Slide 32

Slide 32 text

GAEͷߏ଄ ("&

Slide 33

Slide 33 text

GAEͷߏ଄ ("& ϓϩδΣΫτʹͭ

Slide 34

Slide 34 text

GAEͷߏ଄ ("& "1* ʮ4FSWJDFʯͱ͍͏୯Ґ

Slide 35

Slide 35 text

GAEͷߏ଄ ("& "1* runtime: go api_version: go1.9 service: api handlers: - url: /.* secure: always script: _go_app

Slide 36

Slide 36 text

GAEͷߏ଄ ("& "1* ໾ׂ͝ͱʹ෼ׂ

Slide 37

Slide 37 text

GAEͷߏ଄ ("& "1* "ENJO

Slide 38

Slide 38 text

GAEͷߏ଄ ("& "1* "ENJO #BUDI

Slide 39

Slide 39 text

GAEͷߏ଄ ("& "1* ࣗಈͰ63-͕ৼΒΕΔ api-dot-project.appspot.com

Slide 40

Slide 40 text

GAEͷߏ଄ ("& "1* ࣗ෼Ͱ63-Λ ৼΔ͜ͱ΋Ͱ͖Δ

Slide 41

Slide 41 text

GAEͷߏ଄ ("& "1* WFSTJPO ʮ7FSTJPOʯͱ͍͏୯Ґ ͜ͷ୯ҐͰσϓϩΠ͢Δ

Slide 42

Slide 42 text

GAEͷߏ଄ ("& "1* WFSTJPO WFSTJPO αʔϏεͷதʹ ෳ਺ͷόʔδϣϯ͕͋Δ

Slide 43

Slide 43 text

GAEͷߏ଄ ("& "1* WFSTJPO WFSTJPO ࣗಈͰ63-͕ৼΒΕΔ version1-dot-api-dot- project.appspot.com

Slide 44

Slide 44 text

GAEͷߏ଄ ("& "1* WFSTJPO WFSTJPO 7FSTJPOຖʹ
 τϥϑΟοΫΛ੍ޚ͢Δ

Slide 45

Slide 45 text

GAEͷߏ଄ ("& "1* WFSTJPO WFSTJPO τϥϑΟοΫ

Slide 46

Slide 46 text

GAEͷߏ଄ ("& "1* WFSTJPO WFSTJPO τϥϑΟοΫ

Slide 47

Slide 47 text

GAEͷߏ଄ ("& "1* WFSTJPO WFSTJPO τϥϑΟοΫ

Slide 48

Slide 48 text

GAEͷߏ଄ ("& "1* WFSTJPO WFSTJPO ʮ*OTUBODFʯͱ͍͏୯Ґ ͜ͷ୯ҐͰॲཧ͞ΕΔ

Slide 49

Slide 49 text

GAEͷߏ଄ ("& "1* WFSTJPO WFSTJPO

Slide 50

Slide 50 text

GAEͷߏ଄ ("& "1* WFSTJPO WFSTJPO େ͖͍τϥϑΟοΫ

Slide 51

Slide 51 text

GAEͷߏ଄ ("& "1* WFSTJPO WFSTJPO େ͖͍τϥϑΟοΫ

Slide 52

Slide 52 text

GAEͷߏ଄ ("& "1* WFSTJPO WFSTJPO খ͍͞τϥϑΟοΫ

Slide 53

Slide 53 text

ΠϯϑϥߏஙͰͷ՝୊ • Blue/GreenσϓϩΠ͕࣮ݱͰ͖Δ͔ - GAEΛ࢖͏ͱղܾ • ద੾ʹεέʔϧΞ΢τͰ͖Δ͔ - GAEΛ࢖͏ͱղܾ • ηΩϡϦςΟʹ໰୊͕ͳ͍͔ - GAEΛ࢖͏ͱ෦෼తʹղܾ

Slide 54

Slide 54 text

Blue/GreenσϓϩΠ • GAEͷόʔδϣϯͷػೳͰղܾ • τϥϑΟοΫͷ੾Γସ͑͸Graceful • ϝϯς༻όʔδϣϯࣄલʹσϓϩΠ͓͚ͯ͠͹
 ϝϯς੾Γସ͑΋Easy

Slide 55

Slide 55 text

εέʔϧΠϯ/Ξ΢τ • ઃఆ͓͚͑ͯ͞͠͹উखʹ΍ͬͯ͘ΕΔ - Goͷ৔߹্ཱ͕ͪΓʹ਺ेϛϦඵ • εέʔϧΞ΢τ΋2छྨ͋Δ - େྔͷϦΫΤετͷͨΊͷAutomatic - όον౳௕͍ॲཧͷͨΊͷBasic

Slide 56

Slide 56 text

ηΩϡϦςΟ • Πϯελϯε΁ͷ৵ೖ͸جຊతʹ͸ෆՄೳ • DDoS΋͋Δఔ౓·Ͱ͸GAEͰ΍ͬͯ͘ΕΔ • ϛυϧ΢ΣΞͷ੬ऑੑ໰୊͕ѹ౗తʹগͳ͍ - Google͕উखʹରԠͯ͘͠ΕΔ • ίʔυͷηΩϡϦςΟ͸ผ

Slide 57

Slide 57 text

ΠϯϑϥߏஙͰ ೰·ͳ͍͍ͯ͘ʂ

Slide 58

Slide 58 text

Google App Engine(GAE)͸ ͍͍ͧ

Slide 59

Slide 59 text

Stackdriver Logging͸͍͍ͧ

Slide 60

Slide 60 text

Stackdriver Logging • ϑϧϚωʔδυͳϩΪϯάαʔϏε • GCPͰग़ྗ͞ΕΔϩά͕શͯू໿͞ΕΔ • Pub/Sub(Queue)ʹ؆୯ʹྲྀͤΔ - Ճ޻΍௨஌ָ͕ • ϑΟϧλػೳ • GCPͰग़ྗ͞ΕΔϩά͕
 શͯू໿͞ΕΔ

Slide 61

Slide 61 text

What is “͍͍ͧ”?

Slide 62

Slide 62 text

GCPͰग़ྗ͞ΕΔ ϩά͕શͯू໿ ͞ΕΔ(3ճ໨)

Slide 63

Slide 63 text

(ࣗ෼͕GCPΛ ৮ͬͯҰ൪ײಈͨ͠ αʔϏε)

Slide 64

Slide 64 text

No content

Slide 65

Slide 65 text

No content

Slide 66

Slide 66 text

No content

Slide 67

Slide 67 text

No content

Slide 68

Slide 68 text

No content

Slide 69

Slide 69 text

No content

Slide 70

Slide 70 text

Կ΋ͯ͠ͳ͍ʂʂʂ

Slide 71

Slide 71 text

No content

Slide 72

Slide 72 text

No content

Slide 73

Slide 73 text

No content

Slide 74

Slide 74 text

No content

Slide 75

Slide 75 text

No content

Slide 76

Slide 76 text

No content

Slide 77

Slide 77 text

No content

Slide 78

Slide 78 text

No content

Slide 79

Slide 79 text

No content

Slide 80

Slide 80 text

No content

Slide 81

Slide 81 text

No content

Slide 82

Slide 82 text

ϩάऩूΛ ߟ͑ͳ͍͍ͯ͘ʂʂ

Slide 83

Slide 83 text

Stackdriver Logging͸͍͍ͧ

Slide 84

Slide 84 text

Protocol Buffers͸ ͍͍ͧ

Slide 85

Slide 85 text

ಥવͰ͕࣭͢໰Ͱ͢

Slide 86

Slide 86 text

APIυΩϡϝϯτ Ͳ͏ͯ͠·͔͢ʁ

Slide 87

Slide 87 text

ࣾ಺Wiki

Slide 88

Slide 88 text

Swagger Blueprint

Slide 89

Slide 89 text

JSON Schema

Slide 90

Slide 90 text

ϓϩδΣΫτͷ README

Slide 91

Slide 91 text

΋͏1࣭ͭ໰Ͱ͢

Slide 92

Slide 92 text

ϝϯςφϯε ͞Εͯ·͔͢……?

Slide 93

Slide 93 text

APIυΩϡϝϯτͷ ՝୊

Slide 94

Slide 94 text

࣮૷ͱͷဃ཭

Slide 95

Slide 95 text

࣮૷ͱͷဃ཭ • υΩϡϝϯτΛॻ͔ͳͯ͘΋࣮૷͕Ͱ͖Δ • ࣮૷ͷมߋʹυΩϡϝϯτ͕௥ै͠ͳ͍ • υΩϡϝϯτΛهड़͢Δπʔϧͷशಘίετ • ࣮ࡍʹΫϥΠΞϯτͱαʔό͕΍ΓऔΓΛ
 ͠ͳ͍ͱҧ͍ʹؾ͚ͮͳ͍

Slide 96

Slide 96 text

Protocol Buffers

Slide 97

Slide 97 text

Protocol Buffers • Google͕։ൃΛ͍ͯ͠Δ
 ΠϯλʔϑΣʔεఆٛݴޠ(IDL) • γϯϓϧͰߴ଎ • ओཁͳݴޠʹରԠ͍ͯ͠Δ - Golang - Java - Swfit - Javascript(TypeScript)

Slide 98

Slide 98 text

gRPC ≠ Protocol Buffers

Slide 99

Slide 99 text

gRPC HTTP TCP HTTP2 Protocol Buffers JSON XML

Slide 100

Slide 100 text

Protocol Buffers on HTTP

Slide 101

Slide 101 text

4FSWFS $MJFOU {“msg”: “message”} +40/ )551

Slide 102

Slide 102 text

4FSWFS $MJFOU 010100101001… #JOBSZ )551

Slide 103

Slide 103 text

Protocol Buffers ͷ ߏ଄

Slide 104

Slide 104 text

syntax = "proto3"; package echo; option go_package = "pb"; option java_package = ""; option swift_prefix = ""; message EchoRequest { string msg = 1; } message EchoResponse { string echo_msg = 1; } service EchoService { rpc Echo(EchoRequest) returns (EchoResponse) {} } echo.proto

Slide 105

Slide 105 text

syntax = "proto3"; package echo; option go_package = "pb"; option java_package = ""; option swift_prefix = ""; message EchoRequest { string msg = 1; } message EchoResponse { string echo_msg = 1; } service EchoService { rpc Echo(EchoRequest) returns (EchoResponse) {} } echo.proto

Slide 106

Slide 106 text

syntax = "proto3"; package echo; option go_package = "pb"; option java_package = ""; option swift_prefix = ""; message EchoRequest { string msg = 1; } message EchoResponse { string echo_msg = 1; } service EchoService { rpc Echo(EchoRequest) returns (EchoResponse) {} } echo.proto

Slide 107

Slide 107 text

syntax = "proto3"; package echo; option go_package = "pb"; option java_package = ""; option swift_prefix = ""; message EchoRequest { string msg = 1; } message EchoResponse { string echo_msg = 1; } service EchoService { rpc Echo(EchoRequest) returns (EchoResponse) {} } echo.proto

Slide 108

Slide 108 text

syntax = "proto3"; package echo; option go_package = "pb"; option java_package = ""; option swift_prefix = ""; message EchoRequest { string msg = 1; } message EchoResponse { string echo_msg = 1; } service EchoService { rpc Echo(EchoRequest) returns (EchoResponse) {} } echo.proto

Slide 109

Slide 109 text

$ protoc \ —go_out=plugins=grpc:.\ *.proto

Slide 110

Slide 110 text

type EchoRequest struct { Msg string `protobuf:"bytes,1,opt,name=msg" json:"msg,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } type EchoServiceServer interface { Echo(context.Context, *EchoRequest) (*EchoResponse, error) } echo.pb.go

Slide 111

Slide 111 text

type EchoRequest struct { Msg string `protobuf:"bytes,1,opt,name=msg" json:"msg,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } type EchoServiceServer interface { Echo(context.Context, *EchoRequest) (*EchoResponse, error) } echo.pb.go

Slide 112

Slide 112 text

type EchoRequest struct { Msg string `protobuf:"bytes,1,opt,name=msg" json:"msg,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } type EchoServiceServer interface { Echo(context.Context, *EchoRequest) (*EchoResponse, error) } echo.pb.go

Slide 113

Slide 113 text

type EchoRequest struct { Msg string `protobuf:"bytes,1,opt,name=msg" json:"msg,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } type EchoServiceServer interface { Echo(context.Context, *EchoRequest) (*EchoResponse, error) } echo.pb.go

Slide 114

Slide 114 text

public final class Echo { private Echo() {} public static final class EchoRequest extends com.google.protobuf.GeneratedMessageV3 implements { // @@protoc_insertion_point(message_implements:echo.EchoRequest) private EchoRequest() { msg_ = ""; } public static final int MSG_FIELD_NUMBER = 1; private volatile java.lang.Object msg_; public java.lang.String getMsg() { } } } Echo.java

Slide 115

Slide 115 text

public final class Echo { private Echo() {} public static final class EchoRequest extends com.google.protobuf.GeneratedMessageV3 implements { // @@protoc_insertion_point(message_implements:echo.EchoRequest) private EchoRequest() { msg_ = ""; } public static final int MSG_FIELD_NUMBER = 1; private volatile java.lang.Object msg_; public java.lang.String getMsg() { } } } Echo.java

Slide 116

Slide 116 text

public final class Echo { private Echo() {} public static final class EchoRequest extends com.google.protobuf.GeneratedMessageV3 implements { // @@protoc_insertion_point(message_implements:echo.EchoRequest) private EchoRequest() { msg_ = ""; } public static final int MSG_FIELD_NUMBER = 1; private volatile java.lang.Object msg_; public java.lang.String getMsg() { } } } Echo.java

Slide 117

Slide 117 text

͜ΕΛ֤ݴޠͷ ϥΠϒϥϦΛ௨ͯ͠ Binaryʹ͢Δ

Slide 118

Slide 118 text

What is “͍͍ͧ”?

Slide 119

Slide 119 text

υΩϡϝϯτʹ࣮૷

Slide 120

Slide 120 text

Protocol Buffers • ه๏͕Θ͔Γ΍͍͢ • σʔλͷදݱํ๏͕๛͔ - int, double, repeated(Array), Map… • ֤ݴޠͷίʔυͦͷ΋ͷΛੜ੒ͯ͠࢖͏ - มߋ͕͋ͬͨ৔߹Ϗϧυ࣌ʹؾ͚ͮΔ

Slide 121

Slide 121 text

syntax = "proto3"; package echo; option go_package = "pb"; option java_package = ""; option swift_prefix = ""; message EchoRequest { string msg = 1; } message EchoResponse { string echo_msg = 1; } service EchoService { rpc Echo(EchoRequest) returns (EchoResponse) {} } echo.proto

Slide 122

Slide 122 text

syntax = "proto3"; package echo; option go_package = "pb"; option java_package = ""; option swift_prefix = ""; message EchoRequest { string msg = 1; } message EchoResponse { string echo_msg = 1; } service EchoService { rpc Echo(EchoRequest) returns (EchoResponse) {} } echo.proto

Slide 123

Slide 123 text

syntax = "proto3"; package echo; option go_package = "pb"; option java_package = ""; option swift_prefix = ""; message EchoRequest { string msg = 1; } message EchoResponse { string echo_msg = 1; } service EchoService { rpc Echo(EchoRequest) returns (EchoResponse) {} } echo.proto

Slide 124

Slide 124 text

type EchoRequest struct { Msg string `protobuf:"bytes,1,opt,name=msg" json:"msg,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } type EchoServiceServer interface { Echo(context.Context, *EchoRequest) (*EchoResponse, error) } echo.pb.go

Slide 125

Slide 125 text

type EchoRequest struct { Msg string `protobuf:"bytes,1,opt,name=msg" json:"msg,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } type EchoServiceServer interface { Echo(context.Context, *EchoRequest) (*EchoResponse, error) } echo.pb.go

Slide 126

Slide 126 text

type EchoRequest struct { Msg string `protobuf:"bytes,1,opt,name=msg" json:"msg,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } type EchoServiceServer interface { Echo(context.Context, *EchoRequest) (*EchoResponse, error) } echo.pb.go

Slide 127

Slide 127 text

APIυΩϡϝϯτΛ Protocol Buffersʹ دͤΒΕΔʂʂ

Slide 128

Slide 128 text

APIυΩϡϝϯτͱ ࣮૷ͷဃ཭Λ ؾʹ͠ͳ͍͍ͯ͘ʂ

Slide 129

Slide 129 text

Protocol Buffers͸ ͍͍ͧ

Slide 130

Slide 130 text

Golang͸͍͍ͧ

Slide 131

Slide 131 text

What is “͍͍ͧ”?

Slide 132

Slide 132 text

γϯϓϧ

Slide 133

Slide 133 text

γϯϓϧͷ͍͍ͱ͜Ζ • ݴޠ࢓༷ͷཧղ͕༰қ • ฒߦॲཧͷѻ͍ - goroutine - channel • γϯϓϧͰ͋Δ͕Ώ͑ͷϏϧυ࣌ؒͷ୹͞

Slide 134

Slide 134 text

͑ʁ

Slide 135

Slide 135 text

ฉ͖๞͖ͨʁ

Slide 136

Slide 136 text

۩ମతͳൺֱ

Slide 137

Slide 137 text

func f(li []int) []int { ret := make([]int, 0) for _, n := range li { if n%2 == 0 { ret = append(ret, n) } } for i := range ret { ret[i] = ret[i] * 2 } return ret } Golang li.filter(n => n % 2 === 0) .map(n => n * 2) Javascript

Slide 138

Slide 138 text

func f(li []int) []int { ret := make([]int, 0) for _, n := range li { if n%2 == 0 { ret = append(ret, n) } } for i := range ret { ret[i] = ret[i] * 2 } return ret } Golang li.filter(n => n % 2 === 0) .map(n => n * 2) Javascript ಡΈ΍͍͢ͷ͸Ͳͬͪʁ

Slide 139

Slide 139 text

func f(li []int) []int { ret := make([]int, 0) for _, n := range li { if n%2 == 0 { ret = append(ret, n) } } for i := range ret { ret[i] = ret[i] * 2 } return ret } Golang li.filter(n => n % 2 === 0) .map(n => n * 2) Javascript ੜ࢈ੑ͕ߴ͍ͷ͸ʁ

Slide 140

Slide 140 text

func f(li []int) []int { ret := make([]int, 0) for _, n := range li { if n%2 == 0 { ret = append(ret, n) } } for i := range ret { ret[i] = ret[i] * 2 } return ret } Golang li.filter(n => n % 2 === 0) .map(n => n * 2) Javascript ࣮ߦͷޮ཰͕͍͍ͷ͸ʁ

Slide 141

Slide 141 text

func f(li []int) []int { ret := make([]int, 0) for _, n := range li { if n%2 == 0 { ret = append(ret, n) } } for i := range ret { ret[i] = ret[i] * 2 } return ret } Golang li.filter(n => n % 2 === 0) .map(n => n * 2) Javascript ίϯύΠϥ͕ղऍ͠΍͍͢ͷ͸ʁ

Slide 142

Slide 142 text

ݴ͍͍ͨ͜ͱ

Slide 143

Slide 143 text

ͲͬͪͰ΋͍͍

Slide 144

Slide 144 text

ίʔυʹ͸ ”ҙਤ”Λ දݱ͢Δ΂͖

Slide 145

Slide 145 text

ίʔυͷҙਤ • ͲΜͳه๏Ͱ͋ͬͯ΋ҙਤ͕ॏཁ • intͷ഑ྻͷۮ਺ͷ஋Λ2ഒʹ͢Δҙਤ͸Կ͔ʁ - ͨͩͷ਺஋ܭࢉ - UserͷεςʔλεͷભҠ - ళฮͷStarͷഒ཰

Slide 146

Slide 146 text

func f(li []int) []int { ret := make([]int, 0) for _, n := range li { if n%2 == 0 { ret = append(ret, n) } } for i := range ret { ret[i] = ret[i] * 2 } return ret } Golang li.filter(n => n % 2 === 0) .map(n => n * 2) Javascript

Slide 147

Slide 147 text

func f(li []int) []int { ret := make([]int, 0) for _, n := range li { if n%2 == 0 { ret = append(ret, n) } } for i := range ret { ret[i] = ret[i] * 2 } return ret } Golang li.filter(n => n % 2 === 0) .map(n => n * 2) Javascript ͲͪΒ΋ҙਤ͕ͳ͍

Slide 148

Slide 148 text

func f(li []int) []int { ret := make([]int, 0) for _, n := range li { if n%2 == 0 { ret = append(ret, n) } } for i := range ret { ret[i] = ret[i] * 2 } return ret } Golang li.filter(n => n % 2 === 0) .map(n => n * 2) Javascript ͲͬͪͰ΋͍͍

Slide 149

Slide 149 text

͡Ό͋ͳΜͰ Golang?

Slide 150

Slide 150 text

ϏδωεϩδοΫʹ ूத͠΍͍͢

Slide 151

Slide 151 text

Javascript • ഑ྻͷཁૉΛಛఆͷ৚݅ͰߜΓ͍ͨʂ - filter͕͋ΔΑʂ • ഑ྻͷཁૉશͯΛૢ࡞Λ͍ͨ͠ʂ - map͕͋ΔΑʂ • ഑ྻͷཁૉ͢΂ͯΛ࢖ͬͯ݁ՌΛ࡞Γ͍ͨʂ - reduce͕͋ΔΑʂ

Slide 152

Slide 152 text

Javascript • ഑ྻͷཁૉΛಛఆͷ৚݅ͰߜΓ͍ͨʂ - filter͕͋ΔΑʂ • ഑ྻͷཁૉશͯΛૢ࡞Λ͍ͨ͠ʂ - map͕͋ΔΑʂ • ഑ྻͷཁૉ͢΂ͯΛ࢖ͬͯ݁ՌΛ࡞Γ͍ͨʂ - reduce͕͋ΔΑʂ Ͱ΋શ෦GPSϧʔϓͰ΋࣮ݱͰ͖ΔΑʂ

Slide 153

Slide 153 text

Golang • ഑ྻͷཁૉΛಛఆͷ৚݅ͰߜΓ͍ͨʂ - forͱifΛ࢖͓͏ • ഑ྻͷཁૉશͯΛૢ࡞Λ͍ͨ͠ʂ - forΛ࢖͓͏ • ഑ྻͷཁૉ͢΂ͯΛ࢖ͬͯ݁ՌΛ࡞Γ͍ͨʂ - forΛ࢖͓͏

Slide 154

Slide 154 text

ۚ༥γεςϜ • ۚ༥ۀքಛ༗ͷυϝΠϯ஌͕ࣝ๲େ • ΤϯδχΞ͸ۚ༥ͷઐ໳ՈͰ͸ͳ͍ • υϝΠϯ஌ࣝͷͨΊʹ࠷େݶ࣌ؒΛ࢖͍͍ͨ - ۚ༥ͷ஌ࣝͷΠϯϓοτ - υϝΠϯΤΩεύʔτͱͷ
 ίϛϡχέʔγϣϯ

Slide 155

Slide 155 text

ΞϓϦέʔγϣϯΛ ॻ͘͜ͱʹ ूதͰ͖Δʂ

Slide 156

Slide 156 text

Golang͸͍͍ͧ

Slide 157

Slide 157 text

4ͭͷʮ͍͍ͧʯ • Google App Engine(GAE)͸͍͍ͧ • Stackdriver Logging͸͍͍ͧ • Protocol Buffers͸͍͍ͧ • Golang͸͍͍ͧ

Slide 158

Slide 158 text

࠙਌ձͰ ͓࿩͠·͠ΐ͏ʂ

Slide 159

Slide 159 text

Ұॹʹಇ͍ͯ ͘ΕΔਓ ืूதʂʂʂ