{"id":25932880,"url":"https://github.com/kernle32dll/testcontainers-go-canned","last_synced_at":"2025-03-04T00:39:24.996Z","repository":{"id":64299522,"uuid":"569407567","full_name":"kernle32dll/testcontainers-go-canned","owner":"kernle32dll","description":"A collection of templates for testcontainers-go.","archived":false,"fork":false,"pushed_at":"2022-11-22T23:25:37.000Z","size":55,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-06-20T05:08:19.625Z","etag":null,"topics":["go","kafka","testing"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kernle32dll.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-11-22T18:57:28.000Z","updated_at":"2024-06-20T05:08:19.626Z","dependencies_parsed_at":"2023-01-15T09:15:48.642Z","dependency_job_id":null,"html_url":"https://github.com/kernle32dll/testcontainers-go-canned","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kernle32dll%2Ftestcontainers-go-canned","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kernle32dll%2Ftestcontainers-go-canned/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kernle32dll%2Ftestcontainers-go-canned/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kernle32dll%2Ftestcontainers-go-canned/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kernle32dll","download_url":"https://codeload.github.com/kernle32dll/testcontainers-go-canned/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241763755,"owners_count":20016161,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","kafka","testing"],"created_at":"2025-03-04T00:39:24.540Z","updated_at":"2025-03-04T00:39:24.977Z","avatar_url":"https://github.com/kernle32dll.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"![test](https://github.com/kernle32dll/testcontainers-go-canned/workflows/test/badge.svg)\n[![GoDoc](https://godoc.org/github.com/kernle32dll/testcontainers-go-canned?status.svg)](http://godoc.org/github.com/kernle32dll/testcontainers-go-canned)\n[![Go Report Card](https://goreportcard.com/badge/github.com/kernle32dll/testcontainers-go-canned)](https://goreportcard.com/report/github.com/kernle32dll/testcontainers-go-canned)\n[![codecov](https://codecov.io/gh/kernle32dll/testcontainers-go-canned/branch/master/graph/badge.svg)](https://codecov.io/gh/kernle32dll/testcontainers-go-canned)\n\n# testcontainers-go-canned\n\ntestcontainers-go-canned is a collection templates for\n[testcontainers-go](https://github.com/testcontainers/testcontainers-go).\n\nDownload:\n\n```\ngo get github.com/kernle32dll/testcontainers-go-canned@latest\n```\n\nDetailed documentation can be found on [GoDoc](https://godoc.org/github.com/kernle32dll/testcontainers-go-canned).\n\n## Compatibility\n\ntestcontainers-go-canned is automatically tested against the following:\n\n- Go 1.17.X, 1.18.X and 1.19.X\n\n## Getting started\n\n### Kafka\n\nSimply initialize a new cluster via...\n\n```go\nimport \"github.com/kernle32dll/testcontainers-go-canned/kafkatest\"\n\n[...]\n\nkafkaCluster, err := kafkatest.NewKafkaCluster(ctx)\n```\n\n...and if done, call...\n\n```go\nkafkaCluster.StopCluster(ctx)\n```\n\nFor some inspiration, look at the [cluster_test.go](./kafkatest/cluster_test.go) file, which actually tests\nintegration with [franz-go](https://github.com/twmb/franz-go).\n\n#### Configuration\n\nThere are many `kafkatest.With[...]` option functions, you can use for vararg configuration of the cluster. E.g.:\n\n```go\nkafkaCluster, err := kafkatest.NewKafkaCluster(\n    ctx,\n    kafkatest.WithTLS(true),\n)\n```\n\n#### TLS\n\nTake special note of the `kafkatest.WithTLS(true)` option, which configures the cluster for full TLS.\nYou can then use `kafkaCluster.ClientTLSConfig()` function to receive an `tls.Config`, you can plug into your\nkafka client like so for example ([kgo is franz-go](https://github.com/twmb/franz-go)):\n\n```go\nseed, err := kafkaCluster.GetKafkaHostAndPort(context.Background())\n[...]\n\nclient, err := kgo.NewClient(\n    kgo.SeedBrokers(seed),\n    kgo.DialTLSConfig(kafkaCluster.ClientTLSConfig()),\n)\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkernle32dll%2Ftestcontainers-go-canned","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkernle32dll%2Ftestcontainers-go-canned","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkernle32dll%2Ftestcontainers-go-canned/lists"}