Documentation ¶
Overview ¶
Package http_body_example is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterHttpBodyExampleServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterHttpBodyExampleServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, ...) error
- func RegisterHttpBodyExampleServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterHttpBodyExampleServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, ...) error
- func RegisterHttpBodyExampleServiceServer(s grpc.ServiceRegistrar, srv HttpBodyExampleServiceServer)
- type HttpBodyExampleServiceClient
- type HttpBodyExampleServiceServer
- type HttpBodyExampleService_DownloadClient
- type HttpBodyExampleService_DownloadServer
- type UnimplementedHttpBodyExampleServiceServer
- type UnsafeHttpBodyExampleServiceServer
Constants ¶
const ( HttpBodyExampleService_HelloWorld_FullMethodName = "/flamefatex.grpc_gateway_example.api.v1.http_body_example.HttpBodyExampleService/HelloWorld" HttpBodyExampleService_Download_FullMethodName = "/flamefatex.grpc_gateway_example.api.v1.http_body_example.HttpBodyExampleService/Download" )
Variables ¶
var File_api_v1_http_body_example_http_example_body_proto protoreflect.FileDescriptor
var HttpBodyExampleService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "flamefatex.grpc_gateway_example.api.v1.http_body_example.HttpBodyExampleService", HandlerType: (*HttpBodyExampleServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "HelloWorld", Handler: _HttpBodyExampleService_HelloWorld_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "Download", Handler: _HttpBodyExampleService_Download_Handler, ServerStreams: true, }, }, Metadata: "api/v1/http_body_example/http_example_body.proto", }
HttpBodyExampleService_ServiceDesc is the grpc.ServiceDesc for HttpBodyExampleService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterHttpBodyExampleServiceHandler ¶
func RegisterHttpBodyExampleServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterHttpBodyExampleServiceHandler registers the http handlers for service HttpBodyExampleService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterHttpBodyExampleServiceHandlerClient ¶
func RegisterHttpBodyExampleServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HttpBodyExampleServiceClient) error
RegisterHttpBodyExampleServiceHandlerClient registers the http handlers for service HttpBodyExampleService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "HttpBodyExampleServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "HttpBodyExampleServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "HttpBodyExampleServiceClient" to call the correct interceptors.
func RegisterHttpBodyExampleServiceHandlerFromEndpoint ¶
func RegisterHttpBodyExampleServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterHttpBodyExampleServiceHandlerFromEndpoint is same as RegisterHttpBodyExampleServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterHttpBodyExampleServiceHandlerServer ¶
func RegisterHttpBodyExampleServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server HttpBodyExampleServiceServer) error
RegisterHttpBodyExampleServiceHandlerServer registers the http handlers for service HttpBodyExampleService to "mux". UnaryRPC :call HttpBodyExampleServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterHttpBodyExampleServiceHandlerFromEndpoint instead.
func RegisterHttpBodyExampleServiceServer ¶
func RegisterHttpBodyExampleServiceServer(s grpc.ServiceRegistrar, srv HttpBodyExampleServiceServer)
Types ¶
type HttpBodyExampleServiceClient ¶
type HttpBodyExampleServiceClient interface { HelloWorld(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*httpbody.HttpBody, error) Download(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (HttpBodyExampleService_DownloadClient, error) }
HttpBodyExampleServiceClient is the client API for HttpBodyExampleService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewHttpBodyExampleServiceClient ¶
func NewHttpBodyExampleServiceClient(cc grpc.ClientConnInterface) HttpBodyExampleServiceClient
type HttpBodyExampleServiceServer ¶
type HttpBodyExampleServiceServer interface { HelloWorld(context.Context, *emptypb.Empty) (*httpbody.HttpBody, error) Download(*emptypb.Empty, HttpBodyExampleService_DownloadServer) error // contains filtered or unexported methods }
HttpBodyExampleServiceServer is the server API for HttpBodyExampleService service. All implementations must embed UnimplementedHttpBodyExampleServiceServer for forward compatibility
type HttpBodyExampleService_DownloadClient ¶
type HttpBodyExampleService_DownloadClient interface { Recv() (*httpbody.HttpBody, error) grpc.ClientStream }
type HttpBodyExampleService_DownloadServer ¶
type HttpBodyExampleService_DownloadServer interface { Send(*httpbody.HttpBody) error grpc.ServerStream }
type UnimplementedHttpBodyExampleServiceServer ¶
type UnimplementedHttpBodyExampleServiceServer struct { }
UnimplementedHttpBodyExampleServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedHttpBodyExampleServiceServer) HelloWorld ¶
type UnsafeHttpBodyExampleServiceServer ¶
type UnsafeHttpBodyExampleServiceServer interface {
// contains filtered or unexported methods
}
UnsafeHttpBodyExampleServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to HttpBodyExampleServiceServer will result in compilation errors.