Documentation
¶
Overview ¶
Package services implements the services.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Email ¶ added in v1.3.0
type Email struct{}
Email is the entity that manages the email client.
func NewEmailService ¶ added in v1.3.0
func NewEmailService() *Email
NewEmailService creates a new Email service.
func (*Email) RateLimits ¶ added in v1.3.0
type EmailService ¶ added in v1.3.0
type EmailService interface {
// RateLimits gets the SendGrid API's remaining and reset rate limits.
RateLimits() (remaining int, resetUnix int64, err error)
// Send sends an email using the SendGrid API.
Send(to string, template templates.EmailTemplate, data any)
}
EmailService is the interface that describes the methods required for the email client.
type RepositoryService ¶ added in v1.3.0
type RepositoryService interface {
// CleanDatabase cleans the database. Unconfirmed users are wiped.
CleanDatabase() error
// Confirm confirms the account.
Confirm(userEmail string) error
// Register registers a new user to the service.
Register(userEmail string) error
// Unregister removes the user's access to the service.
Unregister(userEmail string) error
// Users fetches all users in the database.
Users() ([]models.User, error)
}
RepositoryService is the interface that describes the methods required for managing the main data store.
type SQLiteService ¶
SQLiteService represents the Service implemented with SQLite.
func NewSQLiteService ¶
func NewSQLiteService() *SQLiteService
NewSQLiteService creates an SQLite service.
func (*SQLiteService) CleanDatabase ¶ added in v1.1.0
func (s *SQLiteService) CleanDatabase() error
func (*SQLiteService) Confirm ¶ added in v1.1.0
func (s *SQLiteService) Confirm(userEmail string) error
func (*SQLiteService) Register ¶
func (s *SQLiteService) Register(userEmail string) error
func (*SQLiteService) Unregister ¶
func (s *SQLiteService) Unregister(userEmail string) error
Click to show internal directories.
Click to hide internal directories.