protooptions

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2022 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package protooptions is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_testing_options_v1_service_proto protoreflect.FileDescriptor
View Source
var TestService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "testing.options.v1.TestService",
	HandlerType: (*TestServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "TestMethod",
			Handler:    _TestService_TestMethod_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "testing/options/v1/service.proto",
}

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

Functions

func RegisterTestServiceHandler

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

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

func RegisterTestServiceHandlerClient

func RegisterTestServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TestServiceClient) error

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

func RegisterTestServiceHandlerFromEndpoint

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

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

func RegisterTestServiceHandlerServer

func RegisterTestServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TestServiceServer) error

RegisterTestServiceHandlerServer registers the http handlers for service TestService to "mux". UnaryRPC :call TestServiceServer 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 RegisterTestServiceHandlerFromEndpoint instead.

func RegisterTestServiceServer

func RegisterTestServiceServer(s grpc.ServiceRegistrar, srv TestServiceServer)

Types

type TestMethodRequest

type TestMethodRequest struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

The request message.

func (*TestMethodRequest) Descriptor deprecated

func (*TestMethodRequest) Descriptor() ([]byte, []int)

Deprecated: Use TestMethodRequest.ProtoReflect.Descriptor instead.

func (*TestMethodRequest) GetId

func (x *TestMethodRequest) GetId() string

func (*TestMethodRequest) ProtoMessage

func (*TestMethodRequest) ProtoMessage()

func (*TestMethodRequest) ProtoReflect

func (x *TestMethodRequest) ProtoReflect() protoreflect.Message

func (*TestMethodRequest) Reset

func (x *TestMethodRequest) Reset()

func (*TestMethodRequest) String

func (x *TestMethodRequest) String() string

type TestMethodResponse

type TestMethodResponse struct {
	Item string `protobuf:"bytes,1,opt,name=item,proto3" json:"item,omitempty"`
	// contains filtered or unexported fields
}

The response message.

func (*TestMethodResponse) Descriptor deprecated

func (*TestMethodResponse) Descriptor() ([]byte, []int)

Deprecated: Use TestMethodResponse.ProtoReflect.Descriptor instead.

func (*TestMethodResponse) GetItem

func (x *TestMethodResponse) GetItem() string

func (*TestMethodResponse) ProtoMessage

func (*TestMethodResponse) ProtoMessage()

func (*TestMethodResponse) ProtoReflect

func (x *TestMethodResponse) ProtoReflect() protoreflect.Message

func (*TestMethodResponse) Reset

func (x *TestMethodResponse) Reset()

func (*TestMethodResponse) String

func (x *TestMethodResponse) String() string

type TestServiceClient

type TestServiceClient interface {
	TestMethod(ctx context.Context, in *TestMethodRequest, opts ...grpc.CallOption) (*TestMethodResponse, error)
}

TestServiceClient is the client API for TestService 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 TestServiceServer

type TestServiceServer interface {
	TestMethod(context.Context, *TestMethodRequest) (*TestMethodResponse, error)
	// contains filtered or unexported methods
}

TestServiceServer is the server API for TestService service. All implementations must embed UnimplementedTestServiceServer for forward compatibility

type UnimplementedTestServiceServer

type UnimplementedTestServiceServer struct {
}

UnimplementedTestServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedTestServiceServer) TestMethod

type UnsafeTestServiceServer

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

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

Jump to

Keyboard shortcuts

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