v1

package
v0.1.119 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var EchoService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "proto.rpc.examples.echo.v1.EchoService",
	HandlerType: (*EchoServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Echo",
			Handler:    _EchoService_Echo_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "EchoMultiple",
			Handler:       _EchoService_EchoMultiple_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "EchoBiDi",
			Handler:       _EchoService_EchoBiDi_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "proto/rpc/examples/echo/v1/echo.proto",
}

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

View Source
var File_proto_rpc_examples_echo_v1_echo_proto protoreflect.FileDescriptor

Functions

func RegisterEchoServiceHandler

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

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

func RegisterEchoServiceHandlerClient

func RegisterEchoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EchoServiceClient) error

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

func RegisterEchoServiceHandlerFromEndpoint

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

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

func RegisterEchoServiceHandlerServer

func RegisterEchoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EchoServiceServer) error

RegisterEchoServiceHandlerServer registers the http handlers for service EchoService to "mux". UnaryRPC :call EchoServiceServer 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 RegisterEchoServiceHandlerFromEndpoint instead.

func RegisterEchoServiceServer

func RegisterEchoServiceServer(s grpc.ServiceRegistrar, srv EchoServiceServer)

Types

type EchoBiDiRequest

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

func (*EchoBiDiRequest) Descriptor deprecated

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

Deprecated: Use EchoBiDiRequest.ProtoReflect.Descriptor instead.

func (*EchoBiDiRequest) GetMessage

func (x *EchoBiDiRequest) GetMessage() string

func (*EchoBiDiRequest) ProtoMessage

func (*EchoBiDiRequest) ProtoMessage()

func (*EchoBiDiRequest) ProtoReflect

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

func (*EchoBiDiRequest) Reset

func (x *EchoBiDiRequest) Reset()

func (*EchoBiDiRequest) String

func (x *EchoBiDiRequest) String() string

type EchoBiDiResponse

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

func (*EchoBiDiResponse) Descriptor deprecated

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

Deprecated: Use EchoBiDiResponse.ProtoReflect.Descriptor instead.

func (*EchoBiDiResponse) GetMessage

func (x *EchoBiDiResponse) GetMessage() string

func (*EchoBiDiResponse) ProtoMessage

func (*EchoBiDiResponse) ProtoMessage()

func (*EchoBiDiResponse) ProtoReflect

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

func (*EchoBiDiResponse) Reset

func (x *EchoBiDiResponse) Reset()

func (*EchoBiDiResponse) String

func (x *EchoBiDiResponse) String() string

type EchoMultipleRequest

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

func (*EchoMultipleRequest) Descriptor deprecated

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

Deprecated: Use EchoMultipleRequest.ProtoReflect.Descriptor instead.

func (*EchoMultipleRequest) GetMessage

func (x *EchoMultipleRequest) GetMessage() string

func (*EchoMultipleRequest) ProtoMessage

func (*EchoMultipleRequest) ProtoMessage()

func (*EchoMultipleRequest) ProtoReflect

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

func (*EchoMultipleRequest) Reset

func (x *EchoMultipleRequest) Reset()

func (*EchoMultipleRequest) String

func (x *EchoMultipleRequest) String() string

type EchoMultipleResponse

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

func (*EchoMultipleResponse) Descriptor deprecated

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

Deprecated: Use EchoMultipleResponse.ProtoReflect.Descriptor instead.

func (*EchoMultipleResponse) GetMessage

func (x *EchoMultipleResponse) GetMessage() string

func (*EchoMultipleResponse) ProtoMessage

func (*EchoMultipleResponse) ProtoMessage()

func (*EchoMultipleResponse) ProtoReflect

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

func (*EchoMultipleResponse) Reset

func (x *EchoMultipleResponse) Reset()

func (*EchoMultipleResponse) String

func (x *EchoMultipleResponse) String() string

type EchoRequest

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

func (*EchoRequest) Descriptor deprecated

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

Deprecated: Use EchoRequest.ProtoReflect.Descriptor instead.

func (*EchoRequest) GetMessage

func (x *EchoRequest) GetMessage() string

func (*EchoRequest) ProtoMessage

func (*EchoRequest) ProtoMessage()

func (*EchoRequest) ProtoReflect

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

func (*EchoRequest) Reset

func (x *EchoRequest) Reset()

func (*EchoRequest) String

func (x *EchoRequest) String() string

type EchoResponse

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

func (*EchoResponse) Descriptor deprecated

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

Deprecated: Use EchoResponse.ProtoReflect.Descriptor instead.

func (*EchoResponse) GetMessage

func (x *EchoResponse) GetMessage() string

func (*EchoResponse) ProtoMessage

func (*EchoResponse) ProtoMessage()

func (*EchoResponse) ProtoReflect

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

func (*EchoResponse) Reset

func (x *EchoResponse) Reset()

func (*EchoResponse) String

func (x *EchoResponse) String() string

type EchoServiceClient

type EchoServiceClient interface {
	Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error)
	EchoMultiple(ctx context.Context, in *EchoMultipleRequest, opts ...grpc.CallOption) (EchoService_EchoMultipleClient, error)
	EchoBiDi(ctx context.Context, opts ...grpc.CallOption) (EchoService_EchoBiDiClient, error)
}

EchoServiceClient is the client API for EchoService 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 EchoServiceServer

type EchoServiceServer interface {
	Echo(context.Context, *EchoRequest) (*EchoResponse, error)
	EchoMultiple(*EchoMultipleRequest, EchoService_EchoMultipleServer) error
	EchoBiDi(EchoService_EchoBiDiServer) error
	// contains filtered or unexported methods
}

EchoServiceServer is the server API for EchoService service. All implementations must embed UnimplementedEchoServiceServer for forward compatibility

type EchoService_EchoBiDiClient

type EchoService_EchoBiDiClient interface {
	Send(*EchoBiDiRequest) error
	Recv() (*EchoBiDiResponse, error)
	grpc.ClientStream
}

type EchoService_EchoBiDiServer

type EchoService_EchoBiDiServer interface {
	Send(*EchoBiDiResponse) error
	Recv() (*EchoBiDiRequest, error)
	grpc.ServerStream
}

type EchoService_EchoMultipleClient

type EchoService_EchoMultipleClient interface {
	Recv() (*EchoMultipleResponse, error)
	grpc.ClientStream
}

type EchoService_EchoMultipleServer

type EchoService_EchoMultipleServer interface {
	Send(*EchoMultipleResponse) error
	grpc.ServerStream
}

type UnimplementedEchoServiceServer

type UnimplementedEchoServiceServer struct {
}

UnimplementedEchoServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedEchoServiceServer) Echo

func (UnimplementedEchoServiceServer) EchoBiDi

func (UnimplementedEchoServiceServer) EchoMultiple

type UnsafeEchoServiceServer

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

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

Jump to

Keyboard shortcuts

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