MCPcopy Create free account
hub / github.com/coder/coder / readNotification

Function readNotification

scaletest/notifications/run.go:384–396  ·  view source on GitHub ↗
(ctx context.Context, conn *websocket.Conn)

Source from the content-addressed store, hash-verified

382}
383
384func readNotification(ctx context.Context, conn *websocket.Conn) (codersdk.GetInboxNotificationResponse, error) {
385 _, message, err := conn.Read(ctx)
386 if err != nil {
387 return codersdk.GetInboxNotificationResponse{}, err
388 }
389
390 var notif codersdk.GetInboxNotificationResponse
391 if err := json.Unmarshal(message, &notif); err != nil {
392 return codersdk.GetInboxNotificationResponse{}, xerrors.Errorf("unmarshal notification: %w", err)
393 }
394
395 return notif, nil
396}

Callers 1

watchNotificationsMethod · 0.85

Calls 3

ReadMethod · 0.65
UnmarshalMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected