Documentation
¶
Index ¶
- Variables
- func WithConfiguration(cfg *config.Configuration) func(service *service)
- func WithKeyValueService(keyValueService userland.KeyValueService) func(service *service)
- func WithMailingClient(mailingClient mailing.Client) func(service *service)
- func WithUserRepository(userRepository userland.UserRepository) func(service *service)
- type Service
Constants ¶
This section is empty.
Variables ¶
View Source
var ( EventLogin = "user.authentication.login" EventForgotPassword = "user.authentication.forgot_password" ErrUserRegistered = errors.New("User already registered") ErrUserNotVerified = errors.New("User not verified") ErrWrongPassword = errors.New("Wrong password") ErrServiceNotImplemented = errors.New("Service not implemented") ErrWrongOTP = errors.New("Wrong OTP") ErrWrongBackupCode = errors.New("code doesn't match any backup codes") ErrOTPInvalid = errors.New("OTP Invalid") )
View Source
var (
MetricKeys = []string{"method"}
)
Functions ¶
func WithConfiguration ¶
func WithConfiguration(cfg *config.Configuration) func(service *service)
func WithKeyValueService ¶
func WithKeyValueService(keyValueService userland.KeyValueService) func(service *service)
func WithMailingClient ¶
func WithUserRepository ¶
func WithUserRepository(userRepository userland.UserRepository) func(service *service)
Types ¶
type Service ¶
type Service interface { Register(user userland.User) error RequestVerification(verificationType string, email string) (verificationID string, err error) VerifyAccount(verificationID string, email string, code string) error Login(email, password string) (requireTFA bool, accessToken security.AccessToken, err error) VerifyTFA(tfaToken string, userID int, code string) (accessToken security.AccessToken, err error) VerifyTFABypass(tfaToken string, userID int, code string) (accessToken security.AccessToken, err error) ForgotPassword(email string) (verificationID string, err error) ResetPassword(forgotPassToken string, newPassword string) error }
Service provide an interface to story domain service
func NewInstrumentorService ¶
func NewService ¶
func NewService(options ...func(*service)) Service
Click to show internal directories.
Click to hide internal directories.