|
1 | | -<picture> |
2 | | - <source media="(prefers-color-scheme: dark)" srcset="./docs/squeue-white.png"> |
3 | | - <source media="(prefers-color-scheme: light)" srcset="./docs/squeue-black.png"> |
4 | | - <img alt="S-queue mascotte" src="./docs/squeue-black.png"> |
| 1 | +<picture> |
| 2 | + <source media="(prefers-color-scheme: dark)" srcset="./docs/squeue-white.png"> |
| 3 | + <source media="(prefers-color-scheme: light)" srcset="./docs/squeue-black.png"> |
| 4 | + <img alt="S-queue mascot" src="./docs/squeue-black.png"> |
5 | 5 | </picture> |
6 | 6 |
|
7 | | -**s-queue** is a library to interact with Amazon SQS queues with 100% type safety, powered by golang generics. |
8 | | - |
| 7 | +**squeue** is a Golang library designed to facilitate interactions with Amazon SQS queues, providing 100% type-safety powered by Golang generics. |
| 8 | + |
9 | 9 | --- |
10 | | - |
11 | | -[](https://codecov.io/github/simodima/squeue) |
12 | | -[](https://goreportcard.com/report/github.com/simodima/squeue) |
| 10 | + |
| 11 | +[](https://codecov.io/github/simodima/squeue) |
| 12 | +[](https://goreportcard.com/report/github.com/simodima/squeue) |
13 | 13 | [](https://pkg.go.dev/github.com/simodima/squeue) |
14 | 14 |
|
15 | | -The library provides the following features: |
| 15 | +## Key Features |
16 | 16 |
|
17 | | -### Driver based implementation |
18 | | -The interface exposed by the library abstract the internal driver implementation, that allows to plug various different drivers depending of the development needs and the environment. |
| 17 | +### Driver-based Implementation |
| 18 | +squeue abstracts the internal driver implementation through its interface, allowing for seamless integration of various drivers to suit different development environments and needs. |
19 | 19 |
|
20 | | -The currently implemented drivers are : |
21 | | -- In Memory |
| 20 | +Currently implemented drivers: |
| 21 | +- In-Memory |
22 | 22 | - Amazon SQS |
23 | 23 |
|
24 | | -You can easly use the *Amazon SQS* driver in any staging/production environment and use the *In Memory* one for a lightweight testing environment. |
| 24 | +You can easily deploy the *Amazon SQS* driver in any staging or production environment and use the *In-Memory* driver for lightweight testing. |
25 | 25 |
|
26 | 26 | ### Type Safety |
27 | | -The library uses an opinionated JSON format to serialize/deserialize the messages. To be 100% typesafe you just need to provide a message type implementing the golang `json.Marshaler` and `json.Unmarshaler` interfaces; in that way the raw data serialization/deserialization is in your direct control. |
| 27 | +The library uses an opinionated JSON format for serializing and deserializing messages. To achieve 100% type safety, simply provide a message type that implements the Golang `json.Marshaler` and `json.Unmarshaler` interfaces. This way, you maintain direct control over the raw data serialization and deserialization. |
28 | 28 |
|
29 | | -### Channel of messages |
30 | | -Consuming message is as easy as looping a channel of messages |
| 29 | +### Channel of Messages |
| 30 | +Consuming messages is straightforward—just loop through a channel of messages: |
31 | 31 |
|
32 | 32 | ```golang |
33 | | - messages, _ := sub.Consume(ctx, "queue") |
34 | | - for m := range messages { |
35 | | - go func(message squeue.Message[*my.Message]) { |
36 | | - // Do the magic... |
37 | | - }(m) |
38 | | - } |
| 33 | +messages, _ := sub.Consume(ctx, "queue") |
| 34 | +for m := range messages { |
| 35 | + go func(message squeue.Message[*my.Message]) { |
| 36 | + // Do your magic... |
| 37 | + }(m) |
| 38 | +} |
39 | 39 | ``` |
40 | 40 |
|
41 | 41 | <details> |
| 42 | + <summary>Examples</summary> |
42 | 43 |
|
43 | | -<summary>Examples</summary> |
44 | | - |
45 | | -For a more clear documentation look at the `internal/examples/` directory |
| 44 | + For more detailed documentation, please refer to the `internal/examples/` directory. |
46 | 45 |
|
47 | | -**In Memory driver** |
48 | | -```bash |
49 | | -go run internal/examples/memory/main.go |
50 | | -``` |
51 | | - |
52 | | -**Amazon SQS driver** |
53 | | -```bash |
54 | | -go run internal/examples/sqs/consumer/consumer.go |
| 46 | + **In-Memory Driver** |
| 47 | + ```bash |
| 48 | + go run internal/examples/memory/main.go |
| 49 | + ``` |
55 | 50 |
|
56 | | -## in a different shell ↓ |
57 | | -go run internal/examples/sqs/producer/producer.go |
58 | | -``` |
| 51 | + **Amazon SQS Driver** |
| 52 | + ```bash |
| 53 | + go run internal/examples/sqs/consumer/consumer.go |
| 54 | + # Open another shell |
| 55 | + go run internal/examples/sqs/producer/producer.go |
| 56 | + ``` |
59 | 57 |
|
60 | | -</details> |
| 58 | +</details> |
0 commit comments