Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added NATS JetStream example #1190

Merged
merged 22 commits into from
May 24, 2023
Merged

added NATS JetStream example #1190

merged 22 commits into from
May 24, 2023

Conversation

adoublef
Copy link
Contributor

@adoublef adoublef commented May 12, 2023

What does this PR do?

This PR adds a NATS example as per #636 using the same pattern other examples are written.

Why is it important?

NATS is technology that I see quite often in blogs/tutorials when dealing with event-driven architecture and Go (we also see that we have alternatives with Kafka, PubSub included here already too).

Related issues

@netlify
Copy link

netlify bot commented May 12, 2023

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit c0db9f3
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/646d33e4964a7300080234f7
😎 Deploy Preview https://deploy-preview-1190--testcontainers-go.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

examples/nats/go.mod Outdated Show resolved Hide resolved
examples/nats/Makefile Outdated Show resolved Hide resolved
@mdelapenya
Copy link
Member

I guess you did not use the code generation tool for bootstrapping the example module, right? I'm missing the mkdocs.yml file being updated, or the docs/examples files.

Could you run the generator first, and then apply your changes? 🙏 That will bring consistency across the docs site too.

@adoublef
Copy link
Contributor Author

Ah no I did not, I will give this ago using the generator

@adoublef
Copy link
Contributor Author

Tested locally and passes, I still included the natsContainer.ConnectionString method but unsure if you would rather I remove that or not.

@adoublef
Copy link
Contributor Author

Unsure if I have missed something when running the mod gen but the Github tests are returning this error example nats is not present in the dependabot updates

Copy link
Member

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a few comments before the final review, but great job with the contribution!

.github/dependabot.yml Outdated Show resolved Hide resolved
mkdocs.yml Outdated Show resolved Hide resolved
mkdocs.yml Outdated Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
@mdelapenya
Copy link
Member

Tested locally and passes, I still included the natsContainer.ConnectionString method but unsure if you would rather I remove that or not.

Let's keep it, as it's useful for testing, and probably added once converted into a real module (I encourage you to convert this example into a module sooner than later 🙏 )

@adoublef
Copy link
Contributor Author

Tested locally and passes, I still included the natsContainer.ConnectionString method but unsure if you would rather I remove that or not.

Let's keep it, as it's useful for testing, and probably added once converted into a real module (I encourage you to convert this example into a module sooner than later 🙏 )

Ahhh I changed it before seeing this message as I was having a small bug issue locally, but may just have been WSL2 playing up

go.mod Outdated Show resolved Hide resolved
mkdocs.yml Outdated Show resolved Hide resolved
@mdelapenya
Copy link
Member

@adoublef could you share the command you used to generate the scaffolding?

I'd say it was:

go run . --name nats --image "nats:latest" --title Nats

But wanted to double check, as it would have generated the right wording regarding capital chats and modified files.

Please make sure to also fix #1190 (comment)

@adoublef
Copy link
Contributor Author

@adoublef could you share the command you used to generate the scaffolding?

I'd say it was:

go run . --name nats --image "nats:latest" --title Nats

But wanted to double check, as it would have generated the right wording regarding capital chats and modified files.

Please make sure to also fix #1190 (comment)

No I did --title nats I just didn't read the docs slow enough, apologies

mkdocs.yml Outdated Show resolved Hide resolved
@mdelapenya mdelapenya marked this pull request as ready for review May 16, 2023 13:36
@mdelapenya mdelapenya requested a review from a team as a code owner May 16, 2023 13:36
examples/nats/nats.go Outdated Show resolved Hide resolved
docs/examples/nats.md Outdated Show resolved Hide resolved
@sonarcloud
Copy link

