Documentation
¶
Index ¶
- Constants
- func NewHttpProxyServiceHandler(svc HttpProxyServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
- type HttpProxyServiceClient
- type HttpProxyServiceHandler
- type UnimplementedHttpProxyServiceHandler
- func (UnimplementedHttpProxyServiceHandler) FetchRequest(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v2.HttpHandlerRequest], error)
- func (UnimplementedHttpProxyServiceHandler) FetchRequests(context.Context, *connect.Request[v2.HttpHandlerFetchRequest]) (*connect.Response[v2.HttpHandlerRequests], error)
- func (UnimplementedHttpProxyServiceHandler) HttpHandler(context.Context, *connect.Request[v2.HttpHandlerRequest]) (*connect.Response[v2.HttpHandlerResponse], error)
- func (UnimplementedHttpProxyServiceHandler) HttpResponse(context.Context, *connect.Request[v2.HttpHandlerResponse]) (*connect.Response[emptypb.Empty], error)
Constants ¶
const ( // HttpProxyServiceFetchRequestProcedure is the fully-qualified name of the HttpProxyService's // FetchRequest RPC. HttpProxyServiceFetchRequestProcedure = "/http.v2.HttpProxyService/FetchRequest" // HttpProxyServiceFetchRequestsProcedure is the fully-qualified name of the HttpProxyService's // FetchRequests RPC. HttpProxyServiceFetchRequestsProcedure = "/http.v2.HttpProxyService/FetchRequests" // HttpProxyServiceHttpHandlerProcedure is the fully-qualified name of the HttpProxyService's // HttpHandler RPC. HttpProxyServiceHttpHandlerProcedure = "/http.v2.HttpProxyService/HttpHandler" // HttpProxyServiceHttpResponseProcedure is the fully-qualified name of the HttpProxyService's // HttpResponse RPC. HttpProxyServiceHttpResponseProcedure = "/http.v2.HttpProxyService/HttpResponse" )
These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.
const (
// HttpProxyServiceName is the fully-qualified name of the HttpProxyService service.
HttpProxyServiceName = "http.v2.HttpProxyService"
)
Variables ¶
This section is empty.
Functions ¶
func NewHttpProxyServiceHandler ¶
func NewHttpProxyServiceHandler(svc HttpProxyServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
NewHttpProxyServiceHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.
By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.
Types ¶
type HttpProxyServiceClient ¶
type HttpProxyServiceClient interface {
FetchRequest(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v2.HttpHandlerRequest], error)
FetchRequests(context.Context, *connect.Request[v2.HttpHandlerFetchRequest]) (*connect.Response[v2.HttpHandlerRequests], error)
HttpHandler(context.Context, *connect.Request[v2.HttpHandlerRequest]) (*connect.Response[v2.HttpHandlerResponse], error)
HttpResponse(context.Context, *connect.Request[v2.HttpHandlerResponse]) (*connect.Response[emptypb.Empty], error)
}
HttpProxyServiceClient is a client for the http.v2.HttpProxyService service.
func NewHttpProxyServiceClient ¶
func NewHttpProxyServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) HttpProxyServiceClient
NewHttpProxyServiceClient constructs a client for the http.v2.HttpProxyService service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.
The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).
type HttpProxyServiceHandler ¶
type HttpProxyServiceHandler interface {
FetchRequest(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v2.HttpHandlerRequest], error)
FetchRequests(context.Context, *connect.Request[v2.HttpHandlerFetchRequest]) (*connect.Response[v2.HttpHandlerRequests], error)
HttpHandler(context.Context, *connect.Request[v2.HttpHandlerRequest]) (*connect.Response[v2.HttpHandlerResponse], error)
HttpResponse(context.Context, *connect.Request[v2.HttpHandlerResponse]) (*connect.Response[emptypb.Empty], error)
}
HttpProxyServiceHandler is an implementation of the http.v2.HttpProxyService service.
type UnimplementedHttpProxyServiceHandler ¶
type UnimplementedHttpProxyServiceHandler struct{}
UnimplementedHttpProxyServiceHandler returns CodeUnimplemented from all methods.
func (UnimplementedHttpProxyServiceHandler) FetchRequest ¶
func (UnimplementedHttpProxyServiceHandler) FetchRequests ¶
func (UnimplementedHttpProxyServiceHandler) FetchRequests(context.Context, *connect.Request[v2.HttpHandlerFetchRequest]) (*connect.Response[v2.HttpHandlerRequests], error)
func (UnimplementedHttpProxyServiceHandler) HttpHandler ¶
func (UnimplementedHttpProxyServiceHandler) HttpHandler(context.Context, *connect.Request[v2.HttpHandlerRequest]) (*connect.Response[v2.HttpHandlerResponse], error)