Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer)
- type Creditionals
- func (*Creditionals) Descriptor() ([]byte, []int)deprecated
- func (x *Creditionals) GetPassword() string
- func (x *Creditionals) GetUsername() string
- func (*Creditionals) ProtoMessage()
- func (x *Creditionals) ProtoReflect() protoreflect.Message
- func (x *Creditionals) Reset()
- func (x *Creditionals) String() string
- type Id
- type Token
- type UnimplementedUserServiceServer
- func (UnimplementedUserServiceServer) GetUserById(context.Context, *Id) (*User, error)
- func (UnimplementedUserServiceServer) GetUserByToken(context.Context, *Token) (*User, error)
- func (UnimplementedUserServiceServer) Login(context.Context, *Creditionals) (*Token, error)
- func (UnimplementedUserServiceServer) Register(context.Context, *Creditionals) (*Token, error)
- type UnsafeUserServiceServer
- type User
- type UserServiceClient
- type UserServiceServer
Constants ¶
const ( UserService_Register_FullMethodName = "/user.UserService/Register" UserService_Login_FullMethodName = "/user.UserService/Login" UserService_GetUserById_FullMethodName = "/user.UserService/GetUserById" UserService_GetUserByToken_FullMethodName = "/user.UserService/GetUserByToken" )
Variables ¶
var File_user_user_proto protoreflect.FileDescriptor
var UserService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "user.UserService", HandlerType: (*UserServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Register", Handler: _UserService_Register_Handler, }, { MethodName: "Login", Handler: _UserService_Login_Handler, }, { MethodName: "GetUserById", Handler: _UserService_GetUserById_Handler, }, { MethodName: "GetUserByToken", Handler: _UserService_GetUserByToken_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "user/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 Creditionals ¶
type Creditionals struct {
Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
// contains filtered or unexported fields
}
func (*Creditionals) Descriptor
deprecated
func (*Creditionals) Descriptor() ([]byte, []int)
Deprecated: Use Creditionals.ProtoReflect.Descriptor instead.
func (*Creditionals) GetPassword ¶
func (x *Creditionals) GetPassword() string
func (*Creditionals) GetUsername ¶
func (x *Creditionals) GetUsername() string
func (*Creditionals) ProtoMessage ¶
func (*Creditionals) ProtoMessage()
func (*Creditionals) ProtoReflect ¶
func (x *Creditionals) ProtoReflect() protoreflect.Message
func (*Creditionals) Reset ¶
func (x *Creditionals) Reset()
func (*Creditionals) String ¶
func (x *Creditionals) String() string
type Id ¶
type Id struct {
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
// contains filtered or unexported fields
}
func (*Id) Descriptor
deprecated
func (*Id) ProtoMessage ¶
func (*Id) ProtoMessage()
func (*Id) ProtoReflect ¶
func (x *Id) ProtoReflect() protoreflect.Message
type Token ¶
type Token struct {
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
// contains filtered or unexported fields
}
func (*Token) Descriptor
deprecated
func (*Token) ProtoMessage ¶
func (*Token) ProtoMessage()
func (*Token) ProtoReflect ¶
func (x *Token) ProtoReflect() protoreflect.Message
type UnimplementedUserServiceServer ¶
type UnimplementedUserServiceServer struct {
}
UnimplementedUserServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedUserServiceServer) GetUserById ¶ added in v0.2.0
func (UnimplementedUserServiceServer) GetUserByToken ¶ added in v0.2.0
func (UnimplementedUserServiceServer) Login ¶
func (UnimplementedUserServiceServer) Login(context.Context, *Creditionals) (*Token, error)
func (UnimplementedUserServiceServer) Register ¶
func (UnimplementedUserServiceServer) Register(context.Context, *Creditionals) (*Token, 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 User ¶
type User struct {
Id *Id `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
IsStaff bool `protobuf:"varint,4,opt,name=is_staff,json=isStaff,proto3" json:"is_staff,omitempty"`
// contains filtered or unexported fields
}
func (*User) Descriptor
deprecated
func (*User) GetIsStaff ¶ added in v0.2.0
func (*User) GetUsername ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message
type UserServiceClient ¶
type UserServiceClient interface {
Register(ctx context.Context, in *Creditionals, opts ...grpc.CallOption) (*Token, error)
Login(ctx context.Context, in *Creditionals, opts ...grpc.CallOption) (*Token, error)
GetUserById(ctx context.Context, in *Id, opts ...grpc.CallOption) (*User, error)
GetUserByToken(ctx context.Context, in *Token, opts ...grpc.CallOption) (*User, 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 {
Register(context.Context, *Creditionals) (*Token, error)
Login(context.Context, *Creditionals) (*Token, error)
GetUserById(context.Context, *Id) (*User, error)
GetUserByToken(context.Context, *Token) (*User, error)
// contains filtered or unexported methods
}
UserServiceServer is the server API for UserService service. All implementations must embed UnimplementedUserServiceServer for forward compatibility