connectgateway

package module
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 11 Imported by: 4

README

Connect-Gateway

PkgGoDev GitHub go.mod Go version GoReportCard GitHub

The Connect-Gateway introduces direct binding from gRPC-Gateway local handlers to Connect service handlers. It addresses the recurring request to support Google API HTTP annotations in Connect:

We provide a complete solution for the two to communicate seamlessly through simple function calls, without relying on network communications. All of which is done by reusing as much of the code from both projects as possible and mimicking the connect-go implementation, i.e. reducing code generation as much as possible, with most of the logic being provided in a library.

Features

  • Unary calls support
  • Connect interceptors support
  • Bidirectional gRPC metadata transmission
  • Connect errors to gRPC errors convertion

Limitations

Example

Please refer to the example/ directory for a basic example of how to integrate the Connect-Gateway into your project.

Documentation

Index

Constants

View Source
const Version = "0.4.0"

Variables

This section is empty.

Functions

This section is empty.

Types

type HandlerOption

type HandlerOption interface {
	// contains filtered or unexported methods
}

func WithInterceptors

func WithInterceptors(interceptors ...connect.Interceptor) HandlerOption

type UnaryHandler

type UnaryHandler[Req, Res any] func(context.Context, *Req) (*Res, error)

func NewUnaryHandler

func NewUnaryHandler[Req, Res any](
	procedure string,
	unary func(context.Context, *connect.Request[Req]) (*connect.Response[Res], error),
	opts ...HandlerOption,
) UnaryHandler[Req, Res]

Directories

Path Synopsis
cmd
example module

Jump to

Keyboard shortcuts

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