Documentation ¶
Index ¶
- type Auth
- type AuthService
- func (s *AuthService) CreateSession(ctx context.Context, id ksuid.KSUID, ip string) (domain.Tokens, error)
- func (s *AuthService) RefreshTokens(ctx context.Context, token, ip string) (string, error)
- func (s *AuthService) SignIn(ctx context.Context, username, password, ip string) (domain.Tokens, error)
- func (s *AuthService) SignOut(ctx context.Context, token, ip string) error
- func (s *AuthService) SignUp(ctx context.Context, user domain.User, code uint64, ip string) (domain.Tokens, error)
- type Code
- type CodeService
- type Service
- type User
- type UserService
- func (s *UserService) Create(ctx context.Context, user domain.User) (ksuid.KSUID, error)
- func (s *UserService) ForgotPassword(ctx context.Context, password, email string, code uint64) error
- func (s *UserService) GetByCreds(ctx context.Context, username, password string) (domain.User, error)
- func (s *UserService) GetByID(ctx context.Context, id ksuid.KSUID) (domain.User, error)
- func (s *UserService) UpdateAvatar(ctx context.Context, id ksuid.KSUID, avatarUrl string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth interface { SignUp(ctx context.Context, user domain.User, code uint64, ip string) (domain.Tokens, error) SignIn(ctx context.Context, username, password, ip string) (domain.Tokens, error) SignOut(ctx context.Context, token, ip string) error RefreshTokens(ctx context.Context, token, ip string) (string, error) CreateSession(ctx context.Context, id ksuid.KSUID, ip string) (domain.Tokens, error) }
Auth service interface.
type AuthService ¶
type AuthService struct {
// contains filtered or unexported fields
}
Auth service structure.
func (*AuthService) CreateSession ¶
func (s *AuthService) CreateSession(ctx context.Context, id ksuid.KSUID, ip string) (domain.Tokens, error)
Creating a new user session.
func (*AuthService) RefreshTokens ¶
Refresh user session access token.
func (*AuthService) SignIn ¶
func (s *AuthService) SignIn(ctx context.Context, username, password, ip string) (domain.Tokens, error)
User Sign In.
type Code ¶
type Code interface { CreateVerifyEmailCode(ctx context.Context, email string) error VerifyEmailCode(ctx context.Context, email string, input uint64) (bool, error) }
Code service interface.
type CodeService ¶
type CodeService struct {
// contains filtered or unexported fields
}
Code service structure.
func NewCodeService ¶
func NewCodeService(repos redis.Code, email v1.EmailUserServiceClient, cfg *config.CodeConfig) *CodeService
Creating a new code service.
func (*CodeService) CreateVerifyEmailCode ¶
func (s *CodeService) CreateVerifyEmailCode(ctx context.Context, email string) error
Creating a new user verification email code.
func (*CodeService) VerifyEmailCode ¶
func (s *CodeService) VerifyEmailCode(ctx context.Context, email string, input uint64) (bool, error)
Verifying a user verification email code.
type Service ¶
Service structure.
func NewService ¶
func NewService(repos *repository.Repository, config *config.Config, email v1.EmailUserServiceClient) *Service
Creating a new service.
type User ¶
type User interface { Create(ctx context.Context, user domain.User) (ksuid.KSUID, error) GetByID(ctx context.Context, id ksuid.KSUID) (domain.User, error) GetByCreds(ctx context.Context, username, password string) (domain.User, error) ForgotPassword(ctx context.Context, password, email string, code uint64) error UpdateAvatar(ctx context.Context, id ksuid.KSUID, avatarUrl string) error }
User service interface.
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
User service structure.
func NewUserService ¶
func NewUserService(repos postgres.User, code Code, cfg *config.PasswordConfig) *UserService
Creating a new user service.
func (*UserService) ForgotPassword ¶
func (s *UserService) ForgotPassword(ctx context.Context, password, email string, code uint64) error
Forgot user password.
func (*UserService) GetByCreds ¶
func (s *UserService) GetByCreds(ctx context.Context, username, password string) (domain.User, error)
Getting user by credentials.
func (*UserService) UpdateAvatar ¶
Updating user avatar.
Click to show internal directories.
Click to hide internal directories.