Documentation ¶
Index ¶
- type AuthServer
- type User
- type UserManager
- type UserService
- func (s *UserService) ChangePassword(ctx context.Context, r *pb.ChangePasswordRequest) (*google_protobuf.Empty, error)
- func (s *UserService) GetUsers(ctx context.Context, r *pb.GetUsersRequest) (*pb.GetUsersResponse, error)
- func (s *UserService) UpdateProfile(ctx context.Context, r *pb.UpdateProfileRequest) (*google_protobuf.Empty, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthServer ¶
type AuthServer struct { JwtPrivateKey *rsa.PrivateKey UserManager UserManager }
func NewAuthServer ¶
func NewAuthServer(rsaPrivateKey []byte, s UserManager) (*AuthServer, error)
func (*AuthServer) SignIn ¶
func (as *AuthServer) SignIn(cx context.Context, r *pb.SignInRequest) (*pb.Token, error)
func (*AuthServer) SignUp ¶
func (as *AuthServer) SignUp(cx context.Context, r *pb.SignUpRequest) (*pb.Token, error)
type UserManager ¶
type UserManager interface { GetUserByUsername(username string) (*User, error) GetUserById(id string) (*User, error) UpdateUser(*User) error CreateUser(*User) error FindUsersByUsernameOrName(name string) ([]*User, error) FindUsersByIds(ids []string) ([]*User, error) }
UserManager represets a service for User operations
type UserService ¶
type UserService struct { UserManager UserManager // contains filtered or unexported fields }
func NewUserService ¶
func NewUserService(rsaPublicKey []byte, s UserManager) (*UserService, error)
func (*UserService) ChangePassword ¶
func (s *UserService) ChangePassword(ctx context.Context, r *pb.ChangePasswordRequest) (*google_protobuf.Empty, error)
func (*UserService) GetUsers ¶
func (s *UserService) GetUsers(ctx context.Context, r *pb.GetUsersRequest) (*pb.GetUsersResponse, error)
func (*UserService) UpdateProfile ¶
func (s *UserService) UpdateProfile(ctx context.Context, r *pb.UpdateProfileRequest) (*google_protobuf.Empty, error)
Click to show internal directories.
Click to hide internal directories.