Documentation
¶
Index ¶
- Variables
- func RegisterGreetServiceServer(s grpc.ServiceRegistrar, srv GreetServiceServer)
- type GreetServiceClient
- type GreetServiceServer
- type GreetService_SayHelloBiDiStreamClient
- type GreetService_SayHelloBiDiStreamServer
- type GreetService_SayHelloClientStreamClient
- type GreetService_SayHelloClientStreamServer
- type GreetService_SayHelloStreamClient
- type GreetService_SayHelloStreamServer
- type HelloRequest
- type HelloResponse
- type MessagesList
- type NamesList
- type NoParam
- type UnimplementedGreetServiceServer
- func (UnimplementedGreetServiceServer) SayHello(context.Context, *NoParam) (*HelloResponse, error)
- func (UnimplementedGreetServiceServer) SayHelloBiDiStream(GreetService_SayHelloBiDiStreamServer) error
- func (UnimplementedGreetServiceServer) SayHelloClientStream(GreetService_SayHelloClientStreamServer) error
- func (UnimplementedGreetServiceServer) SayHelloStream(*NamesList, GreetService_SayHelloStreamServer) error
- type UnsafeGreetServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_proto_greet_proto protoreflect.FileDescriptor
var GreetService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "greet_service.GreetService", HandlerType: (*GreetServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SayHello", Handler: _GreetService_SayHello_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "SayHelloStream", Handler: _GreetService_SayHelloStream_Handler, ServerStreams: true, }, { StreamName: "SayHelloClientStream", Handler: _GreetService_SayHelloClientStream_Handler, ClientStreams: true, }, { StreamName: "SayHelloBiDiStream", Handler: _GreetService_SayHelloBiDiStream_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "proto/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 RegisterGreetServiceServer ¶
func RegisterGreetServiceServer(s grpc.ServiceRegistrar, srv GreetServiceServer)
Types ¶
type GreetServiceClient ¶
type GreetServiceClient interface {
// uniary api
SayHello(ctx context.Context, in *NoParam, opts ...grpc.CallOption) (*HelloResponse, error)
// server streaming api
// stream is used to return multiple responses
SayHelloStream(ctx context.Context, in *NamesList, opts ...grpc.CallOption) (GreetService_SayHelloStreamClient, error)
// client streaming api
SayHelloClientStream(ctx context.Context, opts ...grpc.CallOption) (GreetService_SayHelloClientStreamClient, error)
// bi-directional streaming api
// most commonly used
SayHelloBiDiStream(ctx context.Context, opts ...grpc.CallOption) (GreetService_SayHelloBiDiStreamClient, 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 {
// uniary api
SayHello(context.Context, *NoParam) (*HelloResponse, error)
// server streaming api
// stream is used to return multiple responses
SayHelloStream(*NamesList, GreetService_SayHelloStreamServer) error
// client streaming api
SayHelloClientStream(GreetService_SayHelloClientStreamServer) error
// bi-directional streaming api
// most commonly used
SayHelloBiDiStream(GreetService_SayHelloBiDiStreamServer) error
// contains filtered or unexported methods
}
GreetServiceServer is the server API for GreetService service. All implementations must embed UnimplementedGreetServiceServer for forward compatibility
type GreetService_SayHelloBiDiStreamClient ¶
type GreetService_SayHelloBiDiStreamClient interface {
Send(*HelloRequest) error
Recv() (*HelloResponse, error)
grpc.ClientStream
}
type GreetService_SayHelloBiDiStreamServer ¶
type GreetService_SayHelloBiDiStreamServer interface {
Send(*HelloResponse) error
Recv() (*HelloRequest, error)
grpc.ServerStream
}
type GreetService_SayHelloClientStreamClient ¶
type GreetService_SayHelloClientStreamClient interface {
Send(*HelloRequest) error
CloseAndRecv() (*MessagesList, error)
grpc.ClientStream
}
type GreetService_SayHelloClientStreamServer ¶
type GreetService_SayHelloClientStreamServer interface {
SendAndClose(*MessagesList) error
Recv() (*HelloRequest, error)
grpc.ServerStream
}
type GreetService_SayHelloStreamClient ¶
type GreetService_SayHelloStreamClient interface {
Recv() (*HelloResponse, error)
grpc.ClientStream
}
type GreetService_SayHelloStreamServer ¶
type GreetService_SayHelloStreamServer interface {
Send(*HelloResponse) error
grpc.ServerStream
}
type HelloRequest ¶
type HelloRequest struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// contains filtered or unexported fields
}
func (*HelloRequest) Descriptor
deprecated
func (*HelloRequest) Descriptor() ([]byte, []int)
Deprecated: Use HelloRequest.ProtoReflect.Descriptor instead.
func (*HelloRequest) GetName ¶
func (x *HelloRequest) GetName() string
func (*HelloRequest) ProtoMessage ¶
func (*HelloRequest) ProtoMessage()
func (*HelloRequest) ProtoReflect ¶
func (x *HelloRequest) ProtoReflect() protoreflect.Message
func (*HelloRequest) Reset ¶
func (x *HelloRequest) Reset()
func (*HelloRequest) String ¶
func (x *HelloRequest) String() string
type HelloResponse ¶
type HelloResponse struct {
Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
// contains filtered or unexported fields
}
func (*HelloResponse) Descriptor
deprecated
func (*HelloResponse) Descriptor() ([]byte, []int)
Deprecated: Use HelloResponse.ProtoReflect.Descriptor instead.
func (*HelloResponse) GetMessage ¶
func (x *HelloResponse) GetMessage() string
func (*HelloResponse) ProtoMessage ¶
func (*HelloResponse) ProtoMessage()
func (*HelloResponse) ProtoReflect ¶
func (x *HelloResponse) ProtoReflect() protoreflect.Message
func (*HelloResponse) Reset ¶
func (x *HelloResponse) Reset()
func (*HelloResponse) String ¶
func (x *HelloResponse) String() string
type MessagesList ¶
type MessagesList struct {
Messages []string `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"`
// contains filtered or unexported fields
}
func (*MessagesList) Descriptor
deprecated
func (*MessagesList) Descriptor() ([]byte, []int)
Deprecated: Use MessagesList.ProtoReflect.Descriptor instead.
func (*MessagesList) GetMessages ¶
func (x *MessagesList) GetMessages() []string
func (*MessagesList) ProtoMessage ¶
func (*MessagesList) ProtoMessage()
func (*MessagesList) ProtoReflect ¶
func (x *MessagesList) ProtoReflect() protoreflect.Message
func (*MessagesList) Reset ¶
func (x *MessagesList) Reset()
func (*MessagesList) String ¶
func (x *MessagesList) String() string
type NamesList ¶
type NamesList struct {
// use repeated to define a list
Names []string `protobuf:"bytes,1,rep,name=names,proto3" json:"names,omitempty"`
// contains filtered or unexported fields
}
func (*NamesList) Descriptor
deprecated
func (*NamesList) ProtoMessage ¶
func (*NamesList) ProtoMessage()
func (*NamesList) ProtoReflect ¶
func (x *NamesList) ProtoReflect() protoreflect.Message
type NoParam ¶
type NoParam struct {
// contains filtered or unexported fields
}
func (*NoParam) Descriptor
deprecated
func (*NoParam) ProtoMessage ¶
func (*NoParam) ProtoMessage()
func (*NoParam) ProtoReflect ¶
func (x *NoParam) ProtoReflect() protoreflect.Message
type UnimplementedGreetServiceServer ¶
type UnimplementedGreetServiceServer struct {
}
UnimplementedGreetServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedGreetServiceServer) SayHello ¶
func (UnimplementedGreetServiceServer) SayHello(context.Context, *NoParam) (*HelloResponse, error)
func (UnimplementedGreetServiceServer) SayHelloBiDiStream ¶
func (UnimplementedGreetServiceServer) SayHelloBiDiStream(GreetService_SayHelloBiDiStreamServer) error
func (UnimplementedGreetServiceServer) SayHelloClientStream ¶
func (UnimplementedGreetServiceServer) SayHelloClientStream(GreetService_SayHelloClientStreamServer) error
func (UnimplementedGreetServiceServer) SayHelloStream ¶
func (UnimplementedGreetServiceServer) SayHelloStream(*NamesList, GreetService_SayHelloStreamServer) 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.