{"id":20010208,"url":"https://github.com/activecm/dbtest","last_synced_at":"2025-10-26T18:50:47.334Z","repository":{"id":93994915,"uuid":"136259834","full_name":"activecm/DBTest","owner":"activecm","description":"Managed Integration Testing Dependencies via Docker for Go","archived":false,"fork":false,"pushed_at":"2018-12-06T21:09:47.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-12T14:46:13.227Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/activecm.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-06T02:22:11.000Z","updated_at":"2022-03-02T19:37:31.000Z","dependencies_parsed_at":"2023-03-13T17:08:43.995Z","dependency_job_id":null,"html_url":"https://github.com/activecm/DBTest","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activecm%2FDBTest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activecm%2FDBTest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activecm%2FDBTest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activecm%2FDBTest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/activecm","download_url":"https://codeload.github.com/activecm/DBTest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241447518,"owners_count":19964314,"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":[],"created_at":"2024-11-13T07:18:51.699Z","updated_at":"2025-10-26T18:50:42.281Z","avatar_url":"https://github.com/activecm.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DBTest: Managed Integration Testing Dependencies via Docker for Go\n\n### DBTest Allows You to Test Against a Real Database\n\nUsing the Docker API, your Go program can manage its own\ntesting dependencies.\n\nThis is especially useful when writing integration tests\n(or when it's simply impossible to mock out a dependency).\n\n## MongoDB\n\n```go\n//Create a new Loader. This may error is Docker is not accessible\nl, err := docker.NewLoader()\n//Create a new MongoDB container using the loader\nmongo, err := NewMongoDBContainer(context.Background(), l)\n//Obtain an mgo.Session to contact MongoDB\nssn, err := mongo.NewSession()\n//Do something with the Session\nerr = ssn.Ping()\n//Stop and remove the MongoDB container\nerr = l.StopService(context.Background(), mongo)\n_ = err\n```\n\n## Arbitrary Ephemeral Docker Containers\n```go\n//Create a new Loader. This may error is Docker is not accessible\nloader, err := docker.NewLoader()\nhelloWorldSpec := docker.ServiceSpecification{\n  FullyQualifiedImageName: \"library/hello-world\",\n  ContainerConfig: \u0026container.Config{\n    Image: \"hello-world\",\n  },\n}\nservice, err := loader.StartService(context.Background(), \u0026helloWorldSpec)\n//no StopService call since \"hello-world\" exits on its own\n_ = err\n```\n\n## Docker API Version\nThe Go Docker API is notoriously hard to vendor due to the Moby rename.\n\nThis API is based off of commit `21291e5aefe1f13f3208d57bcc4183848c492bd1`\non Moby/Moby which was committed to master on June 6th, 2018.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factivecm%2Fdbtest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Factivecm%2Fdbtest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factivecm%2Fdbtest/lists"}