{"id":21770237,"url":"https://github.com/jonathan-foucher/go-api-example","last_synced_at":"2026-04-19T03:32:17.432Z","repository":{"id":260823189,"uuid":"882308734","full_name":"jonathan-foucher/go-api-example","owner":"jonathan-foucher","description":"An example of API with Go","archived":false,"fork":false,"pushed_at":"2024-11-06T22:25:09.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-21T06:14:58.681Z","etag":null,"topics":["go","sqlc"],"latest_commit_sha":null,"homepage":"","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/jonathan-foucher.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":"2024-11-02T13:30:05.000Z","updated_at":"2024-11-06T22:28:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"515c5fd1-4bc3-48a0-a230-8cc40e2e9230","html_url":"https://github.com/jonathan-foucher/go-api-example","commit_stats":null,"previous_names":["jonathan-foucher/go-api-example"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jonathan-foucher/go-api-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathan-foucher%2Fgo-api-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathan-foucher%2Fgo-api-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathan-foucher%2Fgo-api-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathan-foucher%2Fgo-api-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonathan-foucher","download_url":"https://codeload.github.com/jonathan-foucher/go-api-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathan-foucher%2Fgo-api-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31993740,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"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":["go","sqlc"],"created_at":"2024-11-26T14:11:47.260Z","updated_at":"2026-04-19T03:32:17.408Z","avatar_url":"https://github.com/jonathan-foucher.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Introduction\nThis project is an example of a Go API with sqlc and a postgres database.\n\n## Run the project\n### Database\nInstall postgres locally or run it through docker with :\n```\ndocker run -p 5432:5432 -e POSTGRES_DB=my_database -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres postgres\n```\n\nYou will need to run the this request to create the movie table :\n```\ncreate table movie (\n    id              integer         primary key,\n    title           varchar(50)     not null,\n    release_date    date            not null\n);\n```\n\n### Application\nOnce the postgres database is started and the movie table created, you can start the Go project and try it out.\n\nStart the application\n```\ngo run main.go\n```\n\nGet all the movies\n```\ncurl --location 'http://localhost:3000/api/movies'\n```\n\nSave a movie\n```\ncurl --request POST \\\n  --url http://localhost:3000/api/movies \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n\t\"id\": 26,\n\t\"title\": \"Some movie title\",\n\t\"release_date\": \"2022-02-26\"\n}'\n```\n\nDelete a movie\n```\ncurl --request DELETE \\\n  --url http://localhost:3000/api/movies/26\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathan-foucher%2Fgo-api-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonathan-foucher%2Fgo-api-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathan-foucher%2Fgo-api-example/lists"}