• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

classconnect-grupo3 / courses-service / 15664929523

15 Jun 2025 03:57PM UTC coverage: 86.624% (-0.5%) from 87.109%
15664929523

push

github

rovifran
refactor: removed file router/queues.go and made dedicated messsages for queues

0 of 22 new or added lines in 2 files covered. (0.0%)

3115 of 3596 relevant lines covered (86.62%)

0.98 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/queues/notifications_queue.go
1
package queues
2

3
import (
4
        "fmt"
5
        "os"
6

7
        amqp "github.com/rabbitmq/amqp091-go"
8
)
9

10
type NotificationsQueue struct {
11
        channel *amqp.Channel
12
}
13

NEW
14
func NewNotificationsQueue() (*NotificationsQueue, error) {
×
15
        queueName := os.Getenv("NOTIFICATIONS_QUEUE_NAME")
×
16
        queueURL := os.Getenv("RABBITMQ_URL")
×
17

×
18
        conn, err := amqp.Dial(queueURL)
×
19
        if err != nil {
×
20
                return nil, fmt.Errorf("failed to connect to RabbitMQ: %w", err)
×
21
        }
×
22

23
        ch, err := conn.Channel()
×
24
        if err != nil {
×
25
                return nil, fmt.Errorf("failed to open a channel: %w", err)
×
26
        }
×
27

28
        _, err = ch.QueueDeclare(
×
29
                queueName,
×
30
                true,
×
31
                false,
×
32
                false,
×
33
                false,
×
34
                nil,
×
35
        )
×
36

×
37
        if err != nil {
×
38
                return nil, fmt.Errorf("failed to declare queue: %w", err)
×
39
        }
×
40

NEW
41
        return &NotificationsQueue{
×
NEW
42
                channel: ch,
×
NEW
43
        }, nil
×
44
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc