Documentation ¶
Index ¶
- Variables
- type CommsContext
- type Domain
- type EmailTemplate
- type EmailTemplates
- type EmailTemplatesDir
- type Impl
- func (d *Impl) GetNotificationConfig(ctx CommsContext) (*entities.NotificationConf, error)
- func (d *Impl) GetSubscriptionConfig(ctx CommsContext, id repos.ID) (*entities.Subscription, error)
- func (d *Impl) ListNotifications(ctx CommsContext, pagination repos.CursorPagination) (*repos.PaginatedRecord[*types.Notification], error)
- func (d *Impl) MarkAllNotificationsAsRead(ctx CommsContext) error
- func (d *Impl) MarkNotificationAsRead(ctx CommsContext, id repos.ID) (*types.Notification, error)
- func (d *Impl) Notify(ctx context.Context, notification *types.Notification) error
- func (d *Impl) UpdateNotificationConfig(ctx CommsContext, config entities.NotificationConf) (*entities.NotificationConf, error)
- func (d *Impl) UpdateSubscriptionConfig(ctx CommsContext, id repos.ID, config entities.Subscription) (*entities.Subscription, error)
- type PublishMsg
- type ResourceEventPublisher
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = fx.Module("domain", fx.Provide(func(e *env.Env, notificationRepo repos.DbRepo[*types.Notification], subscriptionRepo repos.DbRepo[*entities.Subscription], notificationConfigRepo repos.DbRepo[*entities.NotificationConf], logger logging.Logger, iamClient iam.IAMClient, resourceEventPublisher ResourceEventPublisher, eTemplates *EmailTemplates, mailer mail.Mailer, ) (Domain, error) { return &Impl{ iamClient: iamClient, envs: e, logger: logger, resourceEventPublisher: resourceEventPublisher, notificationRepo: notificationRepo, subscriptionRepo: subscriptionRepo, notificationConfigRepo: notificationConfigRepo, mailer: mailer, eTemplates: eTemplates, }, nil }))
Functions ¶
This section is empty.
Types ¶
type CommsContext ¶
type CommsContext struct { context.Context UserId repos.ID UserName string AccountName string UserEmail string }
func (CommsContext) GetAccountName ¶
func (c CommsContext) GetAccountName() string
func (CommsContext) GetUserEmail ¶
func (c CommsContext) GetUserEmail() string
func (CommsContext) GetUserId ¶
func (c CommsContext) GetUserId() repos.ID
func (CommsContext) GetUserName ¶
func (c CommsContext) GetUserName() string
type Domain ¶
type Domain interface { ListNotifications(ctx CommsContext, pagination repos.CursorPagination) (*repos.PaginatedRecord[*types.Notification], error) MarkNotificationAsRead(ctx CommsContext, id repos.ID) (*types.Notification, error) MarkAllNotificationsAsRead(ctx CommsContext) error GetNotificationConfig(ctx CommsContext) (*entities.NotificationConf, error) UpdateNotificationConfig(ctx CommsContext, config entities.NotificationConf) (*entities.NotificationConf, error) UpdateSubscriptionConfig(ctx CommsContext, id repos.ID, config entities.Subscription) (*entities.Subscription, error) GetSubscriptionConfig(ctx CommsContext, id repos.ID) (*entities.Subscription, error) Notify(ctx context.Context, notification *types.Notification) error }
type EmailTemplate ¶
type EmailTemplates ¶
type EmailTemplates struct { AccountInviteEmail *EmailTemplate ProjectInviteEmail *EmailTemplate ResetPasswordEmail *EmailTemplate UserVerificationEmail *EmailTemplate WelcomeEmail *EmailTemplate WaitingEmail *EmailTemplate AlertEmail *EmailTemplate ContactUsEmail *EmailTemplate }
func GetEmailTemplates ¶
func GetEmailTemplates(et EmailTemplatesDir) (*EmailTemplates, error)
type EmailTemplatesDir ¶
type Impl ¶
type Impl struct {
// contains filtered or unexported fields
}
func (*Impl) GetNotificationConfig ¶
func (d *Impl) GetNotificationConfig(ctx CommsContext) (*entities.NotificationConf, error)
func (*Impl) GetSubscriptionConfig ¶
func (d *Impl) GetSubscriptionConfig(ctx CommsContext, id repos.ID) (*entities.Subscription, error)
func (*Impl) ListNotifications ¶
func (d *Impl) ListNotifications(ctx CommsContext, pagination repos.CursorPagination) (*repos.PaginatedRecord[*types.Notification], error)
func (*Impl) MarkAllNotificationsAsRead ¶
func (d *Impl) MarkAllNotificationsAsRead(ctx CommsContext) error
func (*Impl) MarkNotificationAsRead ¶
func (d *Impl) MarkNotificationAsRead(ctx CommsContext, id repos.ID) (*types.Notification, error)
func (*Impl) UpdateNotificationConfig ¶
func (d *Impl) UpdateNotificationConfig(ctx CommsContext, config entities.NotificationConf) (*entities.NotificationConf, error)
func (*Impl) UpdateSubscriptionConfig ¶
func (d *Impl) UpdateSubscriptionConfig(ctx CommsContext, id repos.ID, config entities.Subscription) (*entities.Subscription, error)
type PublishMsg ¶
type PublishMsg string
const ( PublishAdd PublishMsg = "added" PublishDelete PublishMsg = "deleted" PublishUpdate PublishMsg = "updated" )
type ResourceEventPublisher ¶
type ResourceEventPublisher interface { }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.