thriftrw-plugin-yarpc

command
v1.75.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

thriftrw-plugin-yarpc implements a plugin for ThriftRW that generates code compatible with YARPC.

thriftrw-plugin-yarpc supports "rpc.code" annotations on Thrift exceptions. For example:

exception ExceptionWithCode {
  1: required string val
} (
  rpc.code = "INVALID_ARGUMENT"
)

The "rpc.code" annotation can be any code matching the string name of gRPC status enum codes. YARPC error codes match 1-1 with these codes, however gRPC uses a different string name representation. We choose to use the raw gRPC enum code names instead to ensure cross-language compatibility with other languages, such as Java.

Available string names method:

  • "CANCELLED"
  • "UNKNOWN"
  • "INVALID_ARGUMENT"
  • "DEADLINE_EXCEEDED"
  • "NOT_FOUND"
  • "ALREADY_EXISTS"
  • "PERMISSION_DENIED"
  • "RESOURCE_EXHAUSTED"
  • "FAILED_PRECONDITION"
  • "ABORTED"
  • "OUT_OF_RANGE"
  • "UNIMPLEMENTED"
  • "INTERNAL"
  • "UNAVAILABLE"
  • "DATA_LOSS"
  • "UNAUTHENTICATED"

Adding codes will affect YARPC's observability middleware classification of client and server errors for Thrift exceptions.

For more information on the Thrift encoding, check the documentation of the parent package.

Directories

Path Synopsis
internal
tests/atomic/readonlystorefx
Package readonlystorefx provides better integration for Fx for services implementing or calling ReadOnlyStore.
Package readonlystorefx provides better integration for Fx for services implementing or calling ReadOnlyStore.
tests/atomic/storefx
Package storefx provides better integration for Fx for services implementing or calling Store.
Package storefx provides better integration for Fx for services implementing or calling Store.
tests/common/baseservicefx
Package baseservicefx provides better integration for Fx for services implementing or calling BaseService.
Package baseservicefx provides better integration for Fx for services implementing or calling BaseService.
tests/common/emptyservicefx
Package emptyservicefx provides better integration for Fx for services implementing or calling EmptyService.
Package emptyservicefx provides better integration for Fx for services implementing or calling EmptyService.
tests/common/extendemptyfx
Package extendemptyfx provides better integration for Fx for services implementing or calling ExtendEmpty.
Package extendemptyfx provides better integration for Fx for services implementing or calling ExtendEmpty.
tests/common/extendonlyfx
Package extendonlyfx provides better integration for Fx for services implementing or calling ExtendOnly.
Package extendonlyfx provides better integration for Fx for services implementing or calling ExtendOnly.
tests/extends/barfx
Package barfx provides better integration for Fx for services implementing or calling Bar.
Package barfx provides better integration for Fx for services implementing or calling Bar.
tests/extends/foofx
Package foofx provides better integration for Fx for services implementing or calling Foo.
Package foofx provides better integration for Fx for services implementing or calling Foo.
tests/extends/namefx
Package namefx provides better integration for Fx for services implementing or calling Name.
Package namefx provides better integration for Fx for services implementing or calling Name.
tests/weather/weatherfx
Package weatherfx provides better integration for Fx for services implementing or calling Weather.
Package weatherfx provides better integration for Fx for services implementing or calling Weather.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL