{"id":19228905,"url":"https://github.com/heppu/todo","last_synced_at":"2025-08-24T11:04:43.314Z","repository":{"id":84342022,"uuid":"157549140","full_name":"heppu/todo","owner":"heppu","description":null,"archived":false,"fork":false,"pushed_at":"2018-11-30T10:19:56.000Z","size":190,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-23T10:42:57.564Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/heppu.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-14T12:58:31.000Z","updated_at":"2018-11-30T10:21:25.000Z","dependencies_parsed_at":"2023-07-06T22:31:43.756Z","dependency_job_id":null,"html_url":"https://github.com/heppu/todo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/heppu/todo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heppu%2Ftodo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heppu%2Ftodo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heppu%2Ftodo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heppu%2Ftodo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heppu","download_url":"https://codeload.github.com/heppu/todo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heppu%2Ftodo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263385761,"owners_count":23458745,"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-11-09T15:30:57.404Z","updated_at":"2025-07-03T19:07:50.177Z","avatar_url":"https://github.com/heppu.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go Course\n\n\n## Table of content\n\n- [x] Dependency management\n- [x] HTTP server\n    - [x] http test utils\n    - [x] json en/decoding\n    - [x] graceful shutdown\n- [x] Makefile\n    - [x] Run tests\n    - [x] Run static checks\n    - [x] Build binary\n    - [x] Build Docker image\n    - [x] go mod in Makefile\n- [x] Error handling\n    - [x] fmt.Errorf()\n    - [x] errors.New()\n- [x] Coding patterns/conventions\n    - [x] Struct methods\n    - [x] Embedded structs\n    - [x] Early exit strategy\n    - [x] Interfaces\n- [x] Folder structure\n    - [x] Single command (main in root)\n    - [x] Multi command (cmd/{name}/main.go})\n- [x] Testing\n    - [x] Basic test function\n    - [x] Assert and require\n    - [x] Table driven testing\n    - [x] HTTP testing\n    - [x] Benchmarking\n- [x] Profiling\n    - [x] CPU\n    - [x] Memory\n    - [x] Tracing\n    - [x] HTTP load testing\n- [x] Docker\n    - [x] security\n    - [x] multistage build\n    - [x] image size\n    - [x] boot up time\n\n## Extra material:\n- [ ] Goroutines, channels, WaitGroups, etc\n- [ ] Anonymous functions and closures\n- [ ] Mocks in testing\n- [ ] Debugger\n- [ ] Integration tests\n\n## Flow\n\n* Initial commit\n    * create repo\n    * clone repo\n* Add README and Makefile\n    * add test target\n    * go mod init\n* Initial TODO list implementation\n    * test case for todo list\n    * add lint target\n    * add vendor target\n    * make vendor\n    * List struct\n    * Task struct\n    * Create pointer receivers for List\n    * Split Task to Task and TaskData\n    * Static error\n* Add benchmark\n    * add benchmark target\n* Add TaskData validation and table-driven tests\n    * table-driven testing\n    * convert to subtests\n    * add utf-8 string in test\n    * fix string validation to support utf-8\n* Use parallel subtests\n    * wrap with t.Run()\n    * copy test variable\n* Validate string length in runes\n    * fix validate function implementation\n* Take TaskData validation in use and add benchcmp\n    * use validate func in Add method\n    * add benchcmp target\n    * run benchcmp\n* Add test case for rest API\n    * create test case with Recorder\n    * make vendor\n    * create test case with TestServer\n* Implement REST API for todo list\n    * create Handler struct\n    * wrapper List implementation\n    * create endpoint handlers\n* Make api test parallel\n    * race detection\n* Make todo list thread safe\n    * atomic uint\n    * sync map\n    * benchcomp\n* Add cmd to run server\n    * add build target\n    * init todo list and router\n    * start server\n    * listen SIGINT and SIGTERM\n    * graceful shutdown\n    * demonstrate with sleep in handler func\n* Create api and mem subpackages\n    * move List to mem\n    * move Handler to api\n    * create interface for List\n* Create postgres implementation of List\n    * create postgres implementation of List\n    * test by taking into use in main.go\n* Add Dockerfile\n    * add docker-image target\n    * add docker-run target\n    * create multistage dockerfile\n* Add targets for docker image size and boot up time\n    * compare with reference java implementation\n* Add http load testing targets\n    * add docker-stats target\n    * add wrk target\n    * add vegeta target\n    * java vs go\n        * memory usage\n        * avg req/s\n        * java warmup time\n        * perf while warming up\n* Add profiling targets and pprof server\n    * add profiling server\n    * add cpu-profile target\n    * add heap-profile target\n    * add test-profile target\n    * expose 6060 port for docker\n    * show cpu profile\n    * show heap profile\n    * change CreatedAt to UTC()\n    * compare mem usage\n* Add execution tracer target\n    * add trace-profile target\n    * profile while wrk-post is running\n* Add clean target\n    * clean prof, html, bin, build, etc files\n\n### Example queries\n\nCreate task:\n```sh\nprintf '{\"Name\": \"my task\", \"CreatedAt\": \"%s\"}' $(date -Is) | curl -H 'Content-Type: application/json' -d @- 127.0.0.1:8000/api/tasks\n```\n\nGet task:\n```sh\ncurl localhost:8000/api/tasks/0\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheppu%2Ftodo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheppu%2Ftodo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheppu%2Ftodo/lists"}