parent
ddb9d5d700
commit
7910c5f8ae
14 changed files with 462 additions and 246 deletions
@ -1,2 +0,0 @@ |
||||
handshaker.proto no_unions:true |
||||
grpc.gcp.StartServerHandshakeReq.handshake_parameters max_count:3 |
@ -1,93 +0,0 @@ |
||||
// Copyright 2016 gRPC authors. |
||||
// |
||||
// Licensed under the Apache License, Version 2.0 (the "License"); |
||||
// you may not use this file except in compliance with the License. |
||||
// You may obtain a copy of the License at |
||||
// |
||||
// http://www.apache.org/licenses/LICENSE-2.0 |
||||
// |
||||
// Unless required by applicable law or agreed to in writing, software |
||||
// distributed under the License is distributed on an "AS IS" BASIS, |
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
// See the License for the specific language governing permissions and |
||||
// limitations under the License. |
||||
|
||||
syntax = "proto3"; |
||||
|
||||
import "google/protobuf/timestamp.proto"; |
||||
|
||||
package grpc.binary_log.v1alpha; |
||||
|
||||
enum Direction { |
||||
SERVER_SEND = 0; |
||||
SERVER_RECV = 1; |
||||
CLIENT_SEND = 2; |
||||
CLIENT_RECV = 3; |
||||
} |
||||
|
||||
message KeyValuePair { |
||||
string key = 1; |
||||
string value = 2; |
||||
} |
||||
|
||||
// Any sort of metadata that may be sent in either direction during a call |
||||
message Metadata { |
||||
// Cryptographically unique identifier, generated on the client and sent |
||||
// to the server. |
||||
uint64 rpc_id = 1; |
||||
// Timestamp of logging the metadata |
||||
google.protobuf.Timestamp timestamp = 2; |
||||
Direction direction = 3; |
||||
// The actual metadata that is being sent |
||||
repeated KeyValuePair metadata = 4; |
||||
|
||||
// Initial metadata sent by the client to initiate a request |
||||
message ClientInitialMetadata { |
||||
// The full method name that is being called |
||||
string method_name = 1; |
||||
// The call's deadline |
||||
google.protobuf.Timestamp deadline = 2; |
||||
// The address of the connected peer |
||||
string peer = 3; |
||||
} |
||||
|
||||
// Arbitrary key/value pairs specified by the user that are not sent over |
||||
// the network but are nonetheless useful to log |
||||
message UserData { |
||||
} |
||||
|
||||
// Initial metadata response sent by the server after accepting the request |
||||
message ServerInitialMetadata { |
||||
} |
||||
|
||||
// Status sent by the server when closing the call on the server side |
||||
message ServerStatus { |
||||
// The status code |
||||
uint32 code = 1; |
||||
// The status details |
||||
string details = 2; |
||||
} |
||||
|
||||
oneof kind { |
||||
ClientInitialMetadata client_initial_metadata = 5; |
||||
UserData user_data = 6; |
||||
ServerInitialMetadata server_initial_metadata = 7; |
||||
ServerStatus server_status = 8; |
||||
} |
||||
} |
||||
|
||||
// A message that is sent during a call |
||||
message Message { |
||||
// Cryptographically unique identifier, generated on the client and sent |
||||
// to the server. |
||||
uint64 rpc_id = 1; |
||||
// The sequence number of the message. Messages sent by the client and by the |
||||
// server should have independently incrementing sequence numbers. |
||||
uint32 sequence_number = 2; |
||||
Direction direction = 3; |
||||
// The length of the complete message. |
||||
uint32 length = 4; |
||||
// The contents of the message. May be a prefix instead of the complete |
||||
// message. |
||||
bytes data = 5; |
||||
} |
@ -1 +0,0 @@ |
||||
grpc.health.v1.HealthCheckRequest.service max_size:200 |
@ -1,51 +0,0 @@ |
||||
// Copyright 2019 The gRPC Authors |
||||
// |
||||
// Licensed under the Apache License, Version 2.0 (the "License"); |
||||
// you may not use this file except in compliance with the License. |
||||
// You may obtain a copy of the License at |
||||
// |
||||
// http://www.apache.org/licenses/LICENSE-2.0 |
||||
// |
||||
// Unless required by applicable law or agreed to in writing, software |
||||
// distributed under the License is distributed on an "AS IS" BASIS, |
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
// See the License for the specific language governing permissions and |
||||
// limitations under the License. |
||||
|
||||
syntax = "proto3"; |
||||
|
||||
package grpc.http_over_grpc; |
||||
|
||||
// Represents HTTP 1.1 header. |
||||
message Header { |
||||
string key = 1; |
||||
repeated string values = 2; |
||||
} |
||||
|
||||
// An HTTP 1.1 request encapsulated in a gRPC. |
||||
message HTTPOverGRPCRequest { |
||||
// The HTTP request method. |
||||
string method = 1; |
||||
// The HTTP request URL. |
||||
string url = 2; |
||||
// The HTTP request headers. |
||||
repeated Header headers = 3; |
||||
// HTTP request body. |
||||
bytes body = 4; |
||||
} |
||||
|
||||
// An HTTP 1.1 reply encapsulated in an RPC. |
||||
message HTTPOverGRPCReply { |
||||
// The HTTP status code (e.g. 200, 400, 404). |
||||
int32 status = 1; |
||||
// The HTTP response headers. |
||||
repeated Header headers = 2; |
||||
// The HTTP response body. |
||||
bytes body = 3; |
||||
} |
||||
|
||||
// Currently does not support HTTP chunked transfer encoding. |
||||
service HTTPOverGRPC { |
||||
// Perform the given HTTP request. |
||||
rpc HTTPRequest(HTTPOverGRPCRequest) returns (HTTPOverGRPCReply) {} |
||||
} |
@ -1,5 +0,0 @@ |
||||
grpc.lb.v1.InitialLoadBalanceRequest.name max_size:128 |
||||
grpc.lb.v1.InitialLoadBalanceResponse.load_balancer_delegate max_size:64 |
||||
grpc.lb.v1.Server.ip_address max_size:16 |
||||
grpc.lb.v1.Server.load_balance_token max_size:50 |
||||
load_balancer.proto no_unions:true |
@ -0,0 +1,225 @@ |
||||
// Copyright 2020 The gRPC Authors |
||||
// |
||||
// Licensed under the Apache License, Version 2.0 (the "License"); |
||||
// you may not use this file except in compliance with the License. |
||||
// You may obtain a copy of the License at |
||||
// |
||||
// http://www.apache.org/licenses/LICENSE-2.0 |
||||
// |
||||
// Unless required by applicable law or agreed to in writing, software |
||||
// distributed under the License is distributed on an "AS IS" BASIS, |
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
// See the License for the specific language governing permissions and |
||||
// limitations under the License. |
||||
|
||||
syntax = "proto3"; |
||||
|
||||
package grpc.lookup.v1; |
||||
|
||||
import "google/protobuf/duration.proto"; |
||||
|
||||
option go_package = "google.golang.org/grpc/lookup/grpc_lookup_v1"; |
||||
option java_multiple_files = true; |
||||
option java_package = "io.grpc.lookup.v1"; |
||||
option java_outer_classname = "RlsConfigProto"; |
||||
|
||||
// Extract a key based on a given name (e.g. header name or query parameter |
||||
// name). The name must match one of the names listed in the "name" field. If |
||||
// the "required_match" field is true, one of the specified names must be |
||||
// present for the keybuilder to match. |
||||
message NameMatcher { |
||||
// The name that will be used in the RLS key_map to refer to this value. |
||||
// If required_match is true, you may omit this field or set it to an empty |
||||
// string, in which case the matcher will require a match, but won't update |
||||
// the key_map. |
||||
string key = 1; |
||||
|
||||
// Ordered list of names (headers or query parameter names) that can supply |
||||
// this value; the first one with a non-empty value is used. |
||||
repeated string names = 2; |
||||
|
||||
// If true, make this extraction required; the key builder will not match |
||||
// if no value is found. |
||||
bool required_match = 3; |
||||
} |
||||
|
||||
// A GrpcKeyBuilder applies to a given gRPC service, name, and headers. |
||||
message GrpcKeyBuilder { |
||||
// To match, one of the given Name fields must match; the service and method |
||||
// fields are specified as fixed strings. The service name is required and |
||||
// includes the proto package name. The method name may be omitted, in |
||||
// which case any method on the given service is matched. |
||||
message Name { |
||||
string service = 1; |
||||
string method = 2; |
||||
} |
||||
repeated Name names = 1; |
||||
|
||||
// If you wish to include the host, service, or method names as keys in the |
||||
// generated RouteLookupRequest, specify key names to use in the extra_keys |
||||
// submessage. If a key name is empty, no key will be set for that value. |
||||
// If this submessage is specified, the normal host/path fields will be left |
||||
// unset in the RouteLookupRequest. We are deprecating host/path in the |
||||
// RouteLookupRequest, so services should migrate to the ExtraKeys approach. |
||||
message ExtraKeys { |
||||
string host = 1; |
||||
string service = 2; |
||||
string method = 3; |
||||
} |
||||
ExtraKeys extra_keys = 3; |
||||
|
||||
// Extract keys from all listed headers. |
||||
// For gRPC, it is an error to specify "required_match" on the NameMatcher |
||||
// protos. |
||||
repeated NameMatcher headers = 2; |
||||
|
||||
// You can optionally set one or more specific key/value pairs to be added to |
||||
// the key_map. This can be useful to identify which builder built the key, |
||||
// for example if you are suppressing the actual method, but need to |
||||
// separately cache and request all the matched methods. |
||||
map<string, string> constant_keys = 4; |
||||
} |
||||
|
||||
// An HttpKeyBuilder applies to a given HTTP URL and headers. |
||||
// |
||||
// Path and host patterns use the matching syntax from gRPC transcoding to |
||||
// extract named key/value pairs from the path and host components of the URL: |
||||
// https://github.com/googleapis/googleapis/blob/master/google/api/http.proto |
||||
// |
||||
// It is invalid to specify the same key name in multiple places in a pattern. |
||||
// |
||||
// For a service where the project id can be expressed either as a subdomain or |
||||
// in the path, separate HttpKeyBuilders must be used: |
||||
// host_pattern: 'example.com' path_pattern: '/{id}/{object}/**' |
||||
// host_pattern: '{id}.example.com' path_pattern: '/{object}/**' |
||||
// If the host is exactly 'example.com', the first path segment will be used as |
||||
// the id and the second segment as the object. If the host has a subdomain, the |
||||
// subdomain will be used as the id and the first segment as the object. If |
||||
// neither pattern matches, no keys will be extracted. |
||||
message HttpKeyBuilder { |
||||
// host_pattern is an ordered list of host template patterns for the desired |
||||
// value. If any host_pattern values are specified, then at least one must |
||||
// match, and the last one wins and sets any specified variables. A host |
||||
// consists of labels separated by dots. Each label is matched against the |
||||
// label in the pattern as follows: |
||||
// - "*": Matches any single label. |
||||
// - "**": Matches zero or more labels (first or last part of host only). |
||||
// - "{<name>=...}": One or more label capture, where "..." can be any |
||||
// template that does not include a capture. |
||||
// - "{<name>}": A single label capture. Identical to {<name>=*}. |
||||
// |
||||
// Examples: |
||||
// - "example.com": Only applies to the exact host example.com. |
||||
// - "*.example.com": Matches subdomains of example.com. |
||||
// - "**.example.com": matches example.com, and all levels of subdomains. |
||||
// - "{project}.example.com": Extracts the third level subdomain. |
||||
// - "{project=**}.example.com": Extracts the third level+ subdomains. |
||||
// - "{project=**}": Extracts the entire host. |
||||
repeated string host_patterns = 1; |
||||
|
||||
// path_pattern is an ordered list of path template patterns for the desired |
||||
// value. If any path_pattern values are specified, then at least one must |
||||
// match, and the last one wins and sets any specified variables. A path |
||||
// consists of segments separated by slashes. Each segment is matched against |
||||
// the segment in the pattern as follows: |
||||
// - "*": Matches any single segment. |
||||
// - "**": Matches zero or more segments (first or last part of path only). |
||||
// - "{<name>=...}": One or more segment capture, where "..." can be any |
||||
// template that does not include a capture. |
||||
// - "{<name>}": A single segment capture. Identical to {<name>=*}. |
||||
// A custom method may also be specified by appending ":" and the custom |
||||
// method name or "*" to indicate any custom method (including no custom |
||||
// method). For example, "/*/projects/{project_id}/**:*" extracts |
||||
// `{project_id}` for any version, resource and custom method that includes |
||||
// it. By default, any custom method will be matched. |
||||
// |
||||
// Examples: |
||||
// - "/v1/{name=messages/*}": extracts a name like "messages/12345". |
||||
// - "/v1/messages/{message_id}": extracts a message_id like "12345". |
||||
// - "/v1/users/{user_id}/messages/{message_id}": extracts two key values. |
||||
repeated string path_patterns = 2; |
||||
|
||||
// List of query parameter names to try to match. |
||||
// For example: ["parent", "name", "resource.name"] |
||||
// We extract all the specified query_parameters (case-sensitively). If any |
||||
// are marked as "required_match" and are not present, this keybuilder fails |
||||
// to match. If a given parameter appears multiple times (?foo=a&foo=b) we |
||||
// will report it as a comma-separated string (foo=a,b). |
||||
repeated NameMatcher query_parameters = 3; |
||||
|
||||
// List of headers to try to match. |
||||
// We extract all the specified header values (case-insensitively). If any |
||||
// are marked as "required_match" and are not present, this keybuilder fails |
||||
// to match. If a given header appears multiple times in the request we will |
||||
// report it as a comma-separated string, in standard HTTP fashion. |
||||
repeated NameMatcher headers = 4; |
||||
|
||||
// You can optionally set one or more specific key/value pairs to be added to |
||||
// the key_map. This can be useful to identify which builder built the key, |
||||
// for example if you are suppressing a lot of information from the URL, but |
||||
// need to separately cache and request URLs with that content. |
||||
map<string, string> constant_keys = 5; |
||||
} |
||||
|
||||
message RouteLookupConfig { |
||||
// Ordered specifications for constructing keys for HTTP requests. Last |
||||
// match wins. If no HttpKeyBuilder matches, an empty key_map will be sent to |
||||
// the lookup service; it should likely reply with a global default route |
||||
// and raise an alert. |
||||
repeated HttpKeyBuilder http_keybuilders = 1; |
||||
|
||||
// Unordered specifications for constructing keys for gRPC requests. All |
||||
// GrpcKeyBuilders on this list must have unique "name" fields so that the |
||||
// client is free to prebuild a hash map keyed by name. If no GrpcKeyBuilder |
||||
// matches, an empty key_map will be sent to the lookup service; it should |
||||
// likely reply with a global default route and raise an alert. |
||||
repeated GrpcKeyBuilder grpc_keybuilders = 2; |
||||
|
||||
// The name of the lookup service as a gRPC URI. Typically, this will be |
||||
// a subdomain of the target, such as "lookup.datastore.googleapis.com". |
||||
string lookup_service = 3; |
||||
|
||||
// Configure a timeout value for lookup service requests. |
||||
// Defaults to 10 seconds if not specified. |
||||
google.protobuf.Duration lookup_service_timeout = 4; |
||||
|
||||
// How long are responses valid for (like HTTP Cache-Control). |
||||
// If omitted or zero, the longest valid cache time is used. |
||||
// This value is clamped to 5 minutes to avoid unflushable bad responses. |
||||
google.protobuf.Duration max_age = 5; |
||||
|
||||
// After a response has been in the client cache for this amount of time |
||||
// and is re-requested, start an asynchronous RPC to re-validate it. |
||||
// This value should be less than max_age by at least the length of a |
||||
// typical RTT to the Route Lookup Service to fully mask the RTT latency. |
||||
// If omitted, keys are only re-requested after they have expired. |
||||
google.protobuf.Duration stale_age = 6; |
||||
|
||||
// Rough indicator of amount of memory to use for the client cache. Some of |
||||
// the data structure overhead is not accounted for, so actual memory consumed |
||||
// will be somewhat greater than this value. If this field is omitted or set |
||||
// to zero, a client default will be used. The value may be capped to a lower |
||||
// amount based on client configuration. |
||||
int64 cache_size_bytes = 7; |
||||
|
||||
// This is a list of all the possible targets that can be returned by the |
||||
// lookup service. If a target not on this list is returned, it will be |
||||
// treated the same as an unhealthy target. |
||||
repeated string valid_targets = 8; |
||||
|
||||
// This value provides a default target to use if needed. If set, it will be |
||||
// used if RLS returns an error, times out, or returns an invalid response. |
||||
// Note that requests can be routed only to a subdomain of the original |
||||
// target, e.g. "us_east_1.cloudbigtable.googleapis.com". |
||||
string default_target = 9; |
||||
|
||||
reserved 10; |
||||
reserved "request_processing_strategy"; |
||||
} |
||||
|
||||
// RouteLookupClusterSpecifier is used in xDS to represent a cluster specifier |
||||
// plugin for RLS. |
||||
message RouteLookupClusterSpecifier { |
||||
// The RLS config for this cluster specifier plugin instance. |
||||
RouteLookupConfig route_lookup_config = 1; |
||||
} |
@ -0,0 +1,147 @@ |
||||
// Copyright 2016 The gRPC Authors |
||||
// |
||||
// Licensed under the Apache License, Version 2.0 (the "License"); |
||||
// you may not use this file except in compliance with the License. |
||||
// You may obtain a copy of the License at |
||||
// |
||||
// http://www.apache.org/licenses/LICENSE-2.0 |
||||
// |
||||
// Unless required by applicable law or agreed to in writing, software |
||||
// distributed under the License is distributed on an "AS IS" BASIS, |
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
// See the License for the specific language governing permissions and |
||||
// limitations under the License. |
||||
|
||||
// Service exported by server reflection. A more complete description of how |
||||
// server reflection works can be found at |
||||
// https://github.com/grpc/grpc/blob/master/doc/server-reflection.md |
||||
// |
||||
// The canonical version of this proto can be found at |
||||
// https://github.com/grpc/grpc-proto/blob/master/grpc/reflection/v1/reflection.proto |
||||
|
||||
syntax = "proto3"; |
||||
|
||||
package grpc.reflection.v1; |
||||
|
||||
option go_package = "google.golang.org/grpc/reflection/grpc_reflection_v1"; |
||||
option java_multiple_files = true; |
||||
option java_package = "io.grpc.reflection.v1"; |
||||
option java_outer_classname = "ServerReflectionProto"; |
||||
|
||||
service ServerReflection { |
||||
// The reflection service is structured as a bidirectional stream, ensuring |
||||
// all related requests go to a single server. |
||||
rpc ServerReflectionInfo(stream ServerReflectionRequest) |
||||
returns (stream ServerReflectionResponse); |
||||
} |
||||
|
||||
// The message sent by the client when calling ServerReflectionInfo method. |
||||
message ServerReflectionRequest { |
||||
string host = 1; |
||||
// To use reflection service, the client should set one of the following |
||||
// fields in message_request. The server distinguishes requests by their |
||||
// defined field and then handles them using corresponding methods. |
||||
oneof message_request { |
||||
// Find a proto file by the file name. |
||||
string file_by_filename = 3; |
||||
|
||||
// Find the proto file that declares the given fully-qualified symbol name. |
||||
// This field should be a fully-qualified symbol name |
||||
// (e.g. <package>.<service>[.<method>] or <package>.<type>). |
||||
string file_containing_symbol = 4; |
||||
|
||||
// Find the proto file which defines an extension extending the given |
||||
// message type with the given field number. |
||||
ExtensionRequest file_containing_extension = 5; |
||||
|
||||
// Finds the tag numbers used by all known extensions of the given message |
||||
// type, and appends them to ExtensionNumberResponse in an undefined order. |
||||
// Its corresponding method is best-effort: it's not guaranteed that the |
||||
// reflection service will implement this method, and it's not guaranteed |
||||
// that this method will provide all extensions. Returns |
||||
// StatusCode::UNIMPLEMENTED if it's not implemented. |
||||
// This field should be a fully-qualified type name. The format is |
||||
// <package>.<type> |
||||
string all_extension_numbers_of_type = 6; |
||||
|
||||
// List the full names of registered services. The content will not be |
||||
// checked. |
||||
string list_services = 7; |
||||
} |
||||
} |
||||
|
||||
// The type name and extension number sent by the client when requesting |
||||
// file_containing_extension. |
||||
message ExtensionRequest { |
||||
// Fully-qualified type name. The format should be <package>.<type> |
||||
string containing_type = 1; |
||||
int32 extension_number = 2; |
||||
} |
||||
|
||||
// The message sent by the server to answer ServerReflectionInfo method. |
||||
message ServerReflectionResponse { |
||||
string valid_host = 1; |
||||
ServerReflectionRequest original_request = 2; |
||||
// The server sets one of the following fields according to the message_request |
||||
// in the request. |
||||
oneof message_response { |
||||
// This message is used to answer file_by_filename, file_containing_symbol, |
||||
// file_containing_extension requests with transitive dependencies. |
||||
// As the repeated label is not allowed in oneof fields, we use a |
||||
// FileDescriptorResponse message to encapsulate the repeated fields. |
||||
// The reflection service is allowed to avoid sending FileDescriptorProtos |
||||
// that were previously sent in response to earlier requests in the stream. |
||||
FileDescriptorResponse file_descriptor_response = 4; |
||||
|
||||
// This message is used to answer all_extension_numbers_of_type requests. |
||||
ExtensionNumberResponse all_extension_numbers_response = 5; |
||||
|
||||
// This message is used to answer list_services requests. |
||||
ListServiceResponse list_services_response = 6; |
||||
|
||||
// This message is used when an error occurs. |
||||
ErrorResponse error_response = 7; |
||||
} |
||||
} |
||||
|
||||
// Serialized FileDescriptorProto messages sent by the server answering |
||||
// a file_by_filename, file_containing_symbol, or file_containing_extension |
||||
// request. |
||||
message FileDescriptorResponse { |
||||
// Serialized FileDescriptorProto messages. We avoid taking a dependency on |
||||
// descriptor.proto, which uses proto2 only features, by making them opaque |
||||
// bytes instead. |
||||
repeated bytes file_descriptor_proto = 1; |
||||
} |
||||
|
||||
// A list of extension numbers sent by the server answering |
||||
// all_extension_numbers_of_type request. |
||||
message ExtensionNumberResponse { |
||||
// Full name of the base type, including the package name. The format |
||||
// is <package>.<type> |
||||
string base_type_name = 1; |
||||
repeated int32 extension_number = 2; |
||||
} |
||||
|
||||
// A list of ServiceResponse sent by the server answering list_services request. |
||||
message ListServiceResponse { |
||||
// The information of each service may be expanded in the future, so we use |
||||
// ServiceResponse message to encapsulate it. |
||||
repeated ServiceResponse service = 1; |
||||
} |
||||
|
||||
// The information of a single service used by ListServiceResponse to answer |
||||
// list_services request. |
||||
message ServiceResponse { |
||||
// Full name of a registered service, including its package name. The format |
||||
// is <package>.<service> |
||||
string name = 1; |
||||
} |
||||
|
||||
// The error code and error message sent by the server when an error occurs. |
||||
message ErrorResponse { |
||||
// This field uses the error codes defined in grpc::StatusCode. |
||||
int32 error_code = 1; |
||||
string error_message = 2; |
||||
} |
||||
|
Loading…
Reference in new issue