http_body_example

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: MIT Imports: 29 Imported by: 0

Documentation

Overview

Package http_body_example is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
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

View Source
var File_api_v1_http_body_example_http_example_body_proto protoreflect.FileDescriptor
View Source
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.

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) Download

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.

Jump to

Keyboard shortcuts

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