22#include "anch-rest-protobuf-export.hpp"
34#include "rest/headers.hpp"
35#include "codec/protobuf.hpp"
36#include "rest/status.hpp"
90 class ANCH_REST_PROTOBUF_EXPORT
RpcError:
public std::runtime_error {
205 std::map<std::string, Method, std::less<>> _methods;
208 std::size_t _maxMessageSize;
238 template<anch::codec::ProtobufMessage Req, anch::codec::ProtobufMessage Res,
typename F>
264 bool has(std::string_view method)
const;
305 void add(std::string_view method, Method function);
334 ANCH_REST_PROTOBUF_EXPORT std::optional<anch::rest::RpcCode> parseConnectCode(std::string_view name)
noexcept;
391 ANCH_REST_PROTOBUF_EXPORT std::string grpcWebFrame(std::string_view data,
bool trailers);
404 ANCH_REST_PROTOBUF_EXPORT std::string grpcWebMessage(std::string_view body);
420#include "rest/impl/rpcService.hpp"
Definition rpcService.hpp:128
const anch::rest::Headers & getRequestMetadata() const noexcept
RpcContext(anch::rest::Headers request=anch::rest::Headers())
anch::rest::Headers & getResponseMetadata() noexcept
Definition rpcService.hpp:90
anch::rest::RpcCode getCode() const noexcept
RpcError(anch::rest::RpcCode code, const std::string &message=std::string())
std::vector< std::string > getMethods() const
RpcService & unary(std::string_view method, F &&handler)
std::size_t getMaxMessageSize() const noexcept
std::string call(std::string_view method, std::string_view request, anch::rest::RpcFormat format, anch::rest::RpcContext &context) const
const std::string & getName() const noexcept
bool has(std::string_view method) const
RpcService(std::string_view name)
void setMaxMessageSize(std::size_t size) noexcept
AnCH REST library namespace.
Definition auth.hpp:29
RpcCode
Definition rpcService.hpp:45
@ UNAVAILABLE
Definition rpcService.hpp:75
@ ALREADY_EXISTS
Definition rpcService.hpp:59
@ INTERNAL
Definition rpcService.hpp:73
@ PERMISSION_DENIED
Definition rpcService.hpp:61
@ UNAUTHENTICATED
Definition rpcService.hpp:79
@ RESOURCE_EXHAUSTED
Definition rpcService.hpp:63
@ ABORTED
Definition rpcService.hpp:67
@ OUT_OF_RANGE
Definition rpcService.hpp:69
@ CANCELLED
Definition rpcService.hpp:49
@ UNIMPLEMENTED
Definition rpcService.hpp:71
@ DEADLINE_EXCEEDED
Definition rpcService.hpp:55
@ FAILED_PRECONDITION
Definition rpcService.hpp:65
@ INVALID_ARGUMENT
Definition rpcService.hpp:53
@ DATA_LOSS
Definition rpcService.hpp:77
RpcFormat
Definition rpcService.hpp:173
Status
Definition status.hpp:36
constexpr uint16_t code(anch::rest::Status status) noexcept
Definition status.hpp:107
AnCH framework base namespace.
Definition app.hpp:30