{"id":34193357,"url":"https://github.com/baileywickham/train_station","last_synced_at":"2026-03-09T22:31:19.721Z","repository":{"id":130362911,"uuid":"230013883","full_name":"baileywickham/train_station","owner":"baileywickham","description":"A containerized simulation of a train station server with api, cli, db, ci/cd support.","archived":false,"fork":false,"pushed_at":"2020-03-01T21:04:29.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-03-09T03:25:53.985Z","etag":null,"topics":["actions","docker","golang"],"latest_commit_sha":null,"homepage":"","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/baileywickham.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-12-24T23:29:32.000Z","updated_at":"2024-06-19T12:24:09.890Z","dependencies_parsed_at":"2023-03-13T11:16:26.875Z","dependency_job_id":null,"html_url":"https://github.com/baileywickham/train_station","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/baileywickham/train_station","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baileywickham%2Ftrain_station","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baileywickham%2Ftrain_station/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baileywickham%2Ftrain_station/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baileywickham%2Ftrain_station/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/baileywickham","download_url":"https://codeload.github.com/baileywickham/train_station/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baileywickham%2Ftrain_station/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30314627,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T20:05:46.299Z","status":"ssl_error","status_checked_at":"2026-03-09T19:57:04.425Z","response_time":61,"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":["actions","docker","golang"],"created_at":"2025-12-15T16:36:43.090Z","updated_at":"2026-03-09T22:31:19.706Z","avatar_url":"https://github.com/baileywickham.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# train_station\n\n![passing?](https://github.com/baileywickham/train_station/workflows/Go/badge.svg)\n\nA go program to simulate a train station. Uses **Github Actions** to run tests, lint, and build binary files.\n\nWhy? No reason really, seemed like a fun project and I like golang. \n\n## Requirements\nThis repo requires docker to be installed on the host system. golang is recommended but a docker container is also provided.\n\n## Use\nRun `./pgstart.sh` to start a docker container containing the database. This will create the database and related tables for the server. Scripts in `./scripts`: `backup.sh` and `restore.sh` are provided to backup and restore testing databases.\n\nThis program also runs in a docker container. User `dockerbuild.sh` to start this container. Useful if golang is not installed\n\nUse `go run .` to start the program. `-api` and `-cli` provide repective functionality. There are a couple api urls avaible:\n- `/show-all`\n- `/create-account?name=\u0026balance=`\n- `/server-config`\n- `/show?uuid=`\n\nThis project uses redis like functionality. This means that the most up to date accounts are stored in memory and once a second they are copied (on another thread) to the database, this is done with build-in gorountines and channels. The actual effectiveness of this is probably less than useless, but it was fun to impliment. \n\n\n`config.go` has constants that can be changed.\n\nUse `go test` to manualy run unit tests\n\n## TODO\n- add redis functionality [sort of done]\n- make object oriented [doneis]\n- better error handling [done]\n- add database support [done]\n- add fileparsing support (runner)\n- fix runner to not panic on all arguments [done]\n- write more unit tests\n- use rpi to do real rfid reading\n\n## Notes/improvements\n- golang sql package currently [does not](https://github.com/golang/go/issues/18478) support dynamiclly naming tables.\n- Many features of this project are global in scope. This is not good.\n- Naming and comments are sparse and not consistent.\n- Tests are lacking to say the least.\n- Creating an Account relies on the database to create the UUID\n- \"redis\" functionality does not use channels like go recommends. It uses `time.Sleep` instead a `ticker` and could probably be implimented in a way that better takes advantage of go's concurrency patterns. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaileywickham%2Ftrain_station","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaileywickham%2Ftrain_station","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaileywickham%2Ftrain_station/lists"}