MCPcopy Create free account
hub / github.com/apache/brpc / ServiceOptions

Class ServiceOptions

src/brpc/server.h:316–360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

314};
315
316struct ServiceOptions {
317 ServiceOptions(); // constructed with default options.
318
319 // SERVER_OWNS_SERVICE: the service will be deleted by the server.
320 // SERVER_DOESNT_OWN_SERVICE: the service shall be deleted by user after
321 // stopping the server.
322 // Default: SERVER_DOESNT_OWN_SERVICE
323 ServiceOwnership ownership;
324
325 // If this option is non-empty, methods in the service will be exposed
326 // on specified paths instead of default "/SERVICE/METHOD".
327 // Mappings are in form of: "PATH1 => NAME1, PATH2 => NAME2 ..." where
328 // PATHs are valid http paths, NAMEs are method names in the service.
329 // Default: empty
330 std::string restful_mappings;
331
332 // Work with restful_mappings, if this flag is false, reject methods accessed
333 // from default urls (SERVICE/METHOD).
334 // Default: false
335 bool allow_default_url;
336
337 // [ Not recommended to change this option ]
338 // If this flag is true, the service will convert http body to protobuf
339 // when the pb schema is non-empty in http servings. The body must be
340 // valid json or protobuf(wire-format) otherwise the request is rejected.
341 // This option does not affect pure-http services (pb schema is empty).
342 // Services that use older versions of brpc may need to turn this
343 // conversion off and handle http requests by their own to keep compatible
344 // with existing clients.
345 // Default: true
346 bool allow_http_body_to_pb;
347
348 // decode json string to protobuf bytes using base64 decoding when this
349 // option is turned on.
350 // Default: false if BAIDU_INTERNAL is defined, otherwise true
351 bool pb_bytes_to_base64;
352
353 // decode json array to protobuf message which contains a single repeated field.
354 // Default: false.
355 bool pb_single_repeated_to_array;
356
357 // enable server end progressive reading, mainly for http server
358 // Default: false.
359 bool enable_progressive_read;
360};
361
362// Represent ports inside [min_port, max_port]
363struct PortRange {

Callers 1

TestAddBuiltinServiceMethod · 0.85

Calls

no outgoing calls

Tested by 1

TestAddBuiltinServiceMethod · 0.68