{"id":20321303,"url":"https://github.com/soyvural/simple-device-api","last_synced_at":"2026-05-12T09:31:32.440Z","repository":{"id":214807585,"uuid":"423881631","full_name":"soyvural/simple-device-api","owner":"soyvural","description":"Restful API example with using go and gin framework","archived":false,"fork":false,"pushed_at":"2021-11-18T17:59:25.000Z","size":32,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-04T09:43:43.842Z","etag":null,"topics":["gin","gin-framework","go","golang","restful-api"],"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/soyvural.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}},"created_at":"2021-11-02T14:43:48.000Z","updated_at":"2021-11-18T17:59:28.000Z","dependencies_parsed_at":"2023-12-31T00:29:37.524Z","dependency_job_id":null,"html_url":"https://github.com/soyvural/simple-device-api","commit_stats":null,"previous_names":["soyvural/simple-device-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/soyvural/simple-device-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soyvural%2Fsimple-device-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soyvural%2Fsimple-device-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soyvural%2Fsimple-device-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soyvural%2Fsimple-device-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/soyvural","download_url":"https://codeload.github.com/soyvural/simple-device-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soyvural%2Fsimple-device-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32932317,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-12T09:19:52.626Z","status":"ssl_error","status_checked_at":"2026-05-12T09:17:33.438Z","response_time":102,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["gin","gin-framework","go","golang","restful-api"],"created_at":"2024-11-14T19:13:06.075Z","updated_at":"2026-05-12T09:31:32.423Z","avatar_url":"https://github.com/soyvural.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# simple device api\n\nSimple Device API is really simple and concise to show how easy to implement a Restful Service with using Golang.\n\nIt uses [gin](https://github.com/gin-gonic/gin) framework for http router.\n\n\n### Generate OpenAPI spec doc with swagger\n```shell\nswag init -g doc.go\n```\n\n### Build docker image locally\n```shell\nBUILD_VERSION=0.0.1\ndocker build -f build/Dockerfile -t docker.io/simple-device-api:$BUILD_VERSION .\n```\n\n### Run with docker in your local\n```shell\ndocker run -p 8080:8080 docker.io/simple-device-api:$BUILD_VERSION\n```\n\n### Build and publish with docker\n```shell\nDOCKER_USERNAME=\"\"\nDOCKER_PASSWORD=\"\"\nsh build/build.sh $BUILD_VERSION\n```\n\n### Run from source code in your local\n```shell\nGIN_MODE=debug go run cmd/api/main.go --port 8080\n```\n\n### Swagger documentation URL\nhttp://HOST:PORT/swagger/index.html\n### Examples\n#### Create a device\n```shell\ncurl --location --request POST 'http://127.0.0.1:8080/api/v1/devices' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n    \"name\" : \"Iphone\",\n    \"brand\": \"Apple\",\n    \"model\": \"13 Pro Max\"\n}'\n```\n#### Get a device\n```shell\ncurl --location --request GET 'http://localhost:8080/api/v1/devices/{id}' \\\n--data-raw ''\n```\n\n#### Delete a device\n```shell\ncurl --location --request DELETE 'http://localhost:8080/api/v1/devices/{id}' \\\n--data-raw ''\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoyvural%2Fsimple-device-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoyvural%2Fsimple-device-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoyvural%2Fsimple-device-api/lists"}