httpovergrpc

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package httpovergrpc implements a http/https service over grpc transport. The server side implementation will be responsible for dialing the proxied destination with the proper http method and credentials and then proxying the responses back to the caller.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterMetricViews

func RegisterMetricViews() error

RegisterMetricViews registers all metric views for proxy for Opencensus to actively record.

Types

type HTTPDoer

type HTTPDoer interface {
	Do(*http.Request) (*http.Response, error)
}

HTTPDoer provides an interface for round tripping an http request response.

type Option

type Option func(s *Service)

Option defines the options to configure the HTTP over gRPC service.

func WithClient

func WithClient(client HTTPDoer) Option

WithClient allows setting the http client for the HTTP over gRPC service.

type Service

type Service struct {
	hpb.UnimplementedHTTPOverGRPCServer
	// contains filtered or unexported fields
}

Service provides the HttpProxy RPC service definitions.

func New

func New(opts ...Option) *Service

New creates a new HTTP over gRPC service.

func (*Service) HTTPRequest

func (s *Service) HTTPRequest(ctx context.Context, req *hpb.Request) (*hpb.Response, error)

SendRequest sends the HTTP request to the path and returns the response received.

Jump to

Keyboard shortcuts

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