Movatterモバイル変換


[0]ホーム

URL:


notifications

package
v2.28.4Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2025 License:AGPL-3.0Imports:23Imported by:0

Details

Repository

github.com/coder/coder

Links

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

typeConfig

type Config struct {// User is the configuration for the user to create.Usercreateusers.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.NotificationTimeouttime.Duration `json:"notification_timeout"`// DialTimeout is how long to wait for websocket connection.DialTimeouttime.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 APISMTPApiURLstring `json:"smtp_api_url"`}

func (Config)Validate

func (cConfig) Validate()error

typeMetrics

type Metrics struct {// contains filtered or unexported fields}

funcNewMetrics

func NewMetrics(regprometheus.Registerer) *Metrics

func (*Metrics)AddError

func (m *Metrics) AddError(actionstring)

func (*Metrics)RecordLatency

func (m *Metrics) RecordLatency(latencytime.Duration, notificationIDstring, notificationTypeNotificationType)

typeNotificationType

type NotificationTypestring
const (NotificationTypeWebsocketNotificationType = "websocket"NotificationTypeSMTPNotificationType = "smtp")

typeRunner

type Runner struct {// contains filtered or unexported fields}

funcNewRunner

func NewRunner(client *codersdk.Client, cfgConfig) *Runner

func (*Runner)Cleanup

func (r *Runner) Cleanup(ctxcontext.Context, idstring, logsio.Writer)error

func (*Runner)GetMetrics

func (r *Runner) GetMetrics() map[string]any

func (*Runner)Run

func (r *Runner) Run(ctxcontext.Context, idstring, logsio.Writer)error

func (*Runner)WithClock

func (r *Runner) WithClock(clockquartz.Clock) *Runner

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp