service_config.h
Go to the documentation of this file.
1 //
2 // Copyright 2016 gRPC authors.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #ifndef GRPC_CORE_LIB_SERVICE_CONFIG_SERVICE_CONFIG_H
18 #define GRPC_CORE_LIB_SERVICE_CONFIG_SERVICE_CONFIG_H
19 
21 
22 #include <stddef.h>
23 
24 #include "absl/strings/string_view.h"
25 
26 #include <grpc/slice.h>
27 
30 
31 // The main purpose of the code here is to parse the service config in
32 // JSON form, which will look like this:
33 //
34 // {
35 // "loadBalancingPolicy": "string", // optional
36 // "methodConfig": [ // array of one or more method_config objects
37 // {
38 // "name": [ // array of one or more name objects
39 // {
40 // "service": "string", // required
41 // "method": "string", // optional
42 // }
43 // ],
44 // // remaining fields are optional.
45 // // see https://developers.google.com/protocol-buffers/docs/proto3#json
46 // // for format details.
47 // "waitForReady": bool,
48 // "timeout": "duration_string",
49 // "maxRequestMessageBytes": "int64_string",
50 // "maxResponseMessageBytes": "int64_string",
51 // }
52 // ]
53 // }
54 
55 namespace grpc_core {
56 
57 // TODO(roth): Consider stripping this down further to the completely minimal
58 // interface requied to be exposed as part of the resolver API.
59 class ServiceConfig : public RefCounted<ServiceConfig> {
60  public:
61  virtual absl::string_view json_string() const = 0;
62 
67  size_t index) = 0;
68 
74 };
75 
76 } // namespace grpc_core
77 
78 #endif /* GRPC_CORE_LIB_SERVICE_CONFIG_SERVICE_CONFIG_H */
slice.h
grpc_core
Definition: call_metric_recorder.h:31
absl::string_view
Definition: abseil-cpp/absl/strings/string_view.h:167
grpc_core::ServiceConfigParser::ParsedConfigVector
std::vector< std::unique_ptr< ParsedConfig > > ParsedConfigVector
Definition: lib/service_config/service_config_parser.h:77
grpc_core::ServiceConfig::GetGlobalParsedConfig
virtual ServiceConfigParser::ParsedConfig * GetGlobalParsedConfig(size_t index)=0
check_documentation.path
path
Definition: check_documentation.py:57
grpc_core::ServiceConfig
Definition: service_config.h:59
grpc_slice
Definition: include/grpc/impl/codegen/slice.h:65
grpc_core::ServiceConfig::GetMethodParsedConfigVector
virtual const ServiceConfigParser::ParsedConfigVector * GetMethodParsedConfigVector(const grpc_slice &path) const =0
grpc_core::RefCounted
Definition: ref_counted.h:280
service_config_parser.h
ref_counted.h
index
int index
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/protobuf.h:1184
grpc_core::ServiceConfig::json_string
virtual absl::string_view json_string() const =0
grpc_core::ServiceConfigParser::ParsedConfig
Definition: lib/service_config/service_config_parser.h:45
port_platform.h


grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:01:17