Documentation ¶
Overview ¶
Package grpc is the grpc transport for plugins/client/orb.
Index ¶
- Constants
- func CodeToHTTPStatus(code codes.Code) int
- func NewTransport(logger log.Logger, _ *orb.Config) (orb.TransportType, error)
- type Transport
- func (t *Transport) Call(_ context.Context, _ *client.Request[any, any], _ *client.CallOptions) (*client.RawResponse, error)
- func (t *Transport) CallNoCodec(ctx context.Context, req *client.Request[any, any], result any, ...) error
- func (t *Transport) NeedsCodec() bool
- func (t *Transport) Start() error
- func (t *Transport) Stop(_ context.Context) error
- func (t *Transport) String() string
Constants ¶
View Source
const Name = "grpc"
Name is the transports name.
Variables ¶
This section is empty.
Functions ¶
func CodeToHTTPStatus ¶
CodeToHTTPStatus maps gRPC codes to HTTP status codes.
Falls back to http.StatusInternalServerError if the code is unrecognized.
func NewTransport ¶
NewTransport creates a Transport.
Types ¶
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
Transport is a go-orb/plugins/client/orb compatible transport.
func (*Transport) Call ¶
func (t *Transport) Call(_ context.Context, _ *client.Request[any, any], _ *client.CallOptions) (*client.RawResponse, error)
Call is a noop for grpc.
func (*Transport) CallNoCodec ¶
func (t *Transport) CallNoCodec(ctx context.Context, req *client.Request[any, any], result any, opts *client.CallOptions) error
CallNoCodec does the actual rpc call to the server.
func (*Transport) NeedsCodec ¶
NeedsCodec returns false for grpc the transport.
Directories ¶
Path | Synopsis |
---|---|
Package pool provides a pool of grpc clients This is a modified version of: https://github.com/processout/grpc-go-pool/blob/master/pool.go
|
Package pool provides a pool of grpc clients This is a modified version of: https://github.com/processout/grpc-go-pool/blob/master/pool.go |
Click to show internal directories.
Click to hide internal directories.