{"id":37157788,"url":"https://github.com/wyndhblb/go-utils","last_synced_at":"2026-01-14T18:50:01.573Z","repository":{"id":79767585,"uuid":"79990312","full_name":"wyndhblb/go-utils","owner":"wyndhblb","description":"Things in go i keep repeating in random forms.","archived":false,"fork":false,"pushed_at":"2017-02-02T18:32:05.000Z","size":42,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-21T15:43:17.508Z","etag":null,"topics":["golang-library","once","parse-time","sorts","toml-parser"],"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/wyndhblb.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":"2017-01-25T06:48:07.000Z","updated_at":"2017-02-02T03:11:07.000Z","dependencies_parsed_at":"2023-06-06T04:15:45.795Z","dependency_job_id":null,"html_url":"https://github.com/wyndhblb/go-utils","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wyndhblb/go-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wyndhblb%2Fgo-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wyndhblb%2Fgo-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wyndhblb%2Fgo-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wyndhblb%2Fgo-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wyndhblb","download_url":"https://codeload.github.com/wyndhblb/go-utils/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wyndhblb%2Fgo-utils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28430933,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T16:38:47.836Z","status":"ssl_error","status_checked_at":"2026-01-14T16:34:59.695Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["golang-library","once","parse-time","sorts","toml-parser"],"created_at":"2026-01-14T18:50:00.796Z","updated_at":"2026-01-14T18:50:01.568Z","avatar_url":"https://github.com/wyndhblb.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-utils\n\n\nIdeally you'd clone the usual ...\n\n\n    go get github.com/wyndhblb/go-utils/{thing-you-want}\n   \n\nAll of these things are really too simple to matter, but they are here so i don't constantly have to repeat myself.\n\n\n## bitstream\n\nFrom https://github.com/dgryski/go-tsz/blob/master/bstream.go but \"public\" so that it can be used in many a place for many things.\n\nHats off dgryski.\n\nThis is the least \"simple\" thing here (at least for those that can't bit shift in their heads).\n\n## once\n\nEver not want to start something (or stop) but make sure start did not happen more then once? Say hello to StartStop.\n\n## pools\n\nIf you're using sync.Pool, I bet you've created a zillion of these (byte, buffer, mutexes, wait groups) .. put them in a spot.\n\n## shutdown\n\nHaving many go routines to deal with their shutdown in a nice way from a SIGINT can be painful. Especially if the routines\nare very disjointed.  Not really connected to other ones via some channel mechanism as that would require a very large \nselect/case tree of large proportion, when all you want is to get a \"Poison Pill message\" and let things empty their queues \nand finish. This is basically a global wait group for that action.\n\n## tomlenv\n\nA missing part of TOML, simply pull some singular vars from the ENV (aka docker for like things) inside a very large \ncomplicated config file.\n\n## options\n\nA really simple map like entity for config options, that will check value types when getting them.\n\n## shared\n\nYep a global \"super map of stuff\".  I know it's \"frowned\" upon, but just like shutdown, go is a compiled language, native,\nASM lang at its core.  This can be really useful for performance, and pushing/read a nodes config options around the \nfarms (this is not zookeeper, it's internal, but lets one set a submodule's state for easy reading by something else).\n \n## sorts\n\nThe fact that `sort.Sort` cannot natively sort the basic types is, well, ..., so the basic u/int64-\u003e8 have sorts.\n\n## parsetime\n\nParse strings that golang cannot parse into times and durations\n\n    \n    // ParseTime -- string to time\n    //\n    // 2006-01-02T15:04:05Z07:00 (RFC3339)\n    // 2006-01-02 15:04:05\n    // 2006-01-02\n    // 2006-01-02 15:04\n    // 2006-01-02 15\n    // Mon Jan 2 15:04:05 -0700 MST 2006\n    //\n    // now\n    // today\n    // yesterday\n    // lastweek\n    //\n    // and \"durations from the epoch\"\n    //\n    // 1s, 1sec\n    // 1m, 1min\n    // 1d, 1day\n    // 1mon, 1month\n    // 1y, 1year\n    //\n    // finally attempt to parse an epoch time\n    //\n    // 1485984333\n    // 1485984333.123\n    // 1485984333.123123\n    // 1485984333.123123123\n    \n\n    // ParseDuration  -- string to a duration\n    // strings can be of the form\n    // now -\u003e nil\n    // 1s, 1sec, 1second\n    // 1m, 1min\n    // 1h, 1hour\n    // 1d, 1day\n    // 1mon, 1month\n    // 1y, 1year","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwyndhblb%2Fgo-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwyndhblb%2Fgo-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwyndhblb%2Fgo-utils/lists"}