{"id":20433884,"url":"https://github.com/flashbots/go-utils","last_synced_at":"2025-04-12T21:08:50.818Z","repository":{"id":39863709,"uuid":"460136337","full_name":"flashbots/go-utils","owner":"flashbots","description":"Reusable Go utilities and modules","archived":false,"fork":false,"pushed_at":"2025-04-02T12:21:31.000Z","size":123,"stargazers_count":17,"open_issues_count":0,"forks_count":9,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-04-12T21:08:31.479Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/flashbots.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":"2022-02-16T18:51:48.000Z","updated_at":"2025-04-09T10:20:44.000Z","dependencies_parsed_at":"2024-06-11T18:05:16.272Z","dependency_job_id":"1ae8094f-e2aa-4a43-adca-1973cdba872d","html_url":"https://github.com/flashbots/go-utils","commit_stats":null,"previous_names":["flashbots/goutils"],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Fgo-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Fgo-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Fgo-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Fgo-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flashbots","download_url":"https://codeload.github.com/flashbots/go-utils/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631676,"owners_count":21136562,"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-15T08:22:10.071Z","updated_at":"2025-04-12T21:08:50.769Z","avatar_url":"https://github.com/flashbots.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-utils\n\n[![Test status](https://github.com/flashbots/go-utils/workflows/Checks/badge.svg)](https://github.com/flashbots/go-utils/actions?query=workflow%3A%22Checks%22)\n\nVarious reusable Go utilities and modules\n\n\n## `cli`\n\nVarious minor command-line interface helpers: [`cli.go`](https://github.com/flashbots/go-utils/blob/main/cli/cli.go)\n\n## `httplogger`\n\nLogging middleware for HTTP requests using [`go-ethereum/log`](https://github.com/ethereum/go-ethereum/tree/master/log).\n\nSee [`examples/httplogger/main.go`](https://github.com/flashbots/goutils/blob/main/examples/httplogger/main.go)\n\nInstall:\n\n```bash\ngo get github.com/flashbots/go-utils/httplogger\n```\n\nUse:\n\n```go\nmux := http.NewServeMux()\nmux.HandleFunc(\"/v1/hello\", HelloHandler)\nloggedRouter := httplogger.LoggingMiddleware(r)\n```\n\n## `jsonrpc`\n\nMinimal JSON-RPC client implementation.\n\n## `blocksub`\n\nSubscribe for new Ethereum block headers by polling and/or websocket subscription\n\nSee [`examples/blocksub/main.go`](https://github.com/flashbots/goutils/blob/main/examples/blocksub/main.go) and [`examples/blocksub/multisub.go`](https://github.com/flashbots/goutils/blob/main/examples/blocksub/multisub.go)\n\nInstall:\n\n```bash\ngo get github.com/flashbots/go-utils/blocksub\n```\n\nUse:\n\n```go\nblocksub := blocksub.NewBlockSub(context.Background(), httpURI, wsURI)\nif err := blocksub.Start(); err != nil {\n    panic(err)\n}\n\n// Subscribe to new headers\nsub := blocksub.Subscribe(context.Background())\nfor header := range sub.C {\n    fmt.Println(\"new header\", header.Number.Uint64(), header.Hash().Hex())\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflashbots%2Fgo-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflashbots%2Fgo-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflashbots%2Fgo-utils/lists"}