Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Claims ¶
type Claims struct { jwt.StandardClaims UserID string `json:"_uid"` }
Claims is our custom metadata, which will be hashed and sent as the second segment in our JWT.
type JWTService ¶
type JWTService interface { Encode(uid string) (token string, err error) Decode(token string) (userID string, issuedAt time.Time, err error) }
JWTService defines an implementation of our JWT authentication service.
func NewJWTService ¶
func NewJWTService(cfg *config.Config) (JWTService, error)
NewJWTService configures and returns a JWT authentication instance.
type Mailer ¶
type Mailer struct {
// contains filtered or unexported fields
}
func NewMailerWithSMTP ¶
NewEmailWithSMTP is a constructor function that initializes and returns a ready to use mailer object, an error interface otherwise.
func (Mailer) SendVerifyNotification ¶
func (m Mailer) SendVerifyNotification(address string, content VerifyEmailContent) error
SendVerifyNotification sends the verify email notification to the user's email address.
func (Mailer) SendWelcomeNotification ¶
func (m Mailer) SendWelcomeNotification(address string, content WelcomeEmailContent) error
type VerifyEmailContent ¶
type VerifyEmailContent struct { // Email string SiteURL string SiteName string VerificationExpiry time.Time VerificationURL string }
VerifyEmailContent provides the values to be displayed in the verify email template.
type WelcomeEmailContent ¶
WelcomeEmailContent provides the values to be displayed in the welcome email template.
Click to show internal directories.
Click to hide internal directories.