Documentation ¶
Overview ¶
Package greetpb is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterGreetServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn grpc.ClientConnInterface) error
- func RegisterGreetServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GreetServiceClient) error
- func RegisterGreetServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterGreetServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GreetServiceServer) error
- func RegisterGreetServiceServer(s grpc.ServiceRegistrar, srv GreetServiceServer)
- type GreetRequest
- type GreetResponse
- type GreetServiceClient
- type GreetServiceServer
- type Greeting
- type UnimplementedGreetServiceServer
- type UnsafeGreetServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_greet_proto protoreflect.FileDescriptor
var GreetService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "GreetService", HandlerType: (*GreetServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Greet", Handler: _GreetService_Greet_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "greet.proto", }
GreetService_ServiceDesc is the grpc.ServiceDesc for GreetService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterGreetServiceHandler ¶ added in v0.0.16
func RegisterGreetServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn grpc.ClientConnInterface) error
RegisterGreetServiceHandler registers the http handlers for service GreetService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterGreetServiceHandlerClient ¶ added in v0.0.16
func RegisterGreetServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GreetServiceClient) error
RegisterGreetServiceHandlerClient registers the http handlers for service GreetService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "GreetServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "GreetServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "GreetServiceClient" to call the correct interceptors.
func RegisterGreetServiceHandlerFromEndpoint ¶ added in v0.0.16
func RegisterGreetServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterGreetServiceHandlerFromEndpoint is same as RegisterGreetServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterGreetServiceHandlerServer ¶ added in v0.0.16
func RegisterGreetServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GreetServiceServer) error
RegisterGreetServiceHandlerServer registers the http handlers for service GreetService to "mux". UnaryRPC :call GreetServiceServer 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 RegisterGreetServiceHandlerFromEndpoint instead.
func RegisterGreetServiceServer ¶
func RegisterGreetServiceServer(s grpc.ServiceRegistrar, srv GreetServiceServer)
Types ¶
type GreetRequest ¶
type GreetRequest struct { Greeting *Greeting `protobuf:"bytes,1,opt,name=greeting,proto3" json:"greeting,omitempty"` // contains filtered or unexported fields }
func (*GreetRequest) Descriptor
deprecated
func (*GreetRequest) Descriptor() ([]byte, []int)
Deprecated: Use GreetRequest.ProtoReflect.Descriptor instead.
func (*GreetRequest) GetGreeting ¶
func (x *GreetRequest) GetGreeting() *Greeting
func (*GreetRequest) ProtoMessage ¶
func (*GreetRequest) ProtoMessage()
func (*GreetRequest) ProtoReflect ¶
func (x *GreetRequest) ProtoReflect() protoreflect.Message
func (*GreetRequest) Reset ¶
func (x *GreetRequest) Reset()
func (*GreetRequest) String ¶
func (x *GreetRequest) String() string
type GreetResponse ¶
type GreetResponse struct { Result string `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"` // contains filtered or unexported fields }
func (*GreetResponse) Descriptor
deprecated
func (*GreetResponse) Descriptor() ([]byte, []int)
Deprecated: Use GreetResponse.ProtoReflect.Descriptor instead.
func (*GreetResponse) GetResult ¶
func (x *GreetResponse) GetResult() string
func (*GreetResponse) ProtoMessage ¶
func (*GreetResponse) ProtoMessage()
func (*GreetResponse) ProtoReflect ¶
func (x *GreetResponse) ProtoReflect() protoreflect.Message
func (*GreetResponse) Reset ¶
func (x *GreetResponse) Reset()
func (*GreetResponse) String ¶
func (x *GreetResponse) String() string
type GreetServiceClient ¶
type GreetServiceClient interface { //Unary Greet(ctx context.Context, in *GreetRequest, opts ...grpc.CallOption) (*GreetResponse, error) }
GreetServiceClient is the client API for GreetService 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 NewGreetServiceClient ¶
func NewGreetServiceClient(cc grpc.ClientConnInterface) GreetServiceClient
type GreetServiceServer ¶
type GreetServiceServer interface { //Unary Greet(context.Context, *GreetRequest) (*GreetResponse, error) // contains filtered or unexported methods }
GreetServiceServer is the server API for GreetService service. All implementations must embed UnimplementedGreetServiceServer for forward compatibility
type Greeting ¶
type Greeting struct { FirstName string `protobuf:"bytes,1,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"` LastName string `protobuf:"bytes,2,opt,name=last_name,json=lastName,proto3" json:"last_name,omitempty"` // contains filtered or unexported fields }
func (*Greeting) Descriptor
deprecated
func (*Greeting) GetFirstName ¶
func (*Greeting) GetLastName ¶
func (*Greeting) ProtoMessage ¶
func (*Greeting) ProtoMessage()
func (*Greeting) ProtoReflect ¶
func (x *Greeting) ProtoReflect() protoreflect.Message
type UnimplementedGreetServiceServer ¶
type UnimplementedGreetServiceServer struct { }
UnimplementedGreetServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedGreetServiceServer) Greet ¶
func (UnimplementedGreetServiceServer) Greet(context.Context, *GreetRequest) (*GreetResponse, error)
type UnsafeGreetServiceServer ¶
type UnsafeGreetServiceServer interface {
// contains filtered or unexported methods
}
UnsafeGreetServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to GreetServiceServer will result in compilation errors.