Documentation
¶
Index ¶
- Constants
- func Migrate(db *sql.DB, dir string) error
- func MigrateFS(db *sql.DB, migrationsFS fs.FS, dir string) error
- func Open(config PostgresConfig) (*sql.DB, error)
- type Email
- type EmailService
- type PasswordReset
- type PasswordResetService
- type PostgresConfig
- type SMTPConfig
- type Session
- type SessionService
- type User
- type UserService
Constants ¶
View Source
const (
DefaultResetDuration = 1 * time.Hour
)
View Source
const (
DefaultSender = "support@lenslocked.com"
)
View Source
const (
MinBytesPerToken = 32
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EmailService ¶
type EmailService struct { DefaultSender string // contains filtered or unexported fields }
func NewEmailService ¶
func NewEmailService(config SMTPConfig) *EmailService
func (*EmailService) ForgotPassword ¶
func (e *EmailService) ForgotPassword(to, resetURL string) error
func (*EmailService) Send ¶
func (e *EmailService) Send(email Email) error
type PasswordReset ¶
type PasswordResetService ¶
func (*PasswordResetService) Consume ¶
func (p *PasswordResetService) Consume(token string) (*User, error)
func (*PasswordResetService) Create ¶
func (p *PasswordResetService) Create(email string) (*PasswordReset, error)
type PostgresConfig ¶
type PostgresConfig struct { Host string Port string User string Password string Database string SSLMode string }
func DefaultPostgresConfig ¶
func DefaultPostgresConfig() PostgresConfig
func (PostgresConfig) String ¶
func (config PostgresConfig) String() string
type SessionService ¶
func (*SessionService) Delete ¶
func (ss *SessionService) Delete(token string) error
type UserService ¶
func (*UserService) Authenticate ¶
func (us *UserService) Authenticate(email, password string) (*User, error)
Click to show internal directories.
Click to hide internal directories.