grpc

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2025 License: Apache-2.0 Imports: 20 Imported by: 7

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(name string, network string) func(logger log.Logger, cfg *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) Name

func (t *Transport) Name() string

Name returns the name of this 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) 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) Stream

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

Jump to

Keyboard shortcuts

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