Documentation
¶
Index ¶
Constants ¶
View Source
const ( WebsocketNotificationReceiptTimeMetric = "notification_websocket_receipt_time" SMTPNotificationReceiptTimeMetric = "notification_smtp_receipt_time" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// User is the configuration for the user to create.
User createusers.Config `json:"user"`
// Roles are the roles to assign to the user.
Roles []string `json:"roles"`
// NotificationTimeout is how long to wait for notifications after triggering.
NotificationTimeout time.Duration `json:"notification_timeout"`
// DialTimeout is how long to wait for websocket connection.
DialTimeout time.Duration `json:"dial_timeout"`
// ExpectedNotificationsIDs is the list of notification template IDs to expect.
ExpectedNotificationsIDs map[uuid.UUID]struct{} `json:"-"`
Metrics *Metrics `json:"-"`
// DialBarrier ensures all runners are connected before notifications are triggered.
DialBarrier *sync.WaitGroup `json:"-"`
// ReceivingWatchBarrier is the barrier for receiving users. Regular users wait on this to disconnect after receiving users complete.
ReceivingWatchBarrier *sync.WaitGroup `json:"-"`
// SMTPApiUrl is the URL of the SMTP mock HTTP API
SMTPApiURL string `json:"smtp_api_url"`
// SMTPRequestTimeout is the timeout for SMTP requests.
SMTPRequestTimeout time.Duration `json:"smtp_request_timeout"`
// SMTPHttpClient is the HTTP client for SMTP requests.
SMTPHttpClient *http.Client `json:"-"`
}
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
func NewMetrics ¶
func NewMetrics(reg prometheus.Registerer) *Metrics
func (*Metrics) RecordLatency ¶
func (m *Metrics) RecordLatency(latency time.Duration, notificationID string, notificationType NotificationType)
type NotificationType ¶
type NotificationType string
const ( NotificationTypeWebsocket NotificationType = "websocket" NotificationTypeSMTP NotificationType = "smtp" )
Click to show internal directories.
Click to hide internal directories.