{"id":22428250,"url":"https://github.com/technicallyjosh/go-api-example","last_synced_at":"2025-07-29T15:13:36.789Z","repository":{"id":86788708,"uuid":"273355033","full_name":"technicallyjosh/go-api-example","owner":"technicallyjosh","description":"Example of a go API","archived":false,"fork":false,"pushed_at":"2020-06-19T16:04:54.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-02-26T18:56:21.606Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":false,"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/technicallyjosh.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":"2020-06-18T22:51:21.000Z","updated_at":"2024-06-19T11:08:01.386Z","dependencies_parsed_at":"2023-07-12T08:00:10.519Z","dependency_job_id":null,"html_url":"https://github.com/technicallyjosh/go-api-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/technicallyjosh/go-api-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technicallyjosh%2Fgo-api-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technicallyjosh%2Fgo-api-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technicallyjosh%2Fgo-api-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technicallyjosh%2Fgo-api-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/technicallyjosh","download_url":"https://codeload.github.com/technicallyjosh/go-api-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technicallyjosh%2Fgo-api-example/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267706674,"owners_count":24131198,"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","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-12-05T20:14:13.529Z","updated_at":"2025-07-29T15:13:36.736Z","avatar_url":"https://github.com/technicallyjosh.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-api-example\n\nExample of a go API with a password validation endpoint and tests. The service runs on port 8000.\n\nThe correct credentials are:\n\n**username**: technicallyjosh\u003cbr\u003e\n**password**: testing123\n\n## Dependencies\n\n- [Go 1.14+](https://golang.org/doc/install)\n\n## Local\n\n**Install Dependencies**\n\n```console\n$ go mod download\n```\n\n**Build and Run**\n\n```console\n\n$ go build \u0026\u0026 ./go-api-example\n```\n\n**Run**\n\n```console\n$ go run .\n```\n\n**Test**\n\n```console\n$ go test\n```\n\n## In Docker\n\n**Build**\n\n```console\n$ docker build -t go-api-example .\n```\n\n**Run server**\n\n```console\n$ docker run --rm -p 8000:8000 go-api-example\n```\n\n## Running Tests\n\n**Local**\n\n```console\n$ go mod download\n$ go test\n```\n\n**Docker**\n\n```console\n$ docker run --rm go-api-example /bin/bash -c \"go test\"\n```\n\n## Routes\n\n### `PUT /users/verify`\n\nVerifies a password for a user. In this example it's more like a login without assigning a token or\nsession etc... Normally when just _verifying_ a user's password, we'd accept a signed token in the\nheader and get the username or id from it.\n\n#### Request Body (JSON)\n\n| Property | Type     | Required |\n| -------- | -------- | -------- |\n| username | `string` | Yes      |\n| password | `string` | Yes      |\n\n#### Example\n\n```console\n$ curl -i -XPUT localhost:8000/users/verify -d '\n{\n    \"username\": \"technicallyjosh\",\n    \"password\": \"testing123\"\n}'; echo\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechnicallyjosh%2Fgo-api-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechnicallyjosh%2Fgo-api-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechnicallyjosh%2Fgo-api-example/lists"}