Documentation ¶
Index ¶
- func CloneRequest[Req any](base *connect.Request[Req], msg *Req) *connect.Request[Req]
- func CodeToHTTP(code connect.Code) int32
- func HTTPToCode(httpCode int32) connect.Code
- func HandleUnary[Req any, Res any](ctx context.Context, req *httpgrpc.HTTPRequest, u UnaryHandler[Req, Res]) (*httpgrpc.HTTPResponse, error)
- func NewClient(transport GRPCRoundTripper) connect.HTTPClient
- func ProcedureFromContext(ctx context.Context) string
- func RoundTripUnary[Req any, Res any](ctx context.Context, rt GRPCRoundTripper, in *connect.Request[Req]) (*connect.Response[Res], error)
- func WithProcedure(ctx context.Context, u string) context.Context
- type GRPCHandler
- type GRPCRoundTripper
- type UnaryHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloneRequest ¶
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 ¶
func NewClient(transport GRPCRoundTripper) connect.HTTPClient
func ProcedureFromContext ¶
func RoundTripUnary ¶
Types ¶
type GRPCHandler ¶
type GRPCHandler interface {
Handle(ctx context.Context, req *httpgrpc.HTTPRequest) (*httpgrpc.HTTPResponse, error)
}
func NewHandler ¶
func NewHandler(h http.Handler) GRPCHandler
type GRPCRoundTripper ¶
type GRPCRoundTripper interface {
RoundTripGRPC(ctx context.Context, req *httpgrpc.HTTPRequest) (*httpgrpc.HTTPResponse, error)
}
Click to show internal directories.
Click to hide internal directories.