step 2.

pf grpcio ์„œ๋ฒ„๋ฅผ grpc-gateway ๋กœ REST API ๋กœ ์ œ๊ณต

annotation ์„ ์“ฐ๊ธฐ์œ„ํ•ด go plugin ํ•„์š”.

go get ์„ ์ด์šฉํ•˜์—ฌ ํ•„์š”ํ•œ packages ์„ค์น˜ํ•˜๊ธฐ.

-

proto app generate ๋Š” 2๋ฒˆ ํ•ด์ค˜์•ผํ•œ๋‹ค.

  • go_out=plugins=grpc:./pb => proto/pfservice.proto (์ผ๋ฐ˜ grpc ์šฉ)

  • gateway_out (gateway ์šฉ)

-

8:42

pfservice.proto ํŒŒ์ผ์—์„œ

import "google/api/annotations.proto"; ํ•ด์ฃผ๊ณ 

darc.proto ๋ถ€๋ถ„์—์„œ ํ•ด์ฃผ๋˜๊ฑฐ ์นดํ”ผํ•ด์„œ ํ•˜๋Š” ์ค‘....

13:21

$ go mode tidy

  • ํ˜„์ƒํ™ฉ์— ๋งž๊ฒŒ ๋””ํŽœ๋˜์‹œ ์ •๋ฆฌํ•ด์ฃผ๋Š” ๋ช…๋ น์–ด

15:42

  • rest api call ๋กœ ๋ณด๋‚ด๋„ ๊ฒŒ์ดํŠธ์›จ์ด๊ฐ€ ๋ฐ›์•„์„œ ๋ฆฌ์Šคํฐ์Šค ์ค€๋‹ค~

Last updated