{"id":23258,"date":"2019-09-26T12:00:24","date_gmt":"2019-09-26T03:00:24","guid":{"rendered":"https:\/\/www.techscore.com\/blog\/?p=23258"},"modified":"2019-09-26T13:31:06","modified_gmt":"2019-09-26T04:31:06","slug":"grpc-cui-client-tools","status":"publish","type":"post","link":"https:\/\/www.techscore.com\/blog\/2019\/09\/26\/grpc-cui-client-tools\/","title":{"rendered":"gRPC \u306e CUI \u306e\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30c4\u30fc\u30eb\u3092\u8abf\u3079\u3066\u307e\u3068\u3081\u3066\u307f\u305f"},"content":{"rendered":"
\u3053\u3093\u306b\u3061\u306f\u3001\u677e\u6d66\u3067\u3059\u3002<\/p>\n
\u6700\u8fd1\u696d\u52d9\u306b\u3066 gRPC \u3092\u4f7f\u3063\u305f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u958b\u767a\u3092\u3057\u3066\u3044\u307e\u3059\u3002\u958b\u767a\u3092\u3057\u3066\u3044\u3066\u5c11\u3057\u56f0\u308b\u306e\u306f\u3001\u52d5\u4f5c\u78ba\u8a8d\u3092\u884c\u3046\u306e\u306b\u3069\u3046\u3084\u3063\u3066 gRPC \u30b5\u30fc\u30d0\u306e RPC \u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3059\u304b\u3001\u3068\u3044\u3046\u70b9\u3067\u3059\u3002REST \u306e\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8\u306e\u5834\u5408\u3001curl \u3084\u30d6\u30e9\u30a6\u30b6\u3084 Postman \u306e\u3088\u3046\u306a\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u9001\u308c\u307e\u3057\u305f\u304c\u3001gRPC \u306e\u5834\u5408\u306f\u3001\u65b0\u305f\u306a\u30c4\u30fc\u30eb\u3092\u5c0e\u5165\u3059\u308b\uff08\u3042\u308b\u3044\u306f\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u5074\u306e\u30c6\u30b9\u30c8\u7528\u30b3\u30fc\u30c9\u3092\u66f8\u304f\uff09\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002\u305d\u3053\u3067\u3001\u696d\u52d9\u306e\u52b9\u7387\u5316\u3082\u517c\u306d\u3066\u3001\u304a\u624b\u8efd\u306b\u52d5\u4f5c\u78ba\u8a8d\u3092\u884c\u3046\u306e\u306b\u3069\u306e\u3088\u3046\u306a\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30c4\u30fc\u30eb\u304c\u3042\u308b\u306e\u304b\u3001\u8abf\u3079\u3066\u3001\u89e6\u3063\u3066\u3001\u307e\u3068\u3081\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n
syntax = \"proto3\";\n\npackage sample;\n\nservice SampleService {\n \/\/ SampleResponse \u306e message \u306b\u306f \"Hello, ${SampleRequest.name}!\" \u304c\u30bb\u30c3\u30c8\u3055\u308c\u308b\n rpc GetSample(SampleRequest) returns (SampleResponse);\n}\n\nmessage SampleRequest {\n string name = 1;\n}\n\nmessage SampleResponse {\n string message = 1;\n}\n<\/code><\/pre>\n<\/li>\n<\/ul>\ngRPC command line tool<\/a><\/h2>\ngRPC command line tool \u306f\u3001gRPC \u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u5185\u306b\u3042\u308b CLI \u3067\u3059\u3002
\n\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304b\u3089\u30d3\u30eb\u30c9\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u305f\u3081\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u5c11\u3005\u624b\u9593\u304c\u304b\u304b\u308b\u306e\u3067\u3059\u304c\u3001It is desirable to have command line tools written in other languages roughly follow the same syntax and flags.<\/code> \u3068\u3042\u308b\u3088\u3046\u306b\u3001gRPC \u306e CLI \u30c4\u30fc\u30eb\u306e\u671b\u307e\u3057\u3044\u30b7\u30f3\u30bf\u30c3\u30af\u30b9\u3084\u30d5\u30e9\u30b0\u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u3068\u8a00\u3048\u308b\u306e\u3067\u3001\u52c9\u5f37\u3068\u3057\u3066\u89e6\u3063\u3066\u307f\u308b\u306e\u306b\u3082\u826f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\u52d5\u4f5c\u78ba\u8a8d\u3057\u305f\u30d0\u30fc\u30b8\u30e7\u30f3<\/h3>\n
1.23.0<\/p>\n
\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n
\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8<\/a>\u306e\u8a18\u8ff0\u306b\u5f93\u3063\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3044\u304d\u307e\u3059\u3002
\n\u307e\u305a\u3001 gRPC \u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u3092 clone \u3057\u307e\u3059\u3002CLI \u30c4\u30fc\u30eb\u3092\u30d3\u30eb\u30c9\u3059\u308b\u306b\u306f\u30b5\u30d6\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308b\u306e\u3067\u3001\u305d\u308c\u3082\u884c\u3044\u307e\u3059\u3002<\/p>\ngit clone https:\/\/github.com\/grpc\/grpc\ngit submodule update --init<\/pre>\n\u30d3\u30eb\u30c9\u306b\u306f gflags \u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u5fc5\u8981\u306a\u306e\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n
brew install gflags<\/pre>\n\u3053\u3053\u307e\u3067\u3067\u4e8b\u524d\u6e96\u5099\u306f\u5b8c\u4e86\u306a\u306e\u3067\u3001CLI \u3092\u30d3\u30eb\u30c9\u3057\u307e\u3059\u3002<\/p>\n
make grpc_cli<\/pre>\n\u4f7f\u3044\u65b9<\/h3>\n
\u4f7f\u3044\u65b9\u306f grpc_cli help<\/code> \u3084 grpc_cli <command> help<\/code> \u3067\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002
\n\u3044\u304f\u3064\u304b\u30b3\u30de\u30f3\u30c9\u304c\u3042\u308a\u307e\u3059\u304c\u3001RPC \u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3059\u306b\u306f grpc_cli call<\/code> \u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n# grpc_cli call <address> [<service>.]<method> <request> <options>\n# \u30b5\u30fc\u30d0\u30a2\u30d7\u30ea\u304c\u30ea\u30d5\u30ec\u30af\u30b7\u30e7\u30f3\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u5834\u5408\u306f proto \u30d5\u30a1\u30a4\u30eb\u306e\u6307\u5b9a\u306f\u4e0d\u8981\n# method \u306e\u524d\u306e service \u540d\u306f\u7701\u7565\u3067\u304d\u308b\u3089\u3057\u3044\n$ grpc_cli call 127.0.0.1:50051 GetSample \"name: 'TECHSCORE'\"\nconnecting to 127.0.0.1:50051\nmessage: \"Hello, TECHSCORE!\"\n\nRpc succeeded with OK status<\/pre>\ngRPCurl<\/a><\/h2>\nLike cURL, but for gRPC<\/code> \u3068\u3042\u308b\u3088\u3046\u306b\u3001gRPC \u7248 curl \u3068\u8a00\u3048\u308b\u30c4\u30fc\u30eb\u3067\u3059\u3002
\nGitHub \u306e\u30b9\u30bf\u30fc\u3082\u57f7\u7b46\u6642\u70b9\u3067 2000 \u3092\u8d85\u3048\u3066\u304a\u308a\u3001\u4ed6\u306e\u8a18\u4e8b\u3067\u3082\u3057\u3070\u3057\u3070\u8a00\u53ca\u304c\u898b\u3089\u308c\u308b\u306e\u3067\u3001\u5b9a\u8a55\u306e\u3042\u308b\u30c4\u30fc\u30eb\u3068\u8a00\u3063\u3066\u3044\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\u52d5\u4f5c\u78ba\u8a8d\u3057\u305f\u30d0\u30fc\u30b8\u30e7\u30f3<\/h3>\n
1.3.2<\/p>\n
\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n
Mac \u306e\u5834\u5408\u306f brew \u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002
\nGitHub \u306e releases \u306e\u30da\u30fc\u30b8<\/a>\u306b\u30d0\u30a4\u30ca\u30ea\u3082\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u305d\u3061\u3089\u3092\u76f4\u63a5\u53d6\u5f97\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002
\ngo get \u3067\u30bd\u30fc\u30b9\u53d6\u5f97\u30fb\u30d3\u30eb\u30c9\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\u4f7f\u3044\u65b9<\/h3>\n
\u4f7f\u3044\u65b9\u306f grpcurl -help<\/code> \u3067\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002
\nRPC \u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3059\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5404\u7a2e\u5f15\u6570\u3092\u6e21\u3057\u3066\u3044\u304f\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n# grpcurl <options> <address> <fully-qualified service name>\/<method>\n# no TLS \u306e\u5834\u5408\u306f -plaintext \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u660e\u793a\u7684\u306b\u4ed8\u4e0e\u3059\u308b\n# -d \u3067\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u4e2d\u8eab\u3092\u6307\u5b9a(JSON \u3067\u8a18\u8ff0)\n# \u30b5\u30fc\u30d0\u30a2\u30d7\u30ea\u304c\u30ea\u30d5\u30ec\u30af\u30b7\u30e7\u30f3\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u5834\u5408\u306f proto \u30d5\u30a1\u30a4\u30eb\u306e\u6307\u5b9a\u306f\u4e0d\u8981\n$ grpcurl -plaintext -d '{\"name\": \"TECHSCORE\"}' 127.0.0.1:50051 sample.SampleService\/GetSample\n{\n \"message\": \"Hello, TECHSCORE!\"\n}<\/pre>\n\u4f59\u8ac7\u3067\u3059\u304c\u3001\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u8aad\u3080\u9650\u308a\u3001Prototool<\/a> \u306e grpc \u30b3\u30de\u30f3\u30c9\u306f\u5185\u90e8\u7684\u306b\u306f grpcurl \u3092\u5229\u7528\u3057\u3066\u3044\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\ngrpcc<\/a><\/h2>\ngRPC \u95a2\u9023\u306e\u30c4\u30fc\u30eb\u306f Golang \u3067\u66f8\u304b\u308c\u3066\u3044\u308b\u3082\u306e\u304c\u591a\u3044\u5370\u8c61\u304c\u3042\u308a\u307e\u3059\u304c\u3001grpcc \u306f JavaScript (Node.js) \u3067\u66f8\u304b\u308c\u3066\u3044\u307e\u3059\u3002
\n\u4ed6\u306e\u30c4\u30fc\u30eb\u3068\u6bd4\u3079\u308b\u3068\u5c11\u3057\u7656\u304c\u5f37\u3044\u3067\u3059\u304c\u3001\u9762\u767d\u3044\u30c4\u30fc\u30eb\u3060\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n
\u52d5\u4f5c\u78ba\u8a8d\u3057\u305f\u30d0\u30fc\u30b8\u30e7\u30f3<\/h3>\n
1.1.3<\/p>\n
\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n
README<\/a> \u306b\u3042\u308b\u3088\u3046\u306b\u3001npm \u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n\u4f7f\u3044\u65b9<\/h3>\n
\u4f7f\u3044\u65b9\u306f\u3000grpcc -h<\/code> \u307e\u305f\u306f grpcc --help<\/code> \u3067\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002
\n\u4ee5\u4e0b\u306f\u3001\u5bfe\u8a71\u30e2\u30fc\u30c9\u3067 RPC \u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3059\u30b5\u30f3\u30d7\u30eb\u3067\u3059\u3002<\/p>\n# grpcc <options>\n# \u30ea\u30d5\u30ec\u30af\u30b7\u30e7\u30f3\u306b\u306f\u5bfe\u5fdc\u3057\u3066\u3044\u306a\u3044\u3088\u3046\u306a\u306e\u3067\u3001 --proto \u3067\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\n# --address \u3067\u30b5\u30fc\u30d0\u5074\u306e\u30a2\u30c9\u30ec\u30b9\u3092\u6307\u5b9a\n# Insecure \u306a\u63a5\u7d9a\u306e\u5834\u5408\u306f -i \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u660e\u793a\u7684\u306b\u4ed8\u4e0e\u3059\u308b\n$ grpcc --proto Sample.proto --address 127.0.0.1:50051 -i\n\nConnecting to sample.SampleService on 127.0.0.1:50051. Available globals:\n\n client - the client connection to SampleService\n getSample (SampleRequest, callback) returns SampleResponse\n\n printReply - function to easily print a unary call reply (alias: pr)\n streamReply - function to easily print stream call replies (alias: sr)\n createMetadata - convert JS objects into grpc metadata instances (alias: cm)\n printMetadata - function to easily print a unary call's metadata (alias: pm)\n\nSampleService@127.0.0.1:50051> client.getSample({name: \"TECHSCORE\"}, printReply)\nEventEmitter {}\nSampleService@127.0.0.1:50051>\n{\n \"message\": \"Hello, TECHSCORE!\"\n}<\/pre>\n\u5bfe\u8a71\u30e2\u30fc\u30c9\u306e\u4ed6\u306b\u3082\u3001\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u4e0a\u306b\u66f8\u3044\u305f JavaScript \u306e\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3057\u3066\u7d50\u679c\u3092\u51fa\u529b\u3059\u308b --eval<\/code> \u30aa\u30d7\u30b7\u30e7\u30f3\u3084\u3001JavaScript \u306e\u30d5\u30a1\u30a4\u30eb\u3092\u5b9f\u884c\u3057\u3066\u7d50\u679c\u3092\u51fa\u529b\u3059\u308b --exec<\/code> \u30aa\u30d7\u30b7\u30e7\u30f3\u306a\u3069\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n# --eval \u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u30b5\u30f3\u30d7\u30eb\n$ grpcc --proto Sample.proto --address 127.0.0.1:50051 -i --eval 'client.getSample({name: \"TECHSCORE\"}, printReply)'\n{\n \"message\": \"Hello, TECHSCORE!\"\n}<\/pre>\nevans<\/a><\/h2>\nmore expressive universal gRPC client<\/code> \u3068\u9298\u6253\u3063\u3066\u3044\u308b\u3088\u3046\u306b\u3001\u304b\u306a\u308a\u9ad8\u6a5f\u80fd\u3067\u4f7f\u3044\u3084\u3059\u3044\u30c4\u30fc\u30eb\u3067\u3059\u3002
\n\u3061\u306a\u307f\u306b\u3001\u79c1\u304c\u666e\u6bb5\u4f7f\u3063\u3066\u3044\u308b\u30c4\u30fc\u30eb\u3067\u3059\u3002<\/p>\n\u52d5\u4f5c\u78ba\u8a8d\u3057\u305f\u30d0\u30fc\u30b8\u30e7\u30f3<\/h3>\n
0.8.2<\/p>\n
\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n
Mac \u306e\u5834\u5408\u306f brew \u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002
\nGitHub \u306e releases \u30da\u30fc\u30b8<\/a>\u306b\u30d0\u30a4\u30ca\u30ea\u3082\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u305d\u3061\u3089\u3092\u76f4\u63a5\u53d6\u5f97\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002
\ngo get \u3067\u30bd\u30fc\u30b9\u53d6\u5f97\u30fb\u30d3\u30eb\u30c9\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u304c\u63a8\u5968\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002<\/p>\n\u4f7f\u3044\u65b9<\/h3>\n
\u4f7f\u3044\u65b9\u306f evans -h<\/code> \u307e\u305f\u306f evans --help<\/code> \u3067\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002
\n\u4ee5\u4e0b\u306f\u3001\u5bfe\u8a71\u30e2\u30fc\u30c9\u3067 RPC \u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3059\u30b5\u30f3\u30d7\u30eb\u3067\u3059\u3002<\/p>\n# evans <options> <proto file>\n# \u30b5\u30fc\u30d0\u30a2\u30d7\u30ea\u304c\u30ea\u30d5\u30ec\u30af\u30b7\u30e7\u30f3\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u5834\u5408\u3001-r \u307e\u305f\u306f --reflection \u3067\u6709\u52b9\u5316\u3067\u304d\u308b\uff08\u305d\u306e\u5834\u5408\u3001proto \u30d5\u30a1\u30a4\u30eb\u306e\u6307\u5b9a\u306f\u4e0d\u8981\uff09\n# --package \u3067\u30d1\u30c3\u30b1\u30fc\u30b8\u540d\u3001--service \u3067\u30b5\u30fc\u30d3\u30b9\u540d\u3001--call \u3067\u30e1\u30bd\u30c3\u30c9\u540d\u3092\u6307\u5b9a\u3067\u304d\u308b\u304c\u3001\u5bfe\u8a71\u30e2\u30fc\u30c9\u306e\u4e2d\u3067\u3082\u6307\u5b9a\u304c\u53ef\u80fd\n# --host \u3067\u30db\u30b9\u30c8\u540d\u3001--port \u3067\u30dd\u30fc\u30c8\u540d\u304c\u6307\u5b9a\u3067\u304d\u308b\uff08\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u306f\u305d\u308c\u305e\u308c 127.0.0.1, 50051\uff09\n$ evans -r\n\n ______\n | ____|\n | |__ __ __ __ _ _ __ ___\n | __| \\ \\ \/ \/ \/ _. | | '_ \\ \/ __|\n | |____ \\ V \/ | (_| | | | | | \\__ \\\n |______| \\_\/ \\__,_| |_| |_| |___\/\n\n more expressive universal gRPC client\n\n\n127.0.0.1:50051> package sample\n\nsample@127.0.0.1:50051> service SampleService\n\nsample.SampleService@127.0.0.1:50051> call GetSample\nname (TYPE_STRING) => TECHSCORE\n{\n \"message\": \"Hello, TECHSCORE!\"\n}<\/pre>\n\u5bfe\u8a71\u30e2\u30fc\u30c9\u3060\u3051\u3067\u306a\u304f\u3001\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u4e0a\u3067 RPC \u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3059\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n
# \u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u4e2d\u8eab\u306f JSON \u3067\u8a18\u8ff0\n$ echo '{\"name\": \"TECHSCORE\"}' | evans -r --package sample --service SampleService --call GetSample\n{\n \"message\": \"Hello, TECHSCORE!\"\n}<\/pre>\nPolyglot<\/a><\/h2>\n\u6700\u5f8c\u306b\u3001Java \u7248\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30c4\u30fc\u30eb\u306e polyglot \u3092\u898b\u3066\u307f\u307e\u3059\u3002
\nREADME \u3092\u898b\u3066\u3044\u308b\u3068\u3001\u304b\u306a\u308a\u8a73\u7d30\u306a\u8a2d\u5b9a\u3082\u3067\u304d\u305d\u3046\u3067\u3059\u304c\u3001\u4eca\u56de\u306f\u8efd\u304f\u898b\u308b\u306b\u3068\u3069\u3081\u307e\u3059\u3002<\/p>\n
\u52d5\u4f5c\u78ba\u8a8d\u3057\u305f\u30d0\u30fc\u30b8\u30e7\u30f3<\/h3>\n
2.0.0<\/p>\n
\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n
All you need to run Polyglot is a Java runtime.<\/code> \u3068 README \u306e Requirements<\/a> \u3067\u8a00\u3063\u3066\u3044\u308b\u306e\u3067\u3001Java \u304c\u5b9f\u884c\u3067\u304d\u308b\u74b0\u5883\u3067\u3001GitHub \u306e releases \u30da\u30fc\u30b8<\/a>\u306b\u3042\u308b Jar \u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u5f62\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\u4f7f\u3044\u65b9<\/h3>\n
\u4f7f\u3044\u65b9\u306f java -jar polyglot.jar --help<\/code> \u3067\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002
\n\u4ee5\u4e0b\u3067\u306f call<\/code> \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3063\u3066 RPC \u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3059\u30b5\u30f3\u30d7\u30eb\u3067\u3059\u3002<\/p>\n# java -jar polyglot.jar <options> call <command specific options>\n# --endpoint \u3067\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8\u3092\u3001--full_method \u3067\u547c\u3073\u51fa\u3059\u30e1\u30bd\u30c3\u30c9\u3092\u6307\u5b9a\u3059\u308b\uff08\u5fc5\u9808\uff09\n# \u30b5\u30fc\u30d0\u30a2\u30d7\u30ea\u304c\u30ea\u30d5\u30ec\u30af\u30b7\u30e7\u30f3\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u5834\u5408\u3001proto \u30d5\u30a1\u30a4\u30eb\u306e\u6307\u5b9a\u306f\u4e0d\u8981\n# \u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u4e2d\u8eab\u306f JSON \u3067\u6a19\u6e96\u5165\u529b\u304b\u3089\u53d7\u3051\u53d6\u308b\n$ echo '{\"name\": \"TECHSCORE\"}' | java -jar polyglot.jar call --endpoint 127.0.0.1:50051 --full_method sample.SampleService\/GetSample\n[main] INFO me.dinowernli.grpc.polyglot.Main - Polyglot version: 2.0.0\n[main] INFO me.dinowernli.grpc.polyglot.Main - Loaded configuration: \n[main] INFO me.dinowernli.grpc.polyglot.command.ServiceCall - Creating channel to: 127.0.0.1:50051\n[main] INFO me.dinowernli.grpc.polyglot.command.ServiceCall - Using proto descriptors fetched by reflection\n[main] INFO me.dinowernli.grpc.polyglot.command.ServiceCall - Creating dynamic grpc client\n[main] INFO me.dinowernli.grpc.polyglot.command.ServiceCall - Making rpc with 1 request(s) to endpoint [127.0.0.1:50051]\n[main] INFO me.dinowernli.grpc.polyglot.grpc.DynamicGrpcClient - Making unary call\n[grpc-default-executor-1] INFO me.dinowernli.grpc.polyglot.io.LoggingStatsWriter - Got response message\n{\n \"message\": \"Hello, TECHSCORE!\"\n}\n\n[grpc-default-executor-1] INFO me.dinowernli.grpc.polyglot.io.LoggingStatsWriter - Completed rpc with 1 response(s)<\/pre>\n\u307e\u3068\u3081<\/h2>\n
\u4ee5\u4e0a\u3001gRPC \u306e CUI \u306e\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30c4\u30fc\u30eb\u3092\u8abf\u3079\u3066\u307f\u307e\u3057\u305f\u3002
\n\u8abf\u3079\u3066\u3044\u308b\u904e\u7a0b\u3067 GUI \u306e\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30c4\u30fc\u30eb\u3082\u3044\u304f\u3064\u304b\u9762\u767d\u305d\u3046\u306a\u3082\u306e\u3092\u898b\u3064\u3051\u305f\u306e\u3067\u3001\u3044\u305a\u308c\u307e\u3068\u3081\u3066\u307f\u305f\u3044\u3068\u3053\u308d\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
\u3053\u3093\u306b\u3061\u306f\u3001\u677e\u6d66\u3067\u3059\u3002<\/p>\n
\u6700\u8fd1\u696d\u52d9\u306b\u3066 gRPC \u3092\u4f7f\u3063\u305f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u958b\u767a\u3092\u3057\u3066\u3044\u307e\u3059\u3002\u958b\u767a\u3092\u3057\u3066\u3044\u3066\u5c11\u3057\u56f0\u308b\u306e\u306f\u3001\u52d5\u4f5c\u78ba\u8a8d\u3092\u884c\u3046\u306e\u306b\u3069\u3046\u3084\u3063\u3066 gRPC \u30b5\u30fc\u30d0\u306e RPC \u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3059\u304b\u3001\u3068\u3044\u3046\u70b9\u3067\u3059\u3002
\u7d9a\u304d\u3092\u8aad\u3080...<\/a><\/p>\n","protected":false},"author":51,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[18],"tags":[329],"_links":{"self":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/23258"}],"collection":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/users\/51"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/comments?post=23258"}],"version-history":[{"count":44,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/23258\/revisions"}],"predecessor-version":[{"id":23637,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/23258\/revisions\/23637"}],"wp:attachment":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/media?parent=23258"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/categories?post=23258"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/tags?post=23258"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}