Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Side by Side Diff: common/prpc/doc.go

Issue 1605363002: common/prpc, tools/cmd/cproto: prpc client (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@master
Patch Set: rebased and addressed comments Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « common/prpc/codes.go ('k') | common/prpc/generate.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Package prpc (provisional RPC) implements an RPC client over HTTP 1.x. 5 // Package prpc (provisional RPC) implements an RPC client over HTTP 1.x.
6 // 6 //
7 // Like gRPC: 7 // Like gRPC:
8 // - services are defined in .proto files 8 // - services are defined in .proto files
9 // - service implementation does not depend on pRPC. 9 // - service implementation does not depend on pRPC.
10 // Unlike gRPC: 10 // Unlike gRPC:
(...skipping 13 matching lines...) Expand all
24 // //go:generate cproto 24 // //go:generate cproto
25 // 25 //
26 // Install cproto: 26 // Install cproto:
27 // go install github.com/luci/luci-go/tools/cmd/cproto 27 // go install github.com/luci/luci-go/tools/cmd/cproto
28 // 28 //
29 // Protocol 29 // Protocol
30 // 30 //
31 // This section describes the pRPC protocol. It is based on HTTP 1.x and employs 31 // This section describes the pRPC protocol. It is based on HTTP 1.x and employs
32 // gRPC codes. 32 // gRPC codes.
33 // 33 //
34 // A pRPC server MUST handle HTTP requests at `/prpc/{service}/{method}` path, 34 // A pRPC server MUST handle HTTP POST requests at `/prpc/{service}/{method}`,
35 // decode an input message from an HTTP request, 35 // decode an input message from an HTTP request,
36 // call the service method implementation and 36 // call the service method implementation and
37 // encode the returned output message or error to the HTTP response. 37 // encode the returned output message or error to the HTTP response.
38 // 38 //
39 // pRPC protocol defines three protocol buffer encodings and media types. 39 // pRPC protocol defines three protocol buffer encodings and media types.
40 // - Binary: "application/prpc; encoding=binary" 40 // - Binary: "application/prpc; encoding=binary"
41 // - JSON: "application/prpc; encoding=json" or "application/json" 41 // - JSON: "application/prpc; encoding=json" or "application/json"
42 // A response body MUST have `)]}'` prefix to avoid CSRF. 42 // A response body MUST have `)]}'` prefix to avoid CSRF.
43 // - Text: "application/prpc; encoding=text" 43 // - Text: "application/prpc; encoding=text"
44 // A pRPC server MUST support Binary and SHOULD support JSON and Text. 44 // A pRPC server MUST support Binary and SHOULD support JSON and Text.
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 // A server SHOULD specify it. 80 // A server SHOULD specify it.
81 // If not specified, a client MUST treat it is as Binary. 81 // If not specified, a client MUST treat it is as Binary.
82 // - Any metadata returned by a service method implementation MUST go into 82 // - Any metadata returned by a service method implementation MUST go into
83 // http headers, unless metadata key starts with "X-Prpc-". 83 // http headers, unless metadata key starts with "X-Prpc-".
84 // 84 //
85 // A server MUST always specify "X-Prpc-Grpc-Code". 85 // A server MUST always specify "X-Prpc-Grpc-Code".
86 // The server SHOULD specify HTTP status corresponding to the gRPC code. 86 // The server SHOULD specify HTTP status corresponding to the gRPC code.
87 // 87 //
88 // If a service/method is not found, the server MUST respond with Unimplemented 88 // If a service/method is not found, the server MUST respond with Unimplemented
89 // gRPC code and SHOULD specify HTTP 501 status. 89 // gRPC code and SHOULD specify HTTP 501 status.
90 //
91 // If HTTP method is not POST, the server MUST respond with Unimplemented
92 // gRPC code and SHOULD specify HTTP 405 status.
93 package prpc 90 package prpc
OLDNEW
« no previous file with comments | « common/prpc/codes.go ('k') | common/prpc/generate.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698