webapp

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package webapp is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	Pattern_WebAppService_File_0  = pattern_WebAppService_File_0
	Pattern_WebAppService_Proxy_1 = pattern_WebAppService_File_1
)

export some private fields

View Source
var File_webapp_proto protoreflect.FileDescriptor
View Source
var WebAppService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "sole.api.v1.webapp.WebAppService",
	HandlerType: (*WebAppServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "File",
			Handler:    _WebAppService_File_Handler,
		},
		{
			MethodName: "Proxy",
			Handler:    _WebAppService_Proxy_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "webapp.proto",
}

WebAppService_ServiceDesc is the grpc.ServiceDesc for WebAppService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterWebAppServiceHandler

func RegisterWebAppServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterWebAppServiceHandler registers the http handlers for service WebAppService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterWebAppServiceHandlerClient

func RegisterWebAppServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client WebAppServiceClient) error

RegisterWebAppServiceHandlerClient registers the http handlers for service WebAppService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "WebAppServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "WebAppServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "WebAppServiceClient" to call the correct interceptors.

func RegisterWebAppServiceHandlerFromEndpoint

func RegisterWebAppServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterWebAppServiceHandlerFromEndpoint is same as RegisterWebAppServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterWebAppServiceHandlerServer

func RegisterWebAppServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server WebAppServiceServer) error

RegisterWebAppServiceHandlerServer registers the http handlers for service WebAppService to "mux". UnaryRPC :call WebAppServiceServer 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 RegisterWebAppServiceHandlerFromEndpoint instead.

func RegisterWebAppServiceServer

func RegisterWebAppServiceServer(s grpc.ServiceRegistrar, srv WebAppServiceServer)

Types

type UnimplementedWebAppServiceServer

type UnimplementedWebAppServiceServer struct {
}

UnimplementedWebAppServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedWebAppServiceServer) File

func (UnimplementedWebAppServiceServer) Proxy

type UnsafeWebAppServiceServer

type UnsafeWebAppServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeWebAppServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to WebAppServiceServer will result in compilation errors.

type WebAppServiceClient

type WebAppServiceClient interface {
	// 静态文件下载
	File(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*httpbody.HttpBody, error)
	Proxy(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*httpbody.HttpBody, error)
}

WebAppServiceClient is the client API for WebAppService 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 WebAppServiceServer

type WebAppServiceServer interface {
	// 静态文件下载
	File(context.Context, *emptypb.Empty) (*httpbody.HttpBody, error)
	Proxy(context.Context, *emptypb.Empty) (*httpbody.HttpBody, error)
	// contains filtered or unexported methods
}

WebAppServiceServer is the server API for WebAppService service. All implementations must embed UnimplementedWebAppServiceServer for forward compatibility

Jump to

Keyboard shortcuts

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