{"id":15096091,"url":"https://github.com/yannhulot/petstore","last_synced_at":"2026-02-16T11:03:00.590Z","repository":{"id":113967091,"uuid":"220395802","full_name":"YannHulot/petstore","owner":"YannHulot","description":"This is a pet store where you can look up pets and save new pets","archived":false,"fork":false,"pushed_at":"2019-11-17T22:29:10.000Z","size":466,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-03T17:57:34.665Z","etag":null,"topics":["circleci","database","docker","docker-compose","gin-gonic","golang","golangci-lint","gorm","mit-license","postgresql","sqlmock"],"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/YannHulot.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":"2019-11-08T05:49:28.000Z","updated_at":"2025-01-29T14:12:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"374d345c-4695-4444-a38f-80737e13d7da","html_url":"https://github.com/YannHulot/petstore","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/YannHulot/petstore","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YannHulot%2Fpetstore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YannHulot%2Fpetstore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YannHulot%2Fpetstore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YannHulot%2Fpetstore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YannHulot","download_url":"https://codeload.github.com/YannHulot/petstore/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YannHulot%2Fpetstore/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29506326,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T09:05:14.864Z","status":"ssl_error","status_checked_at":"2026-02-16T08:55:59.364Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["circleci","database","docker","docker-compose","gin-gonic","golang","golangci-lint","gorm","mit-license","postgresql","sqlmock"],"created_at":"2024-09-25T15:45:23.996Z","updated_at":"2026-02-16T11:03:00.563Z","avatar_url":"https://github.com/YannHulot.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pet Store\n\nTo whom it may concern,\nThis app will allow you to store and retrieve pets.\n\nI believe there are a few issues in the code but it is doing 99% of what it is supposed to do.\nIf you see a bug, please open an issue.\n\n## Build status\n\n[![CircleCI](https://circleci.com/gh/YannHulot/petstore/tree/master.svg?style=svg)](https://circleci.com/gh/YannHulot/petstore/tree/master)\n\n## Motivation\n\nThis project is demonstration of my skills in different areas such as API design and Golang development work.\n\n## Code style\n\nCode is formatted with Go vet and Go fmt.\n\nThe linter golangci-lint is used to ensure the highest code quality and avoid potential bugs.\n\n## Tech/framework used\n\nWritten in Golang, this project uses may open source libraries and frameworks such as for example:\n\n- Gin router\n- Gorm database ORM\n- SQLMock to mock database interactions\n- PostgreSQL as a database\n- Docker for easy deployment\n\n## Examples of queries\n\n### Save a Pet\n\n### Example of payload when saving a new pet\n\n```json\n{\n    \"category\": {\n        \"id\": 90,\n        \"name\": \"test-category\"\n    },\n    \"name\": \"pet 87\",\n    \"photoUrls\": [\n        \"testurl\",\n        \"t39\"\n    ],\n    \"tags\": [\n    {\n        \"id\": 8990,\n        \"name\": \"test-category 2\"\n    },{\n        \"id\": 79,\n        \"name\": \"test-category 2\"\n    }],\n    \"status\": \"sold\"\n}\n```\n\n### Save a pet\n\n```curl\ncurl -v -XPOST -H \"Content-type: application/json\" -d '{\n    \"category\": {\n        \"id\": 90,\n        \"name\": \"test-category\"\n    },\n    \"name\": \"pet 87\",\n    \"photoUrls\": [\n        \"testurl\",\n        \"t39\"\n    ],\n    \"tags\": [\n    {\n        \"id\": 8990,\n        \"name\": \"test-category 2\"\n    },{\n        \"id\": 79,\n        \"name\": \"test-category 2\"\n    }],\n    \"status\": \"sold\"\n}' 'http://localhost:8080/api/v1/pet'\n```\n\nOr use your favorite request tool creator such as Postman.\n\n### Get a pet\n\n```curl\ncurl -XGET 'http://localhost:8080/api/v1/pet/1'\n```\n\n### Delete a pet\n\n```curl\ncurl -XDELETE 'http://localhost:8080/api/v1/pet/1'\n```\n\n### Get pets by status\n\n```curl\ncurl -XGET 'http://localhost:8080/api/v1/pet/findByStatus?status=sold'\n```\n\n#### Get pet with multiple statuses\n\n```curl\ncurl -XGET 'http://localhost:8080/api/v1/pet/findByStatus?status=sold\u0026status=pending'\n```\n\n### Update a pet's attributes via form data\n\n```curl\ncurl -X POST \"http://localhost:8080/api/v1/pet/8\" -H  \"accept: application/json\" -H  \"Content-Type: application/x-www-form-urlencoded\" -d \"name=doggyboy\u0026status=taken\"\n```\n\n### Update a pet's image\n\n```curl\ncurl -X POST \"http://localhost:8080/api/v1/pet/1/uploadImage\" -H  \"accept: application/json\" -H  \"Content-Type: multipart/form-data\" -F \"additionalMetadata=test\" -F \"file=@name-of-your-file.png;type=image/png\"\n```\n\n## Error responses\n\nErrors will be returned in this format:\n\n```json\n{\n  \"type\": \"error\",\n  \"message\" : \"this is an error\"\n}\n```\n\n## Installation\n\nSteps:\n\n```bash\ngit clone https://github.com/YannHulot/petstore\n```\n\n```bash\ncd petstore\n```\n\n```bash\ndocker-compose up --build\n```\n\nWait about 2 minutes for everything to be set up depending on your internet speed and for the different services to start.\n\nIf everything went well you should now have the server running on port 8080\n\n## Shut down the application\n\n```bash\ndocker-compose down\n```\n\n### Warning\n\nI would suggest to not change the env variables unless you know what you are doing.\n\n## API Reference\n\nThe API reference can be found at: \u003chttps://petstore.swagger.io/\u003e\n\n## Tests\n\nThe tests can be run by using the command: `go test ./...`\n\n## Credits\n\nI Found help on Stack Overflow, Medium and in other parts of the internet.\n\n## License\n\nMIT License\n\nCopyright (c)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyannhulot%2Fpetstore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyannhulot%2Fpetstore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyannhulot%2Fpetstore/lists"}