service

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Module

func Module(c *di.Container)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL