fleet/server/kolide/emails.go
Zachary Wasserman 45f6a74740
Allow import of github.com/kolide/fleet (#2213)
Previously a Go package attempting to import Fleet packages would run
into an error like "server/kolide/emails.go:93:23: undefined: Asset".

This commit refactors bindata asset handling to allow importing Fleet as
a library without changing the typical developer experience.
2020-03-29 19:22:04 -07:00

46 lines
1.2 KiB
Go

package kolide
import (
"time"
)
// PasswordResetStore manages password resets in the Datastore
type PasswordResetStore interface {
NewPasswordResetRequest(req *PasswordResetRequest) (*PasswordResetRequest, error)
SavePasswordResetRequest(req *PasswordResetRequest) error
DeletePasswordResetRequest(req *PasswordResetRequest) error
DeletePasswordResetRequestsForUser(userID uint) error
FindPassswordResetByID(id uint) (*PasswordResetRequest, error)
FindPassswordResetsByUserID(id uint) ([]*PasswordResetRequest, error)
FindPassswordResetByToken(token string) (*PasswordResetRequest, error)
FindPassswordResetByTokenAndUserID(token string, id uint) (*PasswordResetRequest, error)
}
// Mailer is an email campaign
// Types which implement the Campaign interface
// can be marshalled into an email body
type Mailer interface {
Message() ([]byte, error)
}
type Email struct {
Subject string
To []string
Config *AppConfig
Mailer Mailer
}
type MailService interface {
SendEmail(e Email) error
}
// PasswordResetRequest represents a database table for
// Password Reset Requests
type PasswordResetRequest struct {
UpdateCreateTimestamps
ID uint
ExpiresAt time.Time `db:"expires_at"`
UserID uint `db:"user_id"`
Token string
}