Documentation ¶
Overview ¶
Package helloworld is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterGreeterServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterGreeterServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GreeterServiceClient) error
- func RegisterGreeterServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterGreeterServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GreeterServiceServer) error
- func RegisterGreeterServiceServer(s grpc.ServiceRegistrar, srv GreeterServiceServer)
- type GreeterServiceClient
- type GreeterServiceSayHelloRequest
- func (*GreeterServiceSayHelloRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GreeterServiceSayHelloRequest) GetName() string
- func (*GreeterServiceSayHelloRequest) ProtoMessage()
- func (x *GreeterServiceSayHelloRequest) ProtoReflect() protoreflect.Message
- func (x *GreeterServiceSayHelloRequest) Reset()
- func (x *GreeterServiceSayHelloRequest) String() string
- type GreeterServiceSayHelloResponse
- func (*GreeterServiceSayHelloResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GreeterServiceSayHelloResponse) GetMessage() string
- func (*GreeterServiceSayHelloResponse) ProtoMessage()
- func (x *GreeterServiceSayHelloResponse) ProtoReflect() protoreflect.Message
- func (x *GreeterServiceSayHelloResponse) Reset()
- func (x *GreeterServiceSayHelloResponse) String() string
- type GreeterServiceServer
- type UnimplementedGreeterServiceServer
- type UnsafeGreeterServiceServer
Constants ¶
const (
GreeterService_SayHello_FullMethodName = "/helloworld.v1.GreeterService/SayHello"
)
Variables ¶
var File_helloworld_v1_helloworld_proto protoreflect.FileDescriptor
var GreeterService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "helloworld.v1.GreeterService", HandlerType: (*GreeterServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SayHello", Handler: _GreeterService_SayHello_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "helloworld/v1/helloworld.proto", }
GreeterService_ServiceDesc is the grpc.ServiceDesc for GreeterService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterGreeterServiceHandler ¶
func RegisterGreeterServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterGreeterServiceHandler registers the http handlers for service GreeterService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterGreeterServiceHandlerClient ¶
func RegisterGreeterServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GreeterServiceClient) error
RegisterGreeterServiceHandlerClient registers the http handlers for service GreeterService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "GreeterServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "GreeterServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "GreeterServiceClient" to call the correct interceptors.
func RegisterGreeterServiceHandlerFromEndpoint ¶
func RegisterGreeterServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterGreeterServiceHandlerFromEndpoint is same as RegisterGreeterServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterGreeterServiceHandlerServer ¶
func RegisterGreeterServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GreeterServiceServer) error
RegisterGreeterServiceHandlerServer registers the http handlers for service GreeterService to "mux". UnaryRPC :call GreeterServiceServer 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 RegisterGreeterServiceHandlerFromEndpoint instead.
func RegisterGreeterServiceServer ¶
func RegisterGreeterServiceServer(s grpc.ServiceRegistrar, srv GreeterServiceServer)
Types ¶
type GreeterServiceClient ¶
type GreeterServiceClient interface {
SayHello(ctx context.Context, in *GreeterServiceSayHelloRequest, opts ...grpc.CallOption) (*GreeterServiceSayHelloResponse, error)
}
GreeterServiceClient is the client API for GreeterService 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 NewGreeterServiceClient ¶
func NewGreeterServiceClient(cc grpc.ClientConnInterface) GreeterServiceClient
type GreeterServiceSayHelloRequest ¶
type GreeterServiceSayHelloRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*GreeterServiceSayHelloRequest) Descriptor
deprecated
func (*GreeterServiceSayHelloRequest) Descriptor() ([]byte, []int)
Deprecated: Use GreeterServiceSayHelloRequest.ProtoReflect.Descriptor instead.
func (*GreeterServiceSayHelloRequest) GetName ¶
func (x *GreeterServiceSayHelloRequest) GetName() string
func (*GreeterServiceSayHelloRequest) ProtoMessage ¶
func (*GreeterServiceSayHelloRequest) ProtoMessage()
func (*GreeterServiceSayHelloRequest) ProtoReflect ¶
func (x *GreeterServiceSayHelloRequest) ProtoReflect() protoreflect.Message
func (*GreeterServiceSayHelloRequest) Reset ¶
func (x *GreeterServiceSayHelloRequest) Reset()
func (*GreeterServiceSayHelloRequest) String ¶
func (x *GreeterServiceSayHelloRequest) String() string
type GreeterServiceSayHelloResponse ¶
type GreeterServiceSayHelloResponse struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*GreeterServiceSayHelloResponse) Descriptor
deprecated
func (*GreeterServiceSayHelloResponse) Descriptor() ([]byte, []int)
Deprecated: Use GreeterServiceSayHelloResponse.ProtoReflect.Descriptor instead.
func (*GreeterServiceSayHelloResponse) GetMessage ¶
func (x *GreeterServiceSayHelloResponse) GetMessage() string
func (*GreeterServiceSayHelloResponse) ProtoMessage ¶
func (*GreeterServiceSayHelloResponse) ProtoMessage()
func (*GreeterServiceSayHelloResponse) ProtoReflect ¶
func (x *GreeterServiceSayHelloResponse) ProtoReflect() protoreflect.Message
func (*GreeterServiceSayHelloResponse) Reset ¶
func (x *GreeterServiceSayHelloResponse) Reset()
func (*GreeterServiceSayHelloResponse) String ¶
func (x *GreeterServiceSayHelloResponse) String() string
type GreeterServiceServer ¶
type GreeterServiceServer interface { SayHello(context.Context, *GreeterServiceSayHelloRequest) (*GreeterServiceSayHelloResponse, error) // contains filtered or unexported methods }
GreeterServiceServer is the server API for GreeterService service. All implementations must embed UnimplementedGreeterServiceServer for forward compatibility
type UnimplementedGreeterServiceServer ¶
type UnimplementedGreeterServiceServer struct { }
UnimplementedGreeterServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedGreeterServiceServer) SayHello ¶
func (UnimplementedGreeterServiceServer) SayHello(context.Context, *GreeterServiceSayHelloRequest) (*GreeterServiceSayHelloResponse, error)
type UnsafeGreeterServiceServer ¶
type UnsafeGreeterServiceServer interface {
// contains filtered or unexported methods
}
UnsafeGreeterServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to GreeterServiceServer will result in compilation errors.