Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Preferences ¶
type Preferences struct {
// contains filtered or unexported fields
}
func NewPreferences ¶
func NewPreferences( preferencesRepo *db_notification.PreferenceRepository, ) *Preferences
func (*Preferences) ListByUserID ¶
func (s *Preferences) ListByUserID(ctx context.Context, userID string) ([]*notification.Preference, error)
ListByUserID returns all existing user preferences from the database + default preferences for all other possible permutation of notification types and channels.
func (*Preferences) Update ¶
func (s *Preferences) Update( ctx context.Context, userID string, typ notification.NotificationType, channel notification.Channel, enabled bool, ) (*notification.Preference, error)
Update updates or creates a preference.
Click to show internal directories.
Click to hide internal directories.