connectgrpc

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloneRequest added in v0.6.1

func CloneRequest[Req any](base *connect.Request[Req], msg *Req) *connect.Request[Req]

func CodeToHTTP

func CodeToHTTP(code connect.Code) int32

func HTTPToCode

func HTTPToCode(httpCode int32) connect.Code

func HandleUnary

func HandleUnary[Req any, Res any](ctx context.Context, req *httpgrpc.HTTPRequest, u UnaryHandler[Req, Res]) (*httpgrpc.HTTPResponse, error)

func NewClient added in v0.6.0

func NewClient(transport GRPCRoundTripper) connect.HTTPClient

func RoundTripUnary

func RoundTripUnary[Req any, Res any](ctx context.Context, rt GRPCRoundTripper, in *connect.Request[Req]) (*connect.Response[Res], error)

Types

type GRPCHandler

type GRPCHandler interface {
	Handle(ctx context.Context, req *httpgrpc.HTTPRequest) (*httpgrpc.HTTPResponse, error)
}

func NewHandler added in v0.6.0

func NewHandler(h http.Handler) GRPCHandler

type GRPCRoundTripper

type GRPCRoundTripper interface {
	RoundTripGRPC(ctx context.Context, req *httpgrpc.HTTPRequest) (*httpgrpc.HTTPResponse, error)
}

type UnaryHandler

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

Jump to

Keyboard shortcuts

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