Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer)
- type GetUserRequest
- type GetUserResponse
- type GetUserResponse_User
- func (*GetUserResponse_User) Descriptor() ([]byte, []int)deprecated
- func (x *GetUserResponse_User) GetId() string
- func (x *GetUserResponse_User) GetName() string
- func (*GetUserResponse_User) ProtoMessage()
- func (x *GetUserResponse_User) ProtoReflect() protoreflect.Message
- func (x *GetUserResponse_User) Reset()
- func (x *GetUserResponse_User) String() string
- type UnimplementedUserServiceServer
- type UnsafeUserServiceServer
- type UserServiceClient
- type UserServiceServer
Constants ¶
const (
UserService_GetUser_FullMethodName = "/example.UserService/GetUser"
)
Variables ¶
var File_examples_grpc_proto_user_proto protoreflect.FileDescriptor
var UserService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "example.UserService", HandlerType: (*UserServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetUser", Handler: _UserService_GetUser_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "examples/grpc/proto/user.proto", }
UserService_ServiceDesc is the grpc.ServiceDesc for UserService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterUserServiceServer ¶
func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer)
Types ¶
type GetUserRequest ¶
type GetUserRequest struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// contains filtered or unexported fields
}
func (*GetUserRequest) Descriptor
deprecated
func (*GetUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetUserRequest.ProtoReflect.Descriptor instead.
func (*GetUserRequest) GetId ¶
func (x *GetUserRequest) GetId() string
func (*GetUserRequest) ProtoMessage ¶
func (*GetUserRequest) ProtoMessage()
func (*GetUserRequest) ProtoReflect ¶
func (x *GetUserRequest) ProtoReflect() protoreflect.Message
func (*GetUserRequest) Reset ¶
func (x *GetUserRequest) Reset()
func (*GetUserRequest) String ¶
func (x *GetUserRequest) String() string
type GetUserResponse ¶
type GetUserResponse struct {
User *GetUserResponse_User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
// contains filtered or unexported fields
}
func (*GetUserResponse) Descriptor
deprecated
func (*GetUserResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetUserResponse.ProtoReflect.Descriptor instead.
func (*GetUserResponse) GetUser ¶
func (x *GetUserResponse) GetUser() *GetUserResponse_User
func (*GetUserResponse) ProtoMessage ¶
func (*GetUserResponse) ProtoMessage()
func (*GetUserResponse) ProtoReflect ¶
func (x *GetUserResponse) ProtoReflect() protoreflect.Message
func (*GetUserResponse) Reset ¶
func (x *GetUserResponse) Reset()
func (*GetUserResponse) String ¶
func (x *GetUserResponse) String() string
type GetUserResponse_User ¶
type GetUserResponse_User struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
// contains filtered or unexported fields
}
func (*GetUserResponse_User) Descriptor
deprecated
func (*GetUserResponse_User) Descriptor() ([]byte, []int)
Deprecated: Use GetUserResponse_User.ProtoReflect.Descriptor instead.
func (*GetUserResponse_User) GetId ¶
func (x *GetUserResponse_User) GetId() string
func (*GetUserResponse_User) GetName ¶
func (x *GetUserResponse_User) GetName() string
func (*GetUserResponse_User) ProtoMessage ¶
func (*GetUserResponse_User) ProtoMessage()
func (*GetUserResponse_User) ProtoReflect ¶
func (x *GetUserResponse_User) ProtoReflect() protoreflect.Message
func (*GetUserResponse_User) Reset ¶
func (x *GetUserResponse_User) Reset()
func (*GetUserResponse_User) String ¶
func (x *GetUserResponse_User) String() string
type UnimplementedUserServiceServer ¶
type UnimplementedUserServiceServer struct{}
UnimplementedUserServiceServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedUserServiceServer) GetUser ¶
func (UnimplementedUserServiceServer) GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error)
type UnsafeUserServiceServer ¶
type UnsafeUserServiceServer interface {
// contains filtered or unexported methods
}
UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to UserServiceServer will result in compilation errors.
type UserServiceClient ¶
type UserServiceClient interface {
GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*GetUserResponse, error)
}
UserServiceClient is the client API for UserService 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 NewUserServiceClient ¶
func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient
type UserServiceServer ¶
type UserServiceServer interface {
GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error)
// contains filtered or unexported methods
}
UserServiceServer is the server API for UserService service. All implementations must embed UnimplementedUserServiceServer for forward compatibility.