Documentation ¶
Index ¶
- Constants
- Variables
- type EventService
- type Limits
- type Logger
- type MailSender
- type RateLimiter
- type Reservation
- type SMSSender
- type Sender
- func (s *Sender) SendEmailInNewGoroutine(ctx context.Context, msgType translation.MessageType, opts *mail.SendOptions) error
- func (s *Sender) SendSMSInNewGoroutine(ctx context.Context, msgType translation.MessageType, opts *sms.SendOptions) error
- func (s *Sender) SendWhatsappImmediately(ctx context.Context, msgType translation.MessageType, ...) error
- type UsageLimiter
- type WhatsappSender
Constants ¶
View Source
const ( MessagingEmailPerIP ratelimit.BucketName = "MessagingEmailPerIP" MessagingEmailPerTarget ratelimit.BucketName = "MessagingEmailPerTarget" MessagingEmail ratelimit.BucketName = "MessagingEmail" MessagingSMSPerIP ratelimit.BucketName = "MessagingSMSPerIP" MessagingSMSPerTarget ratelimit.BucketName = "MessagingSMSPerTarget" MessagingSMS ratelimit.BucketName = "MessagingSMS" )
Variables ¶
Functions ¶
This section is empty.
Types ¶
type EventService ¶
type EventService interface {
DispatchEventImmediately(ctx context.Context, payload event.NonBlockingPayload) error
}
type Limits ¶
type Limits struct { Logger Logger RateLimiter RateLimiter UsageLimiter UsageLimiter RemoteIP httputil.RemoteIP Config *config.MessagingRateLimitsConfig FeatureConfig *config.MessagingFeatureConfig EnvConfig *config.RateLimitsEnvironmentConfig }
type MailSender ¶
type MailSender interface {
Send(opts mail.SendOptions) error
}
type RateLimiter ¶
type RateLimiter interface { Reserve(ctx context.Context, spec ratelimit.BucketSpec) (*ratelimit.Reservation, *ratelimit.FailedReservation, error) Cancel(ctx context.Context, r *ratelimit.Reservation) }
type Reservation ¶
type Reservation struct { UsageReservation *usage.Reservation RateLimitReservations []*ratelimit.Reservation }
type Sender ¶
type Sender struct { Logger Logger Limits Limits Events EventService MailSender MailSender SMSSender SMSSender WhatsappSender WhatsappSender Database *appdb.Handle DevMode config.DevMode MessagingFeatureConfig *config.MessagingFeatureConfig FeatureTestModeEmailSuppressed config.FeatureTestModeEmailSuppressed TestModeEmailConfig *config.TestModeEmailConfig FeatureTestModeSMSSuppressed config.FeatureTestModeSMSSuppressed TestModeSMSConfig *config.TestModeSMSConfig FeatureTestModeWhatsappSuppressed config.FeatureTestModeWhatsappSuppressed TestModeWhatsappConfig *config.TestModeWhatsappConfig }
func (*Sender) SendEmailInNewGoroutine ¶
func (s *Sender) SendEmailInNewGoroutine(ctx context.Context, msgType translation.MessageType, opts *mail.SendOptions) error
func (*Sender) SendSMSInNewGoroutine ¶
func (s *Sender) SendSMSInNewGoroutine(ctx context.Context, msgType translation.MessageType, opts *sms.SendOptions) error
func (*Sender) SendWhatsappImmediately ¶
func (s *Sender) SendWhatsappImmediately(ctx context.Context, msgType translation.MessageType, opts *whatsapp.SendAuthenticationOTPOptions) error
type UsageLimiter ¶
type UsageLimiter interface { Reserve(ctx context.Context, name usage.LimitName, config *config.UsageLimitConfig) (*usage.Reservation, error) Cancel(ctx context.Context, r *usage.Reservation) }
type WhatsappSender ¶
type WhatsappSender interface { ResolveSendAuthenticationOTPOptions(ctx context.Context, opts *whatsapp.SendAuthenticationOTPOptions) (*whatsapp.ResolvedSendAuthenticationOTPOptions, error) SendAuthenticationOTP(ctx context.Context, opts *whatsapp.ResolvedSendAuthenticationOTPOptions) error }
Click to show internal directories.
Click to hide internal directories.