Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type CreateUserParams ¶
type Service ¶
type Service interface {
// CreateUser adds a new user to the store.
// The default implementation sends out a verification email.
CreateUser(ctx context.Context, ps CreateUserParams) error
// VerifyUser takes a verification token (typically taken from a URL query
// parameter of an activation link), checks whether the token is valid,
// not expired and assigned to a user account awaiting verification.
// If the checks are successful, the user is marked as verified and
// can be used to log in.
// Returns ErrVerificationFailed if the verification itself failed,
// but was executed without errors,
VerifyUser(ctx context.Context, token string) error
ValidateLogin(ctx context.Context, email, password string) (*User, error)
}
type ServiceDefault ¶
type ServiceDefault struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(store hexzsql.UserStore, mailClient *mail.Client) *ServiceDefault
func (*ServiceDefault) CreateUser ¶
func (s *ServiceDefault) CreateUser(ctx context.Context, ps CreateUserParams) error
func (*ServiceDefault) ValidateLogin ¶
func (*ServiceDefault) VerifyUser ¶
func (s *ServiceDefault) VerifyUser(ctx context.Context, token string) error
Click to show internal directories.
Click to hide internal directories.