{"id":20459722,"url":"https://github.com/rosbit/list-fetcher","last_synced_at":"2026-06-04T12:31:14.434Z","repository":{"id":61094382,"uuid":"542954002","full_name":"rosbit/list-fetcher","owner":"rosbit","description":"utility to fetch list page by page and change the results to an iterator. 翻页数据转化为迭代器的神器。","archived":false,"fork":false,"pushed_at":"2022-10-09T09:55:51.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-16T00:24:42.414Z","etag":null,"topics":["golang","iterator","list-fetcher","page-fetcher"],"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/rosbit.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}},"created_at":"2022-09-29T06:21:28.000Z","updated_at":"2022-09-29T10:35:09.000Z","dependencies_parsed_at":"2022-10-10T09:52:21.076Z","dependency_job_id":null,"html_url":"https://github.com/rosbit/list-fetcher","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosbit%2Flist-fetcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosbit%2Flist-fetcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosbit%2Flist-fetcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosbit%2Flist-fetcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rosbit","download_url":"https://codeload.github.com/rosbit/list-fetcher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242014722,"owners_count":20057880,"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":["golang","iterator","list-fetcher","page-fetcher"],"created_at":"2024-11-15T12:17:05.735Z","updated_at":"2026-06-04T12:31:14.429Z","avatar_url":"https://github.com/rosbit.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# list-fetcher, a utility to fetch list page by page and change the results to an iterator\n\n## Interface to implement\n\n```go\nimport (\n\t\"encoding/json\"\n)\n\ntype PageFetcher interface {\n    GetNextPage() (total int64, list []json.RawMessage, err error)\n    AdjustPage(list []json.RawMessage)\n    HasMore() bool // called if total is 0\n    ErrorOccurrs(err error)\n}\n```\n\n### Utility functions\n\n```go\nfunc FetchList(pf PageFetcher) (total int64, it \u003c-chan json.RawMessage, err error) {\n    //\n}\n\nfunc Dump(w io.Writer, it \u003c-chan json.RawMessage) {\n    //\n}\nfunc DumpJSON(w io.Writer, it \u003c-chan json.RawMessage) {\n    //\n}\n```\n\n### Usage\n\nSee [list-fetcher_test.go](list-fetcher_test.go)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frosbit%2Flist-fetcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frosbit%2Flist-fetcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frosbit%2Flist-fetcher/lists"}