grpc

package module
v0.0.0-...-b87209e Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Overview

Package grpc is the grpc transport for plugins/client/orb.

Index

Constants

View Source
const Name = "grpc"

Name is the transports name.

Variables

This section is empty.

Functions

func CodeToHTTPStatus

func CodeToHTTPStatus(code codes.Code) int

CodeToHTTPStatus maps gRPC codes to HTTP status codes.

Falls back to http.StatusInternalServerError if the code is unrecognized.

func NewTransport

func NewTransport(logger log.Logger, _ *orb.Config) (orb.TransportType, error)

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

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

func (t *Transport) NeedsCodec() bool

NeedsCodec returns false for grpc the transport.

func (*Transport) Start

func (t *Transport) Start() error

Start starts the transport.

func (*Transport) Stop

func (t *Transport) Stop(_ context.Context) error

Stop stop the transport.

func (*Transport) String

func (t *Transport) String() string

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

Jump to

Keyboard shortcuts

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