Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterUserInterfaceHTTPServer(s *http.Server, srv UserInterfaceHTTPServer)
- func RegisterUserInterfaceServer(s grpc.ServiceRegistrar, srv UserInterfaceServer)
- type ErrorReason
- func (ErrorReason) Descriptor() protoreflect.EnumDescriptor
- func (x ErrorReason) Enum() *ErrorReason
- func (ErrorReason) EnumDescriptor() ([]byte, []int)deprecated
- func (x ErrorReason) Number() protoreflect.EnumNumber
- func (x ErrorReason) String() string
- func (ErrorReason) Type() protoreflect.EnumType
- type Msg
- type SignIn
- type UnimplementedUserInterfaceServer
- type UnsafeUserInterfaceServer
- type User
- func (*User) Descriptor() ([]byte, []int)deprecated
- func (x *User) GetEmail() string
- func (x *User) GetExpHour() int32
- func (x *User) GetId() int64
- func (x *User) GetToken() string
- func (x *User) GetUsername() string
- func (*User) ProtoMessage()
- func (x *User) ProtoReflect() protoreflect.Message
- func (x *User) Reset()
- func (x *User) String() string
- type UserInterfaceClient
- type UserInterfaceHTTPClient
- type UserInterfaceHTTPClientImpl
- func (c *UserInterfaceHTTPClientImpl) GetUserInfo(ctx context.Context, in *emptypb.Empty, opts ...http.CallOption) (*User, error)
- func (c *UserInterfaceHTTPClientImpl) SignIn(ctx context.Context, in *SignIn, opts ...http.CallOption) (*User, error)
- func (c *UserInterfaceHTTPClientImpl) SignOut(ctx context.Context, in *emptypb.Empty, opts ...http.CallOption) (*Msg, error)
- type UserInterfaceHTTPServer
- type UserInterfaceServer
Constants ¶
const ( UserInterface_SignIn_FullMethodName = "/user.v1alpha1.UserInterface/SignIn" UserInterface_SignOut_FullMethodName = "/user.v1alpha1.UserInterface/SignOut" UserInterface_GetUserInfo_FullMethodName = "/user.v1alpha1.UserInterface/GetUserInfo" )
const OperationUserInterfaceGetUserInfo = "/user.v1alpha1.UserInterface/GetUserInfo"
const OperationUserInterfaceSignIn = "/user.v1alpha1.UserInterface/SignIn"
const OperationUserInterfaceSignOut = "/user.v1alpha1.UserInterface/SignOut"
Variables ¶
var ( ErrorReason_name = map[int32]string{ 0: "SUCCEED", 1: "FAILED", } ErrorReason_value = map[string]int32{ "SUCCEED": 0, "FAILED": 1, } )
Enum value maps for ErrorReason.
var File_api_user_v1alpha1_error_reason_proto protoreflect.FileDescriptor
var File_api_user_v1alpha1_message_proto protoreflect.FileDescriptor
var File_api_user_v1alpha1_user_proto protoreflect.FileDescriptor
var UserInterface_ServiceDesc = grpc.ServiceDesc{ ServiceName: "user.v1alpha1.UserInterface", HandlerType: (*UserInterfaceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SignIn", Handler: _UserInterface_SignIn_Handler, }, { MethodName: "SignOut", Handler: _UserInterface_SignOut_Handler, }, { MethodName: "GetUserInfo", Handler: _UserInterface_GetUserInfo_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api/user/v1alpha1/user.proto", }
UserInterface_ServiceDesc is the grpc.ServiceDesc for UserInterface service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterUserInterfaceHTTPServer ¶
func RegisterUserInterfaceHTTPServer(s *http.Server, srv UserInterfaceHTTPServer)
func RegisterUserInterfaceServer ¶
func RegisterUserInterfaceServer(s grpc.ServiceRegistrar, srv UserInterfaceServer)
Types ¶
type ErrorReason ¶
type ErrorReason int32
const ( ErrorReason_SUCCEED ErrorReason = 0 ErrorReason_FAILED ErrorReason = 1 )
func (ErrorReason) Descriptor ¶
func (ErrorReason) Descriptor() protoreflect.EnumDescriptor
func (ErrorReason) Enum ¶
func (x ErrorReason) Enum() *ErrorReason
func (ErrorReason) EnumDescriptor
deprecated
func (ErrorReason) EnumDescriptor() ([]byte, []int)
Deprecated: Use ErrorReason.Descriptor instead.
func (ErrorReason) Number ¶
func (x ErrorReason) Number() protoreflect.EnumNumber
func (ErrorReason) String ¶
func (x ErrorReason) String() string
func (ErrorReason) Type ¶
func (ErrorReason) Type() protoreflect.EnumType
type Msg ¶
type Msg struct { Reason ErrorReason `protobuf:"varint,1,opt,name=Reason,proto3,enum=user.v1alpha1.ErrorReason" json:"Reason,omitempty"` Message string `protobuf:"bytes,2,opt,name=Message,proto3" json:"Message,omitempty"` // contains filtered or unexported fields }
func (*Msg) Descriptor
deprecated
func (*Msg) GetMessage ¶
func (*Msg) GetReason ¶
func (x *Msg) GetReason() ErrorReason
func (*Msg) ProtoMessage ¶
func (*Msg) ProtoMessage()
func (*Msg) ProtoReflect ¶
func (x *Msg) ProtoReflect() protoreflect.Message
type SignIn ¶
type SignIn struct { Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` // contains filtered or unexported fields }
func (*SignIn) Descriptor
deprecated
func (*SignIn) GetPassword ¶
func (*SignIn) ProtoMessage ¶
func (*SignIn) ProtoMessage()
func (*SignIn) ProtoReflect ¶
func (x *SignIn) ProtoReflect() protoreflect.Message
type UnimplementedUserInterfaceServer ¶
type UnimplementedUserInterfaceServer struct { }
UnimplementedUserInterfaceServer must be embedded to have forward compatible implementations.
func (UnimplementedUserInterfaceServer) GetUserInfo ¶
type UnsafeUserInterfaceServer ¶
type UnsafeUserInterfaceServer interface {
// contains filtered or unexported methods
}
UnsafeUserInterfaceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to UserInterfaceServer will result in compilation errors.
type User ¶
type User struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` Token string `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"` ExpHour int32 `protobuf:"varint,5,opt,name=exp_hour,json=expHour,proto3" json:"exp_hour,omitempty"` // contains filtered or unexported fields }
func (*User) Descriptor
deprecated
func (*User) GetExpHour ¶
func (*User) GetUsername ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message
type UserInterfaceClient ¶
type UserInterfaceClient interface { SignIn(ctx context.Context, in *SignIn, opts ...grpc.CallOption) (*User, error) SignOut(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Msg, error) GetUserInfo(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*User, error) }
UserInterfaceClient is the client API for UserInterface 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 NewUserInterfaceClient ¶
func NewUserInterfaceClient(cc grpc.ClientConnInterface) UserInterfaceClient
type UserInterfaceHTTPClient ¶
type UserInterfaceHTTPClient interface { GetUserInfo(ctx context.Context, req *emptypb.Empty, opts ...http.CallOption) (rsp *User, err error) SignIn(ctx context.Context, req *SignIn, opts ...http.CallOption) (rsp *User, err error) SignOut(ctx context.Context, req *emptypb.Empty, opts ...http.CallOption) (rsp *Msg, err error) }
func NewUserInterfaceHTTPClient ¶
func NewUserInterfaceHTTPClient(client *http.Client) UserInterfaceHTTPClient
type UserInterfaceHTTPClientImpl ¶
type UserInterfaceHTTPClientImpl struct {
// contains filtered or unexported fields
}
func (*UserInterfaceHTTPClientImpl) GetUserInfo ¶
func (c *UserInterfaceHTTPClientImpl) GetUserInfo(ctx context.Context, in *emptypb.Empty, opts ...http.CallOption) (*User, error)
func (*UserInterfaceHTTPClientImpl) SignIn ¶
func (c *UserInterfaceHTTPClientImpl) SignIn(ctx context.Context, in *SignIn, opts ...http.CallOption) (*User, error)
type UserInterfaceHTTPServer ¶
type UserInterfaceServer ¶
type UserInterfaceServer interface { SignIn(context.Context, *SignIn) (*User, error) SignOut(context.Context, *emptypb.Empty) (*Msg, error) GetUserInfo(context.Context, *emptypb.Empty) (*User, error) // contains filtered or unexported methods }
UserInterfaceServer is the server API for UserInterface service. All implementations must embed UnimplementedUserInterfaceServer for forward compatibility