Namespaces

Enumerations

enum StatusCode
Name Value Comments
OK 0

Not an error; returned on success.

CANCELLED 1

The operation was cancelled (typically by the caller).

UNKNOWN 2

Unknown error. An example of where this error may be returned is if a
Status value received from another address space belongs to an error-space
that is not known in this address space. Also errors raised by APIs that
do not return enough error information may be converted to this error.

INVALID_ARGUMENT 3

Client specified an invalid argument. Note that this differs from
FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments that are
problematic regardless of the state of the system (e.g., a malformed file
name).

DEADLINE_EXCEEDED 4

Deadline expired before operation could complete. For operations that
change the state of the system, this error may be returned even if the
operation has completed successfully. For example, a successful response
from a server could have been delayed long enough for the deadline to
expire.

NOT_FOUND 5

Some requested entity (e.g., file or directory) was not found.

ALREADY_EXISTS 6

Some entity that we attempted to create (e.g., file or directory) already
exists.

PERMISSION_DENIED 7

The caller does not have permission to execute the specified operation.
PERMISSION_DENIED must not be used for rejections caused by exhausting
some resource (use RESOURCE_EXHAUSTED instead for those errors).
PERMISSION_DENIED must not be used if the caller can not be identified
(use UNAUTHENTICATED instead for those errors).

UNAUTHENTICATED 16

The request does not have valid authentication credentials for the
operation.

RESOURCE_EXHAUSTED 8

Some resource has been exhausted, perhaps a per-user quota, or perhaps the
entire file system is out of space.

FAILED_PRECONDITION 9

Operation was rejected because the system is not in a state required for
the operation's execution. For example, directory to be deleted may be
non-empty, an rmdir operation is applied to a non-directory, etc.

A litmus test that may help a service implementor in deciding
between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE:
(a) Use UNAVAILABLE if the client can retry just the failing call.
(b) Use ABORTED if the client should retry at a higher-level
(e.g., restarting a read-modify-write sequence).
(c) Use FAILED_PRECONDITION if the client should not retry until
the system state has been explicitly fixed. E.g., if an "rmdir"
fails because the directory is non-empty, FAILED_PRECONDITION
should be returned since the client should not retry unless
they have first fixed up the directory by deleting files from it.
(d) Use FAILED_PRECONDITION if the client performs conditional
REST Get/Update/Delete on a resource and the resource on the
server does not match the condition. E.g., conflicting
read-modify-write on the same resource.

ABORTED 10

The operation was aborted, typically due to a concurrency issue like
sequencer check failures, transaction aborts, etc.

See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,
and UNAVAILABLE.

OUT_OF_RANGE 11

Operation was attempted past the valid range. E.g., seeking or reading
past end of file.

Unlike INVALID_ARGUMENT, this error indicates a problem that may be fixed
if the system state changes. For example, a 32-bit file system will
generate INVALID_ARGUMENT if asked to read at an offset that is not in the
range [0,2^32-1], but it will generate OUT_OF_RANGE if asked to read from
an offset past the current file size.

There is a fair bit of overlap between FAILED_PRECONDITION and
OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific error)
when it applies so that callers who are iterating through a space can
easily look for an OUT_OF_RANGE error to detect when they are done.

UNIMPLEMENTED 12

Operation is not implemented or not supported/enabled in this service.

INTERNAL 13

Internal errors. Means some invariants expected by underlying System has
been broken. If you see one of these errors, Something is very broken.

UNAVAILABLE 14

The service is currently unavailable. This is a most likely a transient
condition and may be corrected by retrying with a backoff. Note that it is
not always safe to retry non-idempotent operations.

See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,
and UNAVAILABLE.

DATA_LOSS 15

Unrecoverable data loss or corruption.

DO_NOT_USE -1

Force users to include a default branch:

Defined at line 26 of file ../../third_party/grpc/src/include/grpcpp/support/status_code_enum.h

Records

Functions

  • std::shared_ptr<const AuthContext> CreateAuthContext (grpc_call * call)

    TODO(ctiller): not sure we want to make this a permanent thing

  • void AddInsecureChannelFromFd (Server * server, int fd)

    Add a new client to a

    communicating over the given

    file descriptor.

    Parameters

    server The server to add the client to.
    fd The file descriptor representing a socket.
  • template <class ProtoBufferWriter, class T>
    Status GenericSerialize (const grpc::protobuf::MessageLite & msg, ByteBuffer * bb, bool * own_buffer)

    ProtoBufferWriter must be a subclass of ::protobuf::io::ZeroCopyOutputStream.

    Defined at line 45 of file ../../third_party/grpc/src/include/grpcpp/impl/proto_utils.h

  • template <class ProtoBufferReader, class T>
    Status GenericDeserialize (ByteBuffer * buffer, grpc::protobuf::MessageLite * msg)

    BufferReader must be a subclass of ::protobuf::io::ZeroCopyInputStream.

    Defined at line 71 of file ../../third_party/grpc/src/include/grpcpp/impl/proto_utils.h

  • std::unique_ptr<ServerBuilderOption> MakeChannelArgumentOption (const std::string & name, const std::string & value)
  • std::unique_ptr<ServerBuilderOption> MakeChannelArgumentOption (const std::string & name, int value)
  • std::unique_ptr<ServerBuilderOption> MakeChannelArgumentOption (const std::string & name, void * value)
  • std::shared_ptr<grpc::Channel> CreateInsecureChannelFromFd (const std::string & target, int fd)

    Create a new

    communicating over the given file descriptor.

    Parameters

    target The name of the target.
    fd The file descriptor representing a socket.
  • std::shared_ptr<Channel> CreateChannel (const grpc::string & target, const std::shared_ptr<ChannelCredentials> & creds)

    Create a new

    pointing to

    Parameters

    target The URI of the endpoint to connect to.
    creds Credentials to use for the created channel. If it does nothold an object or is invalid, a lame channel (one on which all operationsfail) is returned.
  • std::shared_ptr<Channel> CreateChannelInternal (const std::string & host, grpc_channel * c_channel, std::vector<std::unique_ptr<experimental::ClientInterceptorFactoryInterface>> interceptor_creators)
  • std::shared_ptr<grpc::Channel> CreateCustomInsecureChannelFromFd (const std::string & target, int fd, const grpc::ChannelArguments & args)

    Create a new

    communicating over given file descriptor with custom

    channel arguments.

    Parameters

    target The name of the target.
    fd The file descriptor representing a socket.
    args Options for channel creation.
  • std::shared_ptr<Channel> CreateCustomChannel (const grpc::string & target, const std::shared_ptr<grpc::ChannelCredentials> & creds, const grpc::ChannelArguments & args)

    Create a new

    pointing to

    Parameters

    target The URI of the endpoint to connect to.
    creds Credentials to use for the created channel. If it does nothold an object or is invalid, a lame channel (one on which all operationsfail) is returned.
    args Options for channel creation.
  • void EnableDefaultHealthCheckService (bool enable)

    Enable/disable the default health checking service. This applies to all C++

    servers created afterwards. For each server, user can override the default

    with a HealthCheckServiceServerBuilderOption.

    NOT thread safe.

  • bool DefaultHealthCheckServiceEnabled ()

    Returns whether the default health checking service is enabled.

    NOT thread safe.

  • grpc::string_ref StringRefFromSlice (const grpc_slice * slice)

    Defined at line 121 of file ../../third_party/grpc/src/include/grpcpp/support/slice.h

  • std::string StringFromCopiedSlice (grpc_slice slice)

    Defined at line 127 of file ../../third_party/grpc/src/include/grpcpp/support/slice.h

  • grpc_slice SliceReferencingString (const std::string & str)

    Defined at line 132 of file ../../third_party/grpc/src/include/grpcpp/support/slice.h

  • grpc_slice SliceFromCopiedString (const std::string & str)

    Defined at line 136 of file ../../third_party/grpc/src/include/grpcpp/support/slice.h

  • std::shared_ptr<ChannelCredentials> XdsCredentials (const std::shared_ptr<ChannelCredentials> & fallback_creds)

    Builds XDS Credentials.

  • std::shared_ptr<ServerCredentials> XdsServerCredentials (const std::shared_ptr<ServerCredentials> & fallback_credentials)

    Builds Xds ServerCredentials given fallback credentials

  • std::string Version ()

    Return gRPC library version.

  • void Timepoint2Timespec (const std::chrono::system_clock::time_point & from, gpr_timespec * to)

    from and to should be absolute time.

  • void TimepointHR2Timespec (const std::chrono::high_resolution_clock::time_point & from, gpr_timespec * to)
  • std::chrono::system_clock::time_point Timespec2Timepoint (gpr_timespec t)
  • std::shared_ptr<ChannelCredentials> CompositeChannelCredentials (const std::shared_ptr<ChannelCredentials> & channel_creds, const std::shared_ptr<CallCredentials> & call_creds)

    Combines a channel credentials and a call credentials into a composite

    channel credentials.

  • std::shared_ptr<ServerCredentials> SslServerCredentials (const grpc::SslServerCredentialsOptions & options)

    Builds SSL ServerCredentials given SSL specific options

  • std::shared_ptr<ServerCredentials> InsecureServerCredentials ()
  • std::shared_ptr<ChannelCredentials> GoogleDefaultCredentials ()

    Builds credentials with reasonable defaults.

  • std::shared_ptr<ChannelCredentials> SslCredentials (const SslCredentialsOptions & options)

    Builds SSL Credentials given SSL specific options

  • std::shared_ptr<CallCredentials> GoogleComputeEngineCredentials ()

    Builds credentials for use when running in GCE

  • std::shared_ptr<CallCredentials> ServiceAccountJWTAccessCredentials (const grpc::string & json_key, long token_lifetime_seconds)

    Builds Service Account JWT Access credentials.

    json_key is the JSON key string containing the client's private key.

    token_lifetime_seconds is the lifetime in seconds of each Json Web Token

    (JWT) created with this credentials. It should not exceed

    or will be cropped to this value.

  • std::shared_ptr<CallCredentials> GoogleRefreshTokenCredentials (const grpc::string & json_refresh_token)

    Builds refresh token credentials.

    json_refresh_token is the JSON string containing the refresh token along

    with a client_id and client_secret.

  • std::shared_ptr<CallCredentials> AccessTokenCredentials (const grpc::string & access_token)

    Builds access token credentials.

    access_token is an oauth2 access token that was fetched using an out of band

    mechanism.

  • std::shared_ptr<CallCredentials> GoogleIAMCredentials (const grpc::string & authorization_token, const grpc::string & authority_selector)

    Builds IAM credentials.

  • std::shared_ptr<CallCredentials> CompositeCallCredentials (const std::shared_ptr<CallCredentials> & creds1, const std::shared_ptr<CallCredentials> & creds2)

    Combines two call credentials objects into a composite call credentials.

  • std::shared_ptr<ChannelCredentials> InsecureChannelCredentials ()

    Credentials for an unencrypted, unauthenticated channel

  • std::shared_ptr<CallCredentials> MetadataCredentialsFromPlugin (std::unique_ptr<MetadataCredentialsPlugin> plugin)
  • std::shared_ptr<CallCredentials> ExternalAccountCredentials (const grpc::string & json_string, const std::vector<grpc::string> & scopes)

    Builds External Account credentials.

    json_string is the JSON string containing the credentials options.

    scopes contains the scopes to be binded with the credentials.

  • bool operator== (string_ref x, string_ref y)

    Comparison operators

    Defined at line 136 of file ../../third_party/grpc/src/include/grpcpp/support/string_ref.h

  • bool operator!= (string_ref x, string_ref y)

    Defined at line 137 of file ../../third_party/grpc/src/include/grpcpp/support/string_ref.h

  • bool operator< (string_ref x, string_ref y)

    Defined at line 138 of file ../../third_party/grpc/src/include/grpcpp/support/string_ref.h

  • bool operator<= (string_ref x, string_ref y)

    Defined at line 139 of file ../../third_party/grpc/src/include/grpcpp/support/string_ref.h

  • bool operator> (string_ref x, string_ref y)

    Defined at line 140 of file ../../third_party/grpc/src/include/grpcpp/support/string_ref.h

  • bool operator>= (string_ref x, string_ref y)

    Defined at line 141 of file ../../third_party/grpc/src/include/grpcpp/support/string_ref.h

  • std::ostream & operator<< (std::ostream & out, const string_ref & string)

    Defined at line 143 of file ../../third_party/grpc/src/include/grpcpp/support/string_ref.h