{"id":17239334,"url":"https://github.com/rehacktive/qaservice","last_synced_at":"2025-03-26T02:36:52.819Z","repository":{"id":149775074,"uuid":"532927043","full_name":"rehacktive/qaservice","owner":"rehacktive","description":null,"archived":false,"fork":false,"pushed_at":"2022-09-05T16:40:15.000Z","size":56,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-30T23:44:18.394Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rehacktive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-09-05T14:04:49.000Z","updated_at":"2022-09-05T14:05:31.000Z","dependencies_parsed_at":"2023-05-09T13:31:29.252Z","dependency_job_id":null,"html_url":"https://github.com/rehacktive/qaservice","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/rehacktive%2Fqaservice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rehacktive%2Fqaservice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rehacktive%2Fqaservice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rehacktive%2Fqaservice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rehacktive","download_url":"https://codeload.github.com/rehacktive/qaservice/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245577676,"owners_count":20638354,"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-10-15T05:48:27.958Z","updated_at":"2025-03-26T02:36:52.800Z","avatar_url":"https://github.com/rehacktive.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# QuestionAnswers Service\n\n## Run it\n\nRun the entire project (service + mongo + mongo express):\n\n```sh\ndocker-compose up -d --build qaservice\n```\n\nor just run Mongo on docker:\n\n```sh\ndocker run -d -p 27017:27017 --name test-mongo mongo:latest\n```\nand then just:\n```sh\ngo run main.go\n```\n\n## Manual examples (using curl)\n\n```sh\n# create\n\u003e curl -X POST -d '{\"key\":\"name\",\"value\":\"john\"}' http://localhost:8880/answers | jq .\n{\n  \"id\": \"631617b8481428005dd1a982\"\n}\n\n# get\n\u003e curl http://localhost:8880/answers/name | jq .\n{\n  \"id\": \"631617b8481428005dd1a982\",\n  \"key\": \"name\",\n  \"value\": \"john\"\n}\n\n# error on conflict\n\u003e curl -X POST -d '{\"key\":\"name\",\"value\":\"john\"}' http://localhost:8880/answers | jq .\n{\n  \"error_message\": \"key already exists, conflict\"\n}\n\n# get events\n\u003e curl http://localhost:8880/events/name | jq .\n[\n  {\n    \"id\": \"631617b8481428005dd1a983\",\n    \"event_type\": \"CREATE\",\n    \"data\": {\n      \"id\": \"631617b8481428005dd1a982\",\n      \"key\": \"name\",\n      \"value\": \"john\"\n    }\n  }\n]\n# update\n\u003e curl -X PUT -d '{\"key\":\"name\",\"value\":\"jack\"}' http://localhost:8880/answers | jq .\n\n# fetch updated\n\u003e curl http://localhost:8880/answers/name | jq .\n{\n  \"id\": \"631617b8481428005dd1a982\",\n  \"key\": \"name\",\n  \"value\": \"jack\"\n}\n```\n\n## A sample unit test\n\nA sample unit test for the usecase has been added.\n\n## Some integration tests\n\nSome integration tests using docker compose with testcontainers are implemented.\nYou can find them in `service/integration_test.go` and run `TestIntegration` (it could take a while).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frehacktive%2Fqaservice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frehacktive%2Fqaservice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frehacktive%2Fqaservice/lists"}