sonarcloud bot commented May 23, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@mdelapenya mdelapenya merged commit 834f795 into testcontainers:main May 24, 2023
mdelapenya added a commit that referenced this pull request May 24, 2023
* main:
  chore(deps): bump go.mongodb.org/mongo-driver in /examples/mongodb (#1233)
  chore(deps): bump google.golang.org/api from 0.123.0 to 0.124.0 in /examples (#1244)
  chore(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 (#1241)
  chore(deps): bump github.com/aws/aws-sdk-go in /modules/localstack (#1242)
  added NATS JetStream example (#1190)
  chore(deps): bump github.com/imdario/mergo from 0.3.12 to 0.3.15 (#1204)
  chore(deps): bump cloud.google.com/go/firestore in /examples/firestore (#1216)
mdelapenya added a commit that referenced this pull request May 25, 2023
…containerd-1.7.1

* main:
  chore(deps): bump golang.org/x/sys from 0.7.0 to 0.8.0 (#1202)
  chore(deps): bump github.com/stretchr/testify from 1.8.2 to 1.8.3 (#1232)
  chore(deps): bump cloud.google.com/go/spanner in /examples/spanner (#1226)
  chore: Removes the refercence about docker 22.06 from the docker-compose docs and updates the replace directive for the compose module. (#1243)
  chore(deps): bump go.mongodb.org/mongo-driver in /examples/mongodb (#1233)
  chore(deps): bump google.golang.org/api from 0.123.0 to 0.124.0 in /examples (#1244)
  chore(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 (#1241)
  chore(deps): bump github.com/aws/aws-sdk-go in /modules/localstack (#1242)
  added NATS JetStream example (#1190)
  chore(deps): bump github.com/imdario/mergo from 0.3.12 to 0.3.15 (#1204)
  chore(deps): bump cloud.google.com/go/firestore in /examples/firestore (#1216)
  chore(deps): bump k8s.io/client-go from 0.22.5 to 0.27.2 in /modules/k3s (#1211)
  chore(deps): bump go.mongodb.org/mongo-driver in /examples/mongodb (#1092)
  chore(deps): bump github.com/neo4j/neo4j-go-driver/v5 in /modules/neo4j (#1206)
  chore(deps): bump github.com/twmb/franz-go in /modules/redpanda (#1201)
  chore(deps): bump google.golang.org/api from 0.121.0 to 0.123.0 in /examples (#1229)
  chore(deps): bump github.com/stretchr/testify from 1.8.2 to 1.8.3 (#1228)
  chore: use fixed version in k3s module (#1225)
mdelapenya added a commit to mdelapenya/testcontainers-go that referenced this pull request May 26, 2023
* main: (22 commits)
  docs: document the Go version (testcontainers#1246)
  chore(deps): bump github.com/aws/aws-sdk-go-v2/config (testcontainers#1222)
  chore(deps): bump golang.org/x/sys from 0.7.0 to 0.8.0 (testcontainers#1202)
  chore(deps): bump github.com/stretchr/testify from 1.8.2 to 1.8.3 (testcontainers#1232)
  chore(deps): bump cloud.google.com/go/spanner in /examples/spanner (testcontainers#1226)
  chore: Removes the refercence about docker 22.06 from the docker-compose docs and updates the replace directive for the compose module. (testcontainers#1243)
  chore(deps): bump go.mongodb.org/mongo-driver in /examples/mongodb (testcontainers#1233)
  chore(deps): bump google.golang.org/api from 0.123.0 to 0.124.0 in /examples (testcontainers#1244)
  chore(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 (testcontainers#1241)
  chore(deps): bump github.com/aws/aws-sdk-go in /modules/localstack (testcontainers#1242)
  added NATS JetStream example (testcontainers#1190)
  chore(deps): bump github.com/imdario/mergo from 0.3.12 to 0.3.15 (testcontainers#1204)
  chore(deps): bump cloud.google.com/go/firestore in /examples/firestore (testcontainers#1216)
  chore(deps): bump k8s.io/client-go from 0.22.5 to 0.27.2 in /modules/k3s (testcontainers#1211)
  chore(deps): bump go.mongodb.org/mongo-driver in /examples/mongodb (testcontainers#1092)
  chore(deps): bump github.com/neo4j/neo4j-go-driver/v5 in /modules/neo4j (testcontainers#1206)
  chore(deps): bump github.com/twmb/franz-go in /modules/redpanda (testcontainers#1201)
  chore(deps): bump google.golang.org/api from 0.121.0 to 0.123.0 in /examples (testcontainers#1229)
  chore(deps): bump github.com/stretchr/testify from 1.8.2 to 1.8.3 (testcontainers#1228)
  ...
@mdelapenya mdelapenya added the feature New functionality or new behaviors on the existing one label May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality or new behaviors on the existing one
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants