Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterGreeterHTTPServer(s *httpx.Server, srv GreeterHTTPServer)
- func RegisterGreeterServer(s grpc.ServiceRegistrar, srv GreeterServer)
- func RegisterUserHTTPServer(s *httpx.Server, srv UserHTTPServer)
- func RegisterUserServer(s grpc.ServiceRegistrar, srv UserServer)
- type GreeterClient
- type GreeterHTTPServer
- type GreeterServer
- type Greeter_SayHelloStreamClient
- type Greeter_SayHelloStreamServer
- type HelloReply
- type HelloRequest
- type LoginReply
- type LoginRequest
- func (*LoginRequest) Descriptor() ([]byte, []int)deprecated
- func (x *LoginRequest) GetCode() string
- func (x *LoginRequest) GetPassword() string
- func (x *LoginRequest) GetUname() string
- func (x *LoginRequest) GetUnique() string
- func (*LoginRequest) ProtoMessage()
- func (x *LoginRequest) ProtoReflect() protoreflect.Message
- func (x *LoginRequest) Reset()
- func (x *LoginRequest) String() string
- type RegisterRequest
- func (*RegisterRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RegisterRequest) GetCode() string
- func (x *RegisterRequest) GetEmail() string
- func (x *RegisterRequest) GetPassword() string
- func (x *RegisterRequest) GetUname() string
- func (x *RegisterRequest) GetUnique() string
- func (*RegisterRequest) ProtoMessage()
- func (x *RegisterRequest) ProtoReflect() protoreflect.Message
- func (x *RegisterRequest) Reset()
- func (x *RegisterRequest) String() string
- type UnimplementedGreeterDescServer
- type UnimplementedGreeterServer
- type UnimplementedUserDescServer
- type UnimplementedUserServer
- type UnsafeGreeterServer
- type UnsafeUserServer
- type UserClient
- type UserHTTPServer
- type UserServer
Constants ¶
const ( Greeter_SayHello_FullMethodName = "/protos.Greeter/SayHello" Greeter_Empty_FullMethodName = "/protos.Greeter/Empty" Greeter_SayHelloStream_FullMethodName = "/protos.Greeter/SayHelloStream" )
const ( User_Register_FullMethodName = "/protos.User/Register" User_Login_FullMethodName = "/protos.User/Login" )
Variables ¶
var File_protos_greet_proto protoreflect.FileDescriptor
var File_protos_user_proto protoreflect.FileDescriptor
var Greeter_ServiceDesc = grpc.ServiceDesc{ ServiceName: "protos.Greeter", HandlerType: (*GreeterServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SayHello", Handler: _Greeter_SayHello_Handler, }, { MethodName: "Empty", Handler: _Greeter_Empty_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "SayHelloStream", Handler: _Greeter_SayHelloStream_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "protos/greet.proto", }
Greeter_ServiceDesc is the grpc.ServiceDesc for Greeter service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var User_ServiceDesc = grpc.ServiceDesc{ ServiceName: "protos.User", HandlerType: (*UserServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Register", Handler: _User_Register_Handler, }, { MethodName: "Login", Handler: _User_Login_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "protos/user.proto", }
User_ServiceDesc is the grpc.ServiceDesc for User service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterGreeterHTTPServer ¶
func RegisterGreeterHTTPServer(s *httpx.Server, srv GreeterHTTPServer)
func RegisterGreeterServer ¶
func RegisterGreeterServer(s grpc.ServiceRegistrar, srv GreeterServer)
func RegisterUserHTTPServer ¶
func RegisterUserHTTPServer(s *httpx.Server, srv UserHTTPServer)
func RegisterUserServer ¶
func RegisterUserServer(s grpc.ServiceRegistrar, srv UserServer)
Types ¶
type GreeterClient ¶
type GreeterClient interface { // Sends a greeting SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) Empty(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) // Sends a greeting SayHelloStream(ctx context.Context, opts ...grpc.CallOption) (Greeter_SayHelloStreamClient, error) }
GreeterClient is the client API for Greeter 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 NewGreeterClient ¶
func NewGreeterClient(cc grpc.ClientConnInterface) GreeterClient
type GreeterHTTPServer ¶
type GreeterServer ¶
type GreeterServer interface { // Sends a greeting SayHello(context.Context, *HelloRequest) (*HelloReply, error) Empty(context.Context, *emptypb.Empty) (*emptypb.Empty, error) // Sends a greeting SayHelloStream(Greeter_SayHelloStreamServer) error // contains filtered or unexported methods }
GreeterServer is the server API for Greeter service. All implementations must embed UnimplementedGreeterServer for forward compatibility
type Greeter_SayHelloStreamClient ¶
type Greeter_SayHelloStreamClient interface { Send(*HelloRequest) error Recv() (*HelloReply, error) grpc.ClientStream }
type Greeter_SayHelloStreamServer ¶
type Greeter_SayHelloStreamServer interface { Send(*HelloReply) error Recv() (*HelloRequest, error) grpc.ServerStream }
type HelloReply ¶
type HelloReply struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
The response message containing the greetings
func (*HelloReply) Descriptor
deprecated
func (*HelloReply) Descriptor() ([]byte, []int)
Deprecated: Use HelloReply.ProtoReflect.Descriptor instead.
func (*HelloReply) GetMessage ¶
func (x *HelloReply) GetMessage() string
func (*HelloReply) ProtoMessage ¶
func (*HelloReply) ProtoMessage()
func (*HelloReply) ProtoReflect ¶
func (x *HelloReply) ProtoReflect() protoreflect.Message
func (*HelloReply) Reset ¶
func (x *HelloReply) Reset()
func (*HelloReply) String ¶
func (x *HelloReply) String() string
type HelloRequest ¶
type HelloRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
The request message containing the user's name.
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 LoginReply ¶
type LoginReply struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*LoginReply) Descriptor
deprecated
func (*LoginReply) Descriptor() ([]byte, []int)
Deprecated: Use LoginReply.ProtoReflect.Descriptor instead.
func (*LoginReply) GetMessage ¶
func (x *LoginReply) GetMessage() string
func (*LoginReply) ProtoMessage ¶
func (*LoginReply) ProtoMessage()
func (*LoginReply) ProtoReflect ¶
func (x *LoginReply) ProtoReflect() protoreflect.Message
func (*LoginReply) Reset ¶
func (x *LoginReply) Reset()
func (*LoginReply) String ¶
func (x *LoginReply) String() string
type LoginRequest ¶
type LoginRequest struct { Unique string `protobuf:"bytes,1,opt,name=unique,proto3" json:"unique,omitempty"` Uname string `protobuf:"bytes,2,opt,name=uname,proto3" json:"uname,omitempty"` Code string `protobuf:"bytes,3,opt,name=code,proto3" json:"code,omitempty"` Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` // contains filtered or unexported fields }
func (*LoginRequest) Descriptor
deprecated
func (*LoginRequest) Descriptor() ([]byte, []int)
Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead.
func (*LoginRequest) GetCode ¶
func (x *LoginRequest) GetCode() string
func (*LoginRequest) GetPassword ¶
func (x *LoginRequest) GetPassword() string
func (*LoginRequest) GetUname ¶
func (x *LoginRequest) GetUname() string
func (*LoginRequest) GetUnique ¶
func (x *LoginRequest) GetUnique() string
func (*LoginRequest) ProtoMessage ¶
func (*LoginRequest) ProtoMessage()
func (*LoginRequest) ProtoReflect ¶
func (x *LoginRequest) ProtoReflect() protoreflect.Message
func (*LoginRequest) Reset ¶
func (x *LoginRequest) Reset()
func (*LoginRequest) String ¶
func (x *LoginRequest) String() string
type RegisterRequest ¶
type RegisterRequest struct { Unique string `protobuf:"bytes,1,opt,name=unique,proto3" json:"unique,omitempty"` Uname string `protobuf:"bytes,2,opt,name=uname,proto3" json:"uname,omitempty"` Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` Code string `protobuf:"bytes,4,opt,name=code,proto3" json:"code,omitempty"` Password string `protobuf:"bytes,5,opt,name=password,proto3" json:"password,omitempty"` // contains filtered or unexported fields }
func (*RegisterRequest) Descriptor
deprecated
func (*RegisterRequest) Descriptor() ([]byte, []int)
Deprecated: Use RegisterRequest.ProtoReflect.Descriptor instead.
func (*RegisterRequest) GetCode ¶
func (x *RegisterRequest) GetCode() string
func (*RegisterRequest) GetEmail ¶
func (x *RegisterRequest) GetEmail() string
func (*RegisterRequest) GetPassword ¶
func (x *RegisterRequest) GetPassword() string
func (*RegisterRequest) GetUname ¶
func (x *RegisterRequest) GetUname() string
func (*RegisterRequest) GetUnique ¶
func (x *RegisterRequest) GetUnique() string
func (*RegisterRequest) ProtoMessage ¶
func (*RegisterRequest) ProtoMessage()
func (*RegisterRequest) ProtoReflect ¶
func (x *RegisterRequest) ProtoReflect() protoreflect.Message
func (*RegisterRequest) Reset ¶
func (x *RegisterRequest) Reset()
func (*RegisterRequest) String ¶
func (x *RegisterRequest) String() string
type UnimplementedGreeterDescServer ¶
type UnimplementedGreeterDescServer struct {
UnimplementedGreeterServer
}
func (UnimplementedGreeterDescServer) Desc ¶
func (UnimplementedGreeterDescServer) Desc() grpc.ServiceDesc
type UnimplementedGreeterServer ¶
type UnimplementedGreeterServer struct { }
UnimplementedGreeterServer must be embedded to have forward compatible implementations.
func (UnimplementedGreeterServer) SayHello ¶
func (UnimplementedGreeterServer) SayHello(context.Context, *HelloRequest) (*HelloReply, error)
func (UnimplementedGreeterServer) SayHelloStream ¶
func (UnimplementedGreeterServer) SayHelloStream(Greeter_SayHelloStreamServer) error
type UnimplementedUserDescServer ¶
type UnimplementedUserDescServer struct {
UnimplementedUserServer
}
func (UnimplementedUserDescServer) Desc ¶
func (UnimplementedUserDescServer) Desc() grpc.ServiceDesc
type UnimplementedUserServer ¶
type UnimplementedUserServer struct { }
UnimplementedUserServer must be embedded to have forward compatible implementations.
func (UnimplementedUserServer) Login ¶
func (UnimplementedUserServer) Login(context.Context, *LoginRequest) (*LoginReply, error)
func (UnimplementedUserServer) Register ¶
func (UnimplementedUserServer) Register(context.Context, *RegisterRequest) (*LoginReply, error)
type UnsafeGreeterServer ¶
type UnsafeGreeterServer interface {
// contains filtered or unexported methods
}
UnsafeGreeterServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to GreeterServer will result in compilation errors.
type UnsafeUserServer ¶
type UnsafeUserServer interface {
// contains filtered or unexported methods
}
UnsafeUserServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to UserServer will result in compilation errors.
type UserClient ¶
type UserClient interface { Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*LoginReply, error) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginReply, error) }
UserClient is the client API for User 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 NewUserClient ¶
func NewUserClient(cc grpc.ClientConnInterface) UserClient
type UserHTTPServer ¶
type UserHTTPServer interface { Register(ctx context.Context, in *RegisterRequest) (*LoginReply, error) Login(ctx context.Context, in *LoginRequest) (*LoginReply, error) }
type UserServer ¶
type UserServer interface { Register(context.Context, *RegisterRequest) (*LoginReply, error) Login(context.Context, *LoginRequest) (*LoginReply, error) // contains filtered or unexported methods }
UserServer is the server API for User service. All implementations must embed UnimplementedUserServer for forward compatibility