gRPC generator

Configure gRPC generator

Full gRPC generator config

gun:
  type: grpc
  target: '[hostname]:443'
  timeout: 15s              # Grpc request timeout. Default: 15s
  tls: false                # If true, Pandora accepts any certificate presented by the server and any host name in that certificate. Default: false
  reflect_port: 8000        # If your reflection service is located on a port other than the main server
  reflect_metadata:         # Separate metadata data for reflection service
    auth: Token
  shared-client:
    enabled: false          # If TRUE, the generator will use a common transport client for all instances
    client-number: 1        # The number of shared clients can be increased. The default is 1
  dial_options:
    authority: some.host    # Specifies the value to be used as the :authority pseudo-header and as the server name in authentication handshake
    timeout: 1s             # Timeout for dialing GRPC connect. Default: 1s
  answlog:
    enabled: true
    path: ./answ.log
    filter: all            # all - all http codes, warning - log 4xx and 5xx, error - log only 5xx. Default: error

Mapping Response Codes

Pandora uses the gRPC client from google.golang.org/grpc as a client (https://github.com/grpc/grpc-go)

But to unify reports it converts them into HTTP codes.

Mapping table gPRC StatusCode -> HTTP StatusCode

gRPC Status NamegRPC Status CodeHTTP Status Code
OK0200
Canceled1499
InvalidArgument3400
DeadlineExceeded4504
NotFound5404
AlreadyExists6409
PermissionDenied7403
ResourceExhausted8429
FailedPrecondition9400
Aborted10409
OutOfRange11400
Unimplemented12501
Unavailable 1414503
Unauthenticated 1616401
unknown-500

References