Skip to content

Commit d8e0628

Browse files
authored
Merge pull request #7 from simodima/rename
Renames to github.com/simodima
2 parents 353ef6f + c41e4e6 commit d8e0628

File tree

13 files changed

+31
-24
lines changed

13 files changed

+31
-24
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
---
1010

1111
[![codecov](https://codecov.io/github/simodima/squeue/graph/badge.svg?token=DW7C57P2VW)](https://codecov.io/github/simodima/squeue)
12-
[![Go Report Card](https://goreportcard.com/badge/github.com/toretto460/squeue)](https://goreportcard.com/report/github.com/toretto460/squeue)
12+
[![Go Report Card](https://goreportcard.com/badge/github.com/simodima/squeue)](https://goreportcard.com/report/github.com/simodima/squeue)
1313
[![Go Reference](https://pkg.go.dev/badge/github.com/simodima/squeue.svg)](https://pkg.go.dev/github.com/simodima/squeue)
1414

1515
The library provides the following features:

consumer.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import (
44
"context"
55
"encoding/json"
66

7-
"github.com/toretto460/squeue/driver"
7+
"github.com/simodima/squeue/driver"
88
)
99

1010
//go:generate mockgen -source=driver/driver.go -package=squeue_test -destination=driver_test.go
1111

12-
// NewConsumer
12+
// NewConsumer creates a new consumer for the given T type of messages
1313
func NewConsumer[T json.Unmarshaler](d driver.Driver) Consumer[T] {
1414
return Consumer[T]{d}
1515
}
@@ -18,7 +18,11 @@ type Consumer[T json.Unmarshaler] struct {
1818
driver driver.Driver
1919
}
2020

21-
// TODO: document Consume
21+
// Consume retrieves messages from the given queue.
22+
// Any provided options will be sent to the underlying driver.
23+
// The messages are indefinetely consumed from the queue and
24+
// sent to the chan Message[T].
25+
// To stop consuming messages is sufficient to cancel the context.Context
2226
func (p *Consumer[T]) Consume(ctx context.Context, queue string, opts ...func(message any)) (chan Message[T], error) {
2327
messages, err := p.driver.Consume(ctx, queue, opts...)
2428
if err != nil {
@@ -57,7 +61,8 @@ func (p *Consumer[T]) Consume(ctx context.Context, queue string, opts ...func(me
5761
return outMsg, nil
5862
}
5963

60-
// TODO: document Ack
64+
// Ack explicitly acknowldge the message handling.
65+
// It can be implemented as No Operation for some drivers.
6166
func (p *Consumer[T]) Ack(queue string, m Message[T]) error {
6267
return p.driver.Ack(queue, m.ID)
6368
}

consumer_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88
"github.com/golang/mock/gomock"
99
"github.com/stretchr/testify/suite"
1010

11-
"github.com/toretto460/squeue"
12-
"github.com/toretto460/squeue/driver"
11+
"github.com/simodima/squeue"
12+
"github.com/simodima/squeue/driver"
1313
)
1414

1515
type ConsumerTestSuite struct {

driver/memdriver_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"testing"
66
"time"
77

8+
"github.com/simodima/squeue/driver"
89
"github.com/stretchr/testify/suite"
9-
"github.com/toretto460/squeue/driver"
1010
)
1111

1212
type MemoryTestSuite struct {

driver_test.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/toretto460/squeue
1+
module github.com/simodima/squeue
22

33
go 1.18
44

internal/examples/memory/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99
"syscall"
1010
"time"
1111

12-
"github.com/toretto460/squeue"
13-
"github.com/toretto460/squeue/driver"
12+
"github.com/simodima/squeue"
13+
"github.com/simodima/squeue/driver"
1414
)
1515

1616
type myMessage struct {

internal/examples/sqs/consumer/consumer.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import (
88
"syscall"
99

1010
"github.com/joho/godotenv"
11-
"github.com/toretto460/squeue"
12-
sqsexample "github.com/toretto460/squeue/internal/examples/sqs"
13-
"github.com/toretto460/squeue/sqs"
11+
"github.com/simodima/squeue"
12+
sqsexample "github.com/simodima/squeue/internal/examples/sqs"
13+
"github.com/simodima/squeue/sqs"
1414
)
1515

1616
func cancelOnSignal(fn func(), signals ...os.Signal) {

internal/examples/sqs/producer/producer.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import (
88

99
"github.com/joho/godotenv"
1010

11-
"github.com/toretto460/squeue"
12-
sqsexample "github.com/toretto460/squeue/internal/examples/sqs"
13-
"github.com/toretto460/squeue/sqs"
11+
"github.com/simodima/squeue"
12+
sqsexample "github.com/simodima/squeue/internal/examples/sqs"
13+
"github.com/simodima/squeue/sqs"
1414
)
1515

1616
func init() {

producer.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package squeue
33
import (
44
"encoding/json"
55

6-
"github.com/toretto460/squeue/driver"
6+
"github.com/simodima/squeue/driver"
77
)
88

99
func NewProducer(d driver.Driver) Producer {
@@ -16,7 +16,9 @@ type Producer struct {
1616
driver driver.Driver
1717
}
1818

19-
// TODO: document Enqueue
19+
// Enqueue sends a message to the given queue
20+
// any provided options will be sent to the
21+
// underlying driver
2022
func (q *Producer) Enqueue(queue string, message json.Marshaler, opts ...func(message any)) error {
2123
data, err := json.Marshal(message)
2224
if err != nil {

0 commit comments

Comments
 (0)