Documentation ¶
Index ¶
- Variables
- func CallGreet(ctx context.Context, client GreetServiceClient) (err error)
- func CallGreetStream(ctx context.Context, client GreetServiceClient) (err error)
- func CallHello(ctx context.Context, client GreetServiceClient) (err error)
- func CallMultiply(ctx context.Context, client GreetServiceClient) (err error)
- func CallUpload(ctx context.Context, client GreetServiceClient) (err error)
- func RegisterGreetServiceServer(s grpc.ServiceRegistrar, srv GreetServiceServer)
- type File
- type GreetClient
- func (client *GreetClient) Greet(ctx context.Context) (err error)
- func (client *GreetClient) GreetStream(ctx context.Context) (err error)
- func (client *GreetClient) Hello(ctx context.Context) (err error)
- func (client *GreetClient) Multiply(ctx context.Context) (err error)
- func (client *GreetClient) Upload(ctx context.Context) (err error)
- type GreetRequest
- type GreetResponse
- type GreetServiceClient
- type GreetServiceServer
- type GreetService_GreetStreamClient
- type GreetService_GreetStreamServer
- type GreetService_HelloClient
- type GreetService_HelloServer
- type GreetService_MultiplyClient
- type GreetService_MultiplyServer
- type GreetService_UploadClient
- type GreetService_UploadServer
- type Greeting
- type Msg
- type Number
- type Server
- func (srv *Server) Greet(ctx context.Context, req *GreetRequest) (res *GreetResponse, err error)
- func (srv *Server) GreetStream(req *GreetRequest, stream GreetService_GreetStreamServer) (err error)
- func (src *Server) Hello(stream GreetService_HelloServer) (err error)
- func (srv *Server) Multiply(stream GreetService_MultiplyServer) (err error)
- func (src *Server) Upload(stream GreetService_UploadServer) (err error)
- type UnimplementedGreetServiceServer
- func (UnimplementedGreetServiceServer) Greet(context.Context, *GreetRequest) (*GreetResponse, error)
- func (UnimplementedGreetServiceServer) GreetStream(*GreetRequest, GreetService_GreetStreamServer) error
- func (UnimplementedGreetServiceServer) Hello(GreetService_HelloServer) error
- func (UnimplementedGreetServiceServer) Multiply(GreetService_MultiplyServer) error
- func (UnimplementedGreetServiceServer) Upload(GreetService_UploadServer) error
- type UnsafeGreetServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_pkg_greet_greet_proto protoreflect.FileDescriptor
var GreetService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "greet.GreetService", HandlerType: (*GreetServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Greet", Handler: _GreetService_Greet_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "GreetStream", Handler: _GreetService_GreetStream_Handler, ServerStreams: true, }, { StreamName: "Multiply", Handler: _GreetService_Multiply_Handler, ClientStreams: true, }, { StreamName: "Hello", Handler: _GreetService_Hello_Handler, ServerStreams: true, ClientStreams: true, }, { StreamName: "Upload", Handler: _GreetService_Upload_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "pkg/greet/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 CallGreetStream ¶
func CallGreetStream(ctx context.Context, client GreetServiceClient) (err error)
->, <---
func CallHello ¶
func CallHello(ctx context.Context, client GreetServiceClient) (err error)
->, <---
func CallMultiply ¶
func CallMultiply(ctx context.Context, client GreetServiceClient) (err error)
--->, <-
func CallUpload ¶
func CallUpload(ctx context.Context, client GreetServiceClient) (err error)
func RegisterGreetServiceServer ¶
func RegisterGreetServiceServer(s grpc.ServiceRegistrar, srv GreetServiceServer)
Types ¶
type File ¶
type File struct { Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"` Content []byte `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` // contains filtered or unexported fields }
func (*File) Descriptor
deprecated
func (*File) GetContent ¶
func (*File) ProtoMessage ¶
func (*File) ProtoMessage()
func (*File) ProtoReflect ¶
func (x *File) ProtoReflect() protoreflect.Message
type GreetClient ¶
type GreetClient struct {
// contains filtered or unexported fields
}
func NewGreetClient ¶
func NewGreetClient(conn *grpc.ClientConn) *GreetClient
func (*GreetClient) Greet ¶
func (client *GreetClient) Greet(ctx context.Context) (err error)
->, <-
func (*GreetClient) GreetStream ¶
func (client *GreetClient) GreetStream(ctx context.Context) (err error)
->, <---
func (*GreetClient) Hello ¶
func (client *GreetClient) Hello(ctx context.Context) (err error)
->, <---
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) // server streaming GreetStream(ctx context.Context, in *GreetRequest, opts ...grpc.CallOption) (GreetService_GreetStreamClient, error) // client streaming Multiply(ctx context.Context, opts ...grpc.CallOption) (GreetService_MultiplyClient, error) // client and server streaming Hello(ctx context.Context, opts ...grpc.CallOption) (GreetService_HelloClient, error) // pending, in_progress, success, failed Upload(ctx context.Context, opts ...grpc.CallOption) (GreetService_UploadClient, 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) // server streaming GreetStream(*GreetRequest, GreetService_GreetStreamServer) error // client streaming Multiply(GreetService_MultiplyServer) error // client and server streaming Hello(GreetService_HelloServer) error // pending, in_progress, success, failed Upload(GreetService_UploadServer) error }
GreetServiceServer is the server API for GreetService service. All implementations must embed UnimplementedGreetServiceServer for forward compatibility
type GreetService_GreetStreamClient ¶
type GreetService_GreetStreamClient interface { Recv() (*GreetResponse, error) grpc.ClientStream }
type GreetService_GreetStreamServer ¶
type GreetService_GreetStreamServer interface { Send(*GreetResponse) error grpc.ServerStream }
type Greeting ¶
type Greeting struct { // unary 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 Msg ¶
type Msg struct { Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"` // contains filtered or unexported fields }
func (*Msg) Descriptor
deprecated
func (*Msg) ProtoMessage ¶
func (*Msg) ProtoMessage()
func (*Msg) ProtoReflect ¶
func (x *Msg) ProtoReflect() protoreflect.Message
type Number ¶
type Number struct { Value int64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*Number) Descriptor
deprecated
func (*Number) ProtoMessage ¶
func (*Number) ProtoMessage()
func (*Number) ProtoReflect ¶
func (x *Number) ProtoReflect() protoreflect.Message
type Server ¶
type Server struct{}
func (*Server) Greet ¶
func (srv *Server) Greet(ctx context.Context, req *GreetRequest) (res *GreetResponse, err error)
func (*Server) GreetStream ¶
func (srv *Server) GreetStream(req *GreetRequest, stream GreetService_GreetStreamServer) ( err error)
func (*Server) Hello ¶
func (src *Server) Hello(stream GreetService_HelloServer) (err error)
func (*Server) Multiply ¶
func (srv *Server) Multiply(stream GreetService_MultiplyServer) (err error)
func (*Server) Upload ¶
func (src *Server) Upload(stream GreetService_UploadServer) (err error)
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)
func (UnimplementedGreetServiceServer) GreetStream ¶
func (UnimplementedGreetServiceServer) GreetStream(*GreetRequest, GreetService_GreetStreamServer) error
func (UnimplementedGreetServiceServer) Hello ¶
func (UnimplementedGreetServiceServer) Hello(GreetService_HelloServer) error
func (UnimplementedGreetServiceServer) Multiply ¶
func (UnimplementedGreetServiceServer) Multiply(GreetService_MultiplyServer) error
func (UnimplementedGreetServiceServer) Upload ¶
func (UnimplementedGreetServiceServer) Upload(GreetService_UploadServer) error
type UnsafeGreetServiceServer ¶
type UnsafeGreetServiceServer interface { }
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.