Documentation
¶
Overview ¶
Package grpc is the grpc transport for plugins/client/orb.
Index ¶
- Constants
- func CodeToHTTPStatus(code codes.Code) int
- func NewTransport(name string, network string) func(logger log.Logger, cfg *orb.Config) (orb.TransportType, error)
- type Transport
- func (t *Transport) Name() string
- func (t *Transport) Request(ctx context.Context, infos client.RequestInfos, req any, result any, ...) error
- func (t *Transport) Start() error
- func (t *Transport) Stop(_ context.Context) error
- func (t *Transport) Stream(ctx context.Context, infos client.RequestInfos, opts *client.CallOptions) (client.StreamIface[any, any], error)
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.
Types ¶
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
Transport is a go-orb/plugins/client/orb compatible transport.
func (*Transport) Request ¶
func (t *Transport) Request(ctx context.Context, infos client.RequestInfos, req any, result any, opts *client.CallOptions) error
Request does the actual rpc request to the server.
func (*Transport) Stream ¶
func (t *Transport) Stream(ctx context.Context, infos client.RequestInfos, opts *client.CallOptions) (client.StreamIface[any, any], error)
Stream creates a bidirectional gRPC stream to the service endpoint.
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